From d9f448e82e0216924d01ac6b82b6f128eb7e3cee Mon Sep 17 00:00:00 2001 From: Christos Tranoris Date: Mon, 6 Nov 2023 14:41:55 +0200 Subject: [PATCH] Initial commit (cherry picked from commit 14e937903d6b68aba14dd64aa00e3de5d1ad1a95) --- .gitignore | 7 + README.md | 91 +- hackfest_multivdu_vnf.tar | Bin 0 -> 27816 bytes hackfest_multivdu_vnf.zip | Bin 0 -> 27816 bytes pathname | Bin 0 -> 27816 bytes pathname.tar | Bin 0 -> 27816 bytes pathname.tar.gz | Bin 0 -> 22260 bytes pom-generate-sources.xml | 16 + pom.xml | 406 ++ .../NSActionRequestPayload.java | 158 + .../NSCreateInstanceRequestPayload.java | 37 + .../NSInstantiateInstanceRequestPayload.java | 209 + .../OSM10NBIClient/NSScaleRequestPayload.java | 158 + src/main/java/OSM10NBIClient/OSM10Client.java | 1503 +++++++ .../java/OSM10NBIClient/OSM10NBIClientT.java | 488 ++ .../ProjectCreateRequestPayload.java | 65 + .../ProjectEditRequestPayload.java | 54 + .../OSM10NBIClient/ProjectRoleMapping.java | 24 + .../UserCreateRequestPayload.java | 73 + .../UserEditRequestPayload.java | 83 + .../VIMCreateRequestPayload.java | 109 + .../OSM10NBIClient/VIMEditRequestPayload.java | 94 + .../java/OSM10NBIClient/testjsonparse.java | 3977 +++++++++++++++++ .../OSM10NSExtractor.java | 189 + .../OSM10VNFDExtractor.java | 238 + .../OSM10NSReq/OSM10NSRequirements.java | 87 + .../OSM10VNFReq/OSM10VNFRequirements.java | 92 + src/main/java/OSM10Util/examples/Example.java | 83 + .../rev190425/$YangModelBindingProvider.java | 12 + .../rev190425/$YangModuleInfoImpl.java | 173 + .../descriptors/rev190425/AddressType.java | 32 + .../descriptors/rev190425/AffinityScope.java | 75 + .../descriptors/rev190425/AffinityType.java | 71 + .../rev190425/ChangeVnfFlavour.java | 29 + .../rev190425/ChecksumAlgorithm.java | 29 + .../rev190425/ConnectivityType.java | 48 + .../nfv/descriptors/rev190425/CpRole.java | 30 + .../etsi/nfv/descriptors/rev190425/Cpd.java | 175 + .../rev190425/EphemeralStorage.java | 29 + .../nfv/descriptors/rev190425/Ethernet.java | 28 + .../rev190425/EtsiNfvDescriptorsData.java | 53 + .../descriptors/rev190425/FlowPattern.java | 73 + .../nfv/descriptors/rev190425/HealVnf.java | 30 + .../descriptors/rev190425/InstantiateVnf.java | 30 + ...nternalLifecycleManagementScriptEvent.java | 99 + .../nfv/descriptors/rev190425/IpAddress.java | 28 + .../etsi/nfv/descriptors/rev190425/Ipv4.java | 28 + .../etsi/nfv/descriptors/rev190425/Ipv6.java | 28 + .../descriptors/rev190425/LayerProtocol.java | 27 + .../etsi/nfv/descriptors/rev190425/Leaf.java | 28 + .../rev190425/LinkBitrateRequirements.java | 62 + .../LocalAffinityOrAntiAffinityRule.java | 57 + .../nfv/descriptors/rev190425/MacAddress.java | 28 + .../rev190425/ModifyVnfInformation.java | 29 + .../rev190425/MonitoringParameter.java | 75 + .../etsi/nfv/descriptors/rev190425/Mpls.java | 28 + .../etsi/nfv/descriptors/rev190425/Nfv.java | 112 + .../nfv/descriptors/rev190425/NfvBuilder.java | 331 ++ .../etsi/nfv/descriptors/rev190425/Nsd.java | 867 ++++ .../etsi/nfv/descriptors/rev190425/Odu2.java | 28 + .../nfv/descriptors/rev190425/OperateVnf.java | 30 + .../etsi/nfv/descriptors/rev190425/Pnfd.java | 175 + .../nfv/descriptors/rev190425/PseudoWire.java | 28 + .../nfv/descriptors/rev190425/QueryVnf.java | 31 + .../descriptors/rev190425/ResourceHandle.java | 58 + .../etsi/nfv/descriptors/rev190425/Root.java | 28 + .../descriptors/rev190425/RootStorage.java | 29 + .../nfv/descriptors/rev190425/ScaleVnf.java | 32 + .../rev190425/ScaleVnfToLevel.java | 34 + .../rev190425/SecurityGroupRule.java | 93 + .../rev190425/SecurityParameters.java | 71 + .../nfv/descriptors/rev190425/Sha224.java | 29 + .../nfv/descriptors/rev190425/Sha256.java | 29 + .../nfv/descriptors/rev190425/Sha384.java | 29 + .../nfv/descriptors/rev190425/Sha512.java | 29 + .../descriptors/rev190425/StorageType.java | 29 + .../rev190425/SupportedOperation.java | 31 + .../descriptors/rev190425/SwapStorage.java | 29 + .../descriptors/rev190425/TerminateVnf.java | 35 + .../VirtualNetworkInterfaceRequirements.java | 78 + .../etsi/nfv/descriptors/rev190425/Vnfd.java | 1328 ++++++ .../connectivity/type/ConnectivityType.java | 73 + .../type/ConnectivityTypeBuilder.java | 253 ++ .../descriptors/rev190425/cpd/Protocol.java | 122 + .../rev190425/cpd/ProtocolBuilder.java | 292 ++ .../rev190425/cpd/ProtocolKey.java | 64 + .../rev190425/cpd/protocol/AddressData.java | 111 + .../cpd/protocol/AddressDataBuilder.java | 297 ++ .../cpd/protocol/AddressDataKey.java | 64 + .../protocol/address/data/L2AddressData.java | 62 + .../address/data/L2AddressDataBuilder.java | 228 + .../protocol/address/data/L3AddressData.java | 168 + .../address/data/L3AddressDataBuilder.java | 311 ++ .../rule/LocalAffinityOrAntiAffinityRule.java | 75 + ...ocalAffinityOrAntiAffinityRuleBuilder.java | 276 ++ .../LocalAffinityOrAntiAffinityRuleKey.java | 94 + .../nfv/descriptors/rev190425/nfv/Nsd.java | 52 + .../descriptors/rev190425/nfv/NsdBuilder.java | 790 ++++ .../nfv/descriptors/rev190425/nfv/NsdKey.java | 62 + .../nfv/descriptors/rev190425/nfv/Pnfd.java | 52 + .../rev190425/nfv/PnfdBuilder.java | 561 +++ .../descriptors/rev190425/nfv/PnfdKey.java | 62 + .../nfv/descriptors/rev190425/nfv/Vnfd.java | 57 + .../rev190425/nfv/VnfdBuilder.java | 1096 +++++ .../descriptors/rev190425/nfv/VnfdKey.java | 62 + .../nfv/descriptors/rev190425/nsd/Df.java | 610 +++ .../descriptors/rev190425/nsd/DfBuilder.java | 705 +++ .../nfv/descriptors/rev190425/nsd/DfKey.java | 62 + .../nsd/LifecycleManagementScript.java | 66 + .../nsd/LifecycleManagementScriptBuilder.java | 271 ++ .../nsd/LifecycleManagementScriptKey.java | 62 + .../nfv/descriptors/rev190425/nsd/Sapd.java | 139 + .../rev190425/nsd/SapdBuilder.java | 296 ++ .../descriptors/rev190425/nsd/SapdKey.java | 62 + .../rev190425/nsd/VirtualLinkDesc.java | 221 + .../rev190425/nsd/VirtualLinkDescBuilder.java | 464 ++ .../rev190425/nsd/VirtualLinkDescKey.java | 62 + .../nfv/descriptors/rev190425/nsd/Vnffgd.java | 269 ++ .../rev190425/nsd/VnffgdBuilder.java | 425 ++ .../descriptors/rev190425/nsd/VnffgdKey.java | 62 + .../nsd/df/AffinityOrAntiAffinityGroup.java | 95 + .../AffinityOrAntiAffinityGroupBuilder.java | 296 ++ .../df/AffinityOrAntiAffinityGroupKey.java | 62 + .../rev190425/nsd/df/Dependencies.java | 112 + .../rev190425/nsd/df/DependenciesBuilder.java | 296 ++ .../rev190425/nsd/df/DependenciesKey.java | 62 + .../rev190425/nsd/df/MonitoredInfo.java | 100 + .../nsd/df/MonitoredInfoBuilder.java | 296 ++ .../rev190425/nsd/df/MonitoredInfoKey.java | 62 + .../nsd/df/NsInstantiationLevel.java | 173 + .../nsd/df/NsInstantiationLevelBuilder.java | 398 ++ .../nsd/df/NsInstantiationLevelKey.java | 62 + .../rev190425/nsd/df/NsProfile.java | 208 + .../rev190425/nsd/df/NsProfileBuilder.java | 474 ++ .../rev190425/nsd/df/NsProfileKey.java | 62 + .../rev190425/nsd/df/PnfProfile.java | 123 + .../rev190425/nsd/df/PnfProfileBuilder.java | 314 ++ .../rev190425/nsd/df/PnfProfileKey.java | 62 + .../rev190425/nsd/df/ScalingAspect.java | 102 + .../nsd/df/ScalingAspectBuilder.java | 317 ++ .../rev190425/nsd/df/ScalingAspectKey.java | 62 + .../rev190425/nsd/df/VirtualLinkProfile.java | 151 + .../nsd/df/VirtualLinkProfileBuilder.java | 447 ++ .../nsd/df/VirtualLinkProfileKey.java | 62 + .../rev190425/nsd/df/VnfProfile.java | 222 + .../rev190425/nsd/df/VnfProfileBuilder.java | 545 +++ .../rev190425/nsd/df/VnfProfileKey.java | 76 + .../nsd/df/dependencies/PrimaryId.java | 45 + .../nsd/df/dependencies/SecondaryId.java | 45 + .../primary/id/PrimaryNsProfile.java | 35 + .../primary/id/PrimaryNsProfileBuilder.java | 227 + .../primary/id/PrimaryVnfProfile.java | 35 + .../primary/id/PrimaryVnfProfileBuilder.java | 227 + .../secondary/id/SecondaryNsProfile.java | 35 + .../id/SecondaryNsProfileBuilder.java | 227 + .../secondary/id/SecondaryVnfProfile.java | 35 + .../id/SecondaryVnfProfileBuilder.java | 227 + .../monitored/info/MonitoringParameter.java | 92 + .../info/MonitoringParameterBuilder.java | 296 ++ .../df/monitored/info/VnfIndicatorInfo.java | 72 + .../info/VnfIndicatorInfoBuilder.java | 250 ++ .../instantiation/level/NsToLevelMapping.java | 80 + .../level/NsToLevelMappingBuilder.java | 285 ++ .../level/NsToLevelMappingKey.java | 62 + .../level/VirtualLinkToLevelMapping.java | 69 + .../VirtualLinkToLevelMappingBuilder.java | 342 ++ .../level/VirtualLinkToLevelMappingKey.java | 62 + .../level/VnfToLevelMapping.java | 80 + .../level/VnfToLevelMappingBuilder.java | 285 ++ .../level/VnfToLevelMappingKey.java | 62 + .../AffinityOrAntiAffinityGroupId.java | 62 + .../AffinityOrAntiAffinityGroupIdBuilder.java | 248 + .../AffinityOrAntiAffinityGroupIdKey.java | 62 + .../ns/profile/VirtualLinkConnectivity.java | 99 + .../VirtualLinkConnectivityBuilder.java | 291 ++ .../profile/VirtualLinkConnectivityKey.java | 62 + .../link/connectivity/ConstituentCpdId.java | 83 + .../connectivity/ConstituentCpdIdBuilder.java | 271 ++ .../connectivity/ConstituentCpdIdKey.java | 62 + .../pnf/profile/VirtualLinkConnectivity.java | 101 + .../VirtualLinkConnectivityBuilder.java | 291 ++ .../profile/VirtualLinkConnectivityKey.java | 62 + .../link/connectivity/ConstituentCpdId.java | 83 + .../connectivity/ConstituentCpdIdBuilder.java | 271 ++ .../connectivity/ConstituentCpdIdKey.java | 62 + .../profile/AffinityOrAntiAffinityGroup.java | 62 + .../AffinityOrAntiAffinityGroupBuilder.java | 248 + .../AffinityOrAntiAffinityGroupKey.java | 62 + .../link/profile/MaxBitrateRequirements.java | 46 + .../MaxBitrateRequirementsBuilder.java | 298 ++ .../link/profile/MinBitrateRequirements.java | 46 + .../MinBitrateRequirementsBuilder.java | 298 ++ .../profile/AffinityOrAntiAffinityGroup.java | 62 + .../AffinityOrAntiAffinityGroupBuilder.java | 248 + .../AffinityOrAntiAffinityGroupKey.java | 62 + .../vnf/profile/VirtualLinkConnectivity.java | 101 + .../VirtualLinkConnectivityBuilder.java | 291 ++ .../profile/VirtualLinkConnectivityKey.java | 62 + .../link/connectivity/ConstituentCpdId.java | 83 + .../connectivity/ConstituentCpdIdBuilder.java | 271 ++ .../connectivity/ConstituentCpdIdKey.java | 62 + .../rev190425/nsd/sapd/CpdOrVirtualLink.java | 82 + .../nsd/sapd/cpd/or/virtual/link/Ns.java | 34 + .../sapd/cpd/or/virtual/link/NsBuilder.java | 227 + .../nsd/sapd/cpd/or/virtual/link/Pnf.java | 34 + .../sapd/cpd/or/virtual/link/PnfBuilder.java | 227 + .../cpd/or/virtual/link/VirtualLinkDesc.java | 40 + .../virtual/link/VirtualLinkDescBuilder.java | 227 + .../nsd/sapd/cpd/or/virtual/link/Vnf.java | 34 + .../sapd/cpd/or/virtual/link/VnfBuilder.java | 227 + .../nsd/sapd/cpd/or/virtual/link/ns/Ns.java | 64 + .../cpd/or/virtual/link/ns/NsBuilder.java | 250 ++ .../nsd/sapd/cpd/or/virtual/link/pnf/Pnf.java | 64 + .../cpd/or/virtual/link/pnf/PnfBuilder.java | 250 ++ .../nsd/sapd/cpd/or/virtual/link/vnf/Vnf.java | 64 + .../cpd/or/virtual/link/vnf/VnfBuilder.java | 250 ++ .../rev190425/nsd/virtual/link/desc/Df.java | 181 + .../nsd/virtual/link/desc/DfBuilder.java | 295 ++ .../nsd/virtual/link/desc/DfKey.java | 62 + .../nsd/virtual/link/desc/df/Qos.java | 101 + .../nsd/virtual/link/desc/df/QosBuilder.java | 357 ++ .../rev190425/nsd/vnffgd/CpdPool.java | 155 + .../rev190425/nsd/vnffgd/CpdPoolBuilder.java | 296 ++ .../rev190425/nsd/vnffgd/CpdPoolKey.java | 62 + .../rev190425/nsd/vnffgd/Nfpd.java | 124 + .../rev190425/nsd/vnffgd/NfpdBuilder.java | 314 ++ .../rev190425/nsd/vnffgd/NfpdKey.java | 62 + .../cpd/pool/ConstituentBaseElementId.java | 58 + .../nsd/vnffgd/cpd/pool/ConstituentCpdId.java | 74 + .../base/element/id/NsProfile.java | 34 + .../base/element/id/NsProfileBuilder.java | 227 + .../base/element/id/PnfProfile.java | 34 + .../base/element/id/PnfProfileBuilder.java | 227 + .../base/element/id/VnfProfile.java | 34 + .../base/element/id/VnfProfileBuilder.java | 227 + .../base/element/id/ns/profile/NsProfile.java | 53 + .../id/ns/profile/NsProfileBuilder.java | 227 + .../element/id/pnf/profile/PnfProfile.java | 53 + .../id/pnf/profile/PnfProfileBuilder.java | 227 + .../element/id/vnf/profile/VnfProfile.java | 53 + .../id/vnf/profile/VnfProfileBuilder.java | 227 + .../cpd/pool/constituent/cpd/id/Ns.java | 34 + .../pool/constituent/cpd/id/NsBuilder.java | 227 + .../cpd/pool/constituent/cpd/id/Pnf.java | 34 + .../pool/constituent/cpd/id/PnfBuilder.java | 227 + .../cpd/pool/constituent/cpd/id/Vnf.java | 34 + .../pool/constituent/cpd/id/VnfBuilder.java | 227 + .../cpd/pool/constituent/cpd/id/ns/Ns.java | 63 + .../pool/constituent/cpd/id/ns/NsBuilder.java | 250 ++ .../cpd/pool/constituent/cpd/id/pnf/Pnf.java | 63 + .../constituent/cpd/id/pnf/PnfBuilder.java | 250 ++ .../cpd/pool/constituent/cpd/id/vnf/Vnf.java | 63 + .../constituent/cpd/id/vnf/VnfBuilder.java | 250 ++ .../nsd/vnffgd/nfpd/PositionDescId.java | 107 + .../vnffgd/nfpd/PositionDescIdBuilder.java | 291 ++ .../nsd/vnffgd/nfpd/PositionDescIdKey.java | 62 + .../nfpd/position/desc/id/CpProfileId.java | 96 + .../position/desc/id/CpProfileIdBuilder.java | 291 ++ .../nfpd/position/desc/id/CpProfileIdKey.java | 62 + .../id/ConstituentProfileElements.java | 77 + .../id/ConstituentProfileElementsBuilder.java | 271 ++ .../id/ConstituentProfileElementsKey.java | 62 + .../descriptors/rev190425/pnfd/ExtCpd.java | 53 + .../rev190425/pnfd/ExtCpdBuilder.java | 416 ++ .../descriptors/rev190425/pnfd/ExtCpdKey.java | 62 + .../descriptors/rev190425/pnfd/Security.java | 54 + .../rev190425/pnfd/SecurityBuilder.java | 318 ++ .../rev190425/pnfd/SecurityKey.java | 62 + .../group/rule/SecurityGroupRule.java | 349 ++ .../group/rule/SecurityGroupRuleBuilder.java | 412 ++ .../group/rule/SecurityGroupRuleKey.java | 62 + .../VirtualNetworkInterfaceRequirement.java | 123 + ...ualNetworkInterfaceRequirementBuilder.java | 338 ++ ...VirtualNetworkInterfaceRequirementKey.java | 62 + .../NetworkInterfaceRequirements.java | 70 + .../NetworkInterfaceRequirementsBuilder.java | 271 ++ .../NetworkInterfaceRequirementsKey.java | 62 + .../vnfd/ConfigurableProperties.java | 99 + .../vnfd/ConfigurablePropertiesBuilder.java | 294 ++ .../nfv/descriptors/rev190425/vnfd/Df.java | 694 +++ .../descriptors/rev190425/vnfd/DfBuilder.java | 690 +++ .../nfv/descriptors/rev190425/vnfd/DfKey.java | 62 + .../rev190425/vnfd/ElementGroup.java | 105 + .../rev190425/vnfd/ElementGroupBuilder.java | 318 ++ .../rev190425/vnfd/ElementGroupKey.java | 62 + .../descriptors/rev190425/vnfd/ExtCpd.java | 123 + .../rev190425/vnfd/ExtCpdBuilder.java | 536 +++ .../descriptors/rev190425/vnfd/ExtCpdKey.java | 62 + .../descriptors/rev190425/vnfd/Indicator.java | 174 + .../rev190425/vnfd/IndicatorBuilder.java | 318 ++ .../rev190425/vnfd/IndicatorKey.java | 62 + .../rev190425/vnfd/IntVirtualLinkDesc.java | 158 + .../vnfd/IntVirtualLinkDescBuilder.java | 423 ++ .../rev190425/vnfd/IntVirtualLinkDescKey.java | 62 + .../vnfd/LifecycleManagementScript.java | 149 + .../LifecycleManagementScriptBuilder.java | 384 ++ .../vnfd/LifecycleManagementScriptKey.java | 62 + .../rev190425/vnfd/ModifiableAttributes.java | 84 + .../vnfd/ModifiableAttributesBuilder.java | 251 ++ .../rev190425/vnfd/SwImageDesc.java | 487 ++ .../rev190425/vnfd/SwImageDescBuilder.java | 553 +++ .../rev190425/vnfd/SwImageDescKey.java | 62 + .../nfv/descriptors/rev190425/vnfd/Vdu.java | 301 ++ .../rev190425/vnfd/VduBuilder.java | 572 +++ .../descriptors/rev190425/vnfd/VduKey.java | 62 + .../rev190425/vnfd/VirtualComputeDesc.java | 246 + .../vnfd/VirtualComputeDescBuilder.java | 416 ++ .../rev190425/vnfd/VirtualComputeDescKey.java | 73 + .../rev190425/vnfd/VirtualStorageDesc.java | 159 + .../vnfd/VirtualStorageDescBuilder.java | 409 ++ .../rev190425/vnfd/VirtualStorageDescKey.java | 62 + .../vnfd/_int/virtual/link/desc/Flavour.java | 90 + .../virtual/link/desc/FlavourBuilder.java | 272 ++ .../_int/virtual/link/desc/FlavourKey.java | 62 + .../link/desc/MonitoringParameters.java | 65 + .../desc/MonitoringParametersBuilder.java | 355 ++ .../link/desc/MonitoringParametersKey.java | 62 + .../_int/virtual/link/desc/flavour/Qos.java | 87 + .../virtual/link/desc/flavour/QosBuilder.java | 322 ++ .../AdditionalConfigurableProperty.java | 68 + ...AdditionalConfigurablePropertyBuilder.java | 271 ++ .../AdditionalConfigurablePropertyKey.java | 62 + .../vnfd/df/AffinityOrAntiAffinityGroup.java | 99 + .../AffinityOrAntiAffinityGroupBuilder.java | 296 ++ .../df/AffinityOrAntiAffinityGroupKey.java | 62 + .../rev190425/vnfd/df/Indicator.java | 174 + .../rev190425/vnfd/df/IndicatorBuilder.java | 317 ++ .../rev190425/vnfd/df/IndicatorKey.java | 62 + .../rev190425/vnfd/df/InstantiationLevel.java | 149 + .../vnfd/df/InstantiationLevelBuilder.java | 356 ++ .../vnfd/df/InstantiationLevelKey.java | 62 + .../vnfd/df/LcmOperationsConfiguration.java | 241 + .../df/LcmOperationsConfigurationBuilder.java | 396 ++ .../vnfd/df/MonitoringParameter.java | 65 + .../vnfd/df/MonitoringParameterBuilder.java | 355 ++ .../vnfd/df/MonitoringParameterKey.java | 62 + .../rev190425/vnfd/df/ScalingAspect.java | 165 + .../vnfd/df/ScalingAspectBuilder.java | 366 ++ .../rev190425/vnfd/df/ScalingAspectKey.java | 62 + .../vnfd/df/SupportedVnfInterfaces.java | 175 + .../df/SupportedVnfInterfacesBuilder.java | 315 ++ .../vnfd/df/SupportedVnfInterfacesKey.java | 76 + .../rev190425/vnfd/df/VduProfile.java | 125 + .../rev190425/vnfd/df/VduProfileBuilder.java | 433 ++ .../rev190425/vnfd/df/VduProfileKey.java | 62 + .../rev190425/vnfd/df/VirtualLinkProfile.java | 229 + .../vnfd/df/VirtualLinkProfileBuilder.java | 458 ++ .../vnfd/df/VirtualLinkProfileKey.java | 95 + .../df/instantiation/level/ScalingInfo.java | 80 + .../level/ScalingInfoBuilder.java | 285 ++ .../instantiation/level/ScalingInfoKey.java | 62 + .../vnfd/df/instantiation/level/VduLevel.java | 82 + .../instantiation/level/VduLevelBuilder.java | 285 ++ .../df/instantiation/level/VduLevelKey.java | 62 + .../ChangeExtVnfConnectivityOpConfig.java | 73 + ...angeExtVnfConnectivityOpConfigBuilder.java | 247 + .../ChangeVnfFlavourOpConfig.java | 73 + .../ChangeVnfFlavourOpConfigBuilder.java | 247 + .../configuration/HealVnfOpConfig.java | 88 + .../configuration/HealVnfOpConfigBuilder.java | 270 ++ .../configuration/InstantiateVnfOpConfig.java | 73 + .../InstantiateVnfOpConfigBuilder.java | 247 + .../configuration/OperateVnfOpConfig.java | 104 + .../OperateVnfOpConfigBuilder.java | 294 ++ .../configuration/ScaleVnfOpConfig.java | 89 + .../ScaleVnfOpConfigBuilder.java | 271 ++ .../ScaleVnfToLevelOpConfig.java | 89 + .../ScaleVnfToLevelOpConfigBuilder.java | 271 ++ .../configuration/TerminateVnfOpConfig.java | 104 + .../TerminateVnfOpConfigBuilder.java | 294 ++ .../vnf/connectivity/op/config/Parameter.java | 68 + .../op/config/ParameterBuilder.java | 271 ++ .../connectivity/op/config/ParameterKey.java | 62 + .../vnf/flavour/op/config/Parameter.java | 68 + .../flavour/op/config/ParameterBuilder.java | 271 ++ .../vnf/flavour/op/config/ParameterKey.java | 62 + .../heal/vnf/op/config/Parameter.java | 68 + .../heal/vnf/op/config/ParameterBuilder.java | 271 ++ .../heal/vnf/op/config/ParameterKey.java | 62 + .../instantiate/vnf/op/config/Parameter.java | 68 + .../vnf/op/config/ParameterBuilder.java | 271 ++ .../vnf/op/config/ParameterKey.java | 62 + .../operate/vnf/op/config/Parameter.java | 68 + .../vnf/op/config/ParameterBuilder.java | 271 ++ .../operate/vnf/op/config/ParameterKey.java | 62 + .../scale/vnf/op/config/Parameter.java | 68 + .../scale/vnf/op/config/ParameterBuilder.java | 271 ++ .../scale/vnf/op/config/ParameterKey.java | 62 + .../vnf/to/level/op/config/Parameter.java | 68 + .../to/level/op/config/ParameterBuilder.java | 271 ++ .../vnf/to/level/op/config/ParameterKey.java | 62 + .../terminate/vnf/op/config/Parameter.java | 68 + .../vnf/op/config/ParameterBuilder.java | 271 ++ .../terminate/vnf/op/config/ParameterKey.java | 62 + .../df/scaling/aspect/AspectDeltaDetails.java | 126 + .../aspect/AspectDeltaDetailsBuilder.java | 270 ++ .../aspect/aspect/delta/details/Deltas.java | 133 + .../aspect/delta/details/DeltasBuilder.java | 333 ++ .../aspect/delta/details/DeltasKey.java | 62 + .../aspect/delta/details/deltas/VduDelta.java | 81 + .../delta/details/deltas/VduDeltaBuilder.java | 292 ++ .../delta/details/deltas/VduDeltaKey.java | 62 + .../deltas/VirtualLinkBitRateDelta.java | 85 + .../VirtualLinkBitRateDeltaBuilder.java | 272 ++ .../deltas/VirtualLinkBitRateDeltaKey.java | 62 + .../bit/rate/delta/BitRateRequirements.java | 73 + .../delta/BitRateRequirementsBuilder.java | 276 ++ .../vnf/interfaces/InterfaceDetails.java | 66 + .../interfaces/InterfaceDetailsBuilder.java | 271 ++ .../vnf/interfaces/InterfaceDetailsKey.java | 62 + .../profile/AffinityOrAntiAffinityGroup.java | 66 + .../AffinityOrAntiAffinityGroupBuilder.java | 248 + .../AffinityOrAntiAffinityGroupKey.java | 62 + .../profile/AffinityOrAntiAffinityGroup.java | 62 + .../AffinityOrAntiAffinityGroupBuilder.java | 248 + .../AffinityOrAntiAffinityGroupKey.java | 62 + .../link/profile/MaxBitRateRequirements.java | 71 + .../MaxBitRateRequirementsBuilder.java | 276 ++ .../link/profile/MinBitRateRequirements.java | 71 + .../MinBitRateRequirementsBuilder.java | 276 ++ .../link/profile/VirtualLinkProtocolData.java | 137 + .../VirtualLinkProtocolDataBuilder.java | 276 ++ .../link/protocol/data/L2ProtocolData.java | 174 + .../protocol/data/L2ProtocolDataBuilder.java | 311 ++ .../link/protocol/data/L3ProtocolData.java | 278 ++ .../protocol/data/L3ProtocolDataBuilder.java | 368 ++ .../rev190425/vnfd/ext/cpd/CpConnection.java | 54 + .../vnfd/ext/cpd/cp/connection/IntCpd.java | 34 + .../ext/cpd/cp/connection/IntCpdBuilder.java | 227 + .../cpd/cp/connection/IntVirtualLinkDesc.java | 41 + .../connection/IntVirtualLinkDescBuilder.java | 227 + .../ext/cpd/cp/connection/K8sClusterNet.java | 40 + .../cp/connection/K8sClusterNetBuilder.java | 227 + .../cpd/cp/connection/_int/cpd/IntCpd.java | 61 + .../cp/connection/_int/cpd/IntCpdBuilder.java | 250 ++ .../management/script/ScriptInput.java | 75 + .../management/script/ScriptInputBuilder.java | 271 ++ .../management/script/ScriptInputKey.java | 62 + .../vnfd/sw/image/desc/Checksum.java | 72 + .../vnfd/sw/image/desc/ChecksumBuilder.java | 251 ++ .../rev190425/vnfd/vdu/BootOrder.java | 74 + .../rev190425/vnfd/vdu/BootOrderBuilder.java | 285 ++ .../rev190425/vnfd/vdu/BootOrderKey.java | 75 + .../vnfd/vdu/ConfigurableProperties.java | 68 + .../vdu/ConfigurablePropertiesBuilder.java | 271 ++ .../vnfd/vdu/ConfigurablePropertiesKey.java | 62 + .../rev190425/vnfd/vdu/IntCpd.java | 139 + .../rev190425/vnfd/vdu/IntCpdBuilder.java | 596 +++ .../rev190425/vnfd/vdu/IntCpdKey.java | 62 + .../vnfd/vdu/MonitoringParameter.java | 64 + .../vnfd/vdu/MonitoringParameterBuilder.java | 355 ++ .../vnfd/vdu/MonitoringParameterKey.java | 62 + .../virtual/compute/desc/LogicalNode.java | 97 + .../compute/desc/LogicalNodeBuilder.java | 291 ++ .../virtual/compute/desc/LogicalNodeKey.java | 62 + .../desc/RequestAdditionalCapability.java | 131 + .../RequestAdditionalCapabilityBuilder.java | 361 ++ .../desc/RequestAdditionalCapabilityKey.java | 62 + .../vnfd/virtual/compute/desc/VirtualCpu.java | 168 + .../compute/desc/VirtualCpuBuilder.java | 410 ++ .../virtual/compute/desc/VirtualMemory.java | 127 + .../compute/desc/VirtualMemoryBuilder.java | 348 ++ .../desc/logical/node/RequirementDetail.java | 72 + .../node/RequirementDetailBuilder.java | 271 ++ .../logical/node/RequirementDetailKey.java | 62 + .../TargetPerformanceParameters.java | 68 + .../TargetPerformanceParametersBuilder.java | 271 ++ .../TargetPerformanceParametersKey.java | 62 + .../compute/desc/virtual/cpu/Pinning.java | 162 + .../desc/virtual/cpu/PinningBuilder.java | 270 ++ .../desc/virtual/cpu/VduCpuRequirements.java | 67 + .../cpu/VduCpuRequirementsBuilder.java | 271 ++ .../virtual/cpu/VduCpuRequirementsKey.java | 62 + .../desc/virtual/cpu/pinning/Rule.java | 69 + .../desc/virtual/cpu/pinning/RuleBuilder.java | 271 ++ .../desc/virtual/cpu/pinning/RuleKey.java | 62 + .../virtual/memory/VduMemRequirements.java | 67 + .../memory/VduMemRequirementsBuilder.java | 271 ++ .../virtual/memory/VduMemRequirementsKey.java | 62 + .../storage/desc/VduStorageRequirements.java | 67 + .../desc/VduStorageRequirementsBuilder.java | 271 ++ .../desc/VduStorageRequirementsKey.java | 62 + .../rev190425/$YangModelBindingProvider.java | 12 + .../nsd/rev190425/$YangModuleInfoImpl.java | 47 + .../nfv/nsd/rev190425/EtsiNfvNsdData.java | 53 + .../nfv/yang/etsi/nfv/nsd/rev190425/Nsd.java | 112 + .../etsi/nfv/nsd/rev190425/NsdBuilder.java | 330 ++ .../yang/etsi/nfv/nsd/rev190425/nsd/Nsd.java | 52 + .../nfv/nsd/rev190425/nsd/NsdBuilder.java | 773 ++++ .../etsi/nfv/nsd/rev190425/nsd/NsdKey.java | 62 + .../yang/etsi/nfv/nsd/rev190425/nsd/Pnfd.java | 52 + .../nfv/nsd/rev190425/nsd/PnfdBuilder.java | 558 +++ .../etsi/nfv/nsd/rev190425/nsd/PnfdKey.java | 62 + .../yang/etsi/nfv/nsd/rev190425/nsd/Vnfd.java | 53 + .../nfv/nsd/rev190425/nsd/VnfdBuilder.java | 1062 +++++ .../etsi/nfv/nsd/rev190425/nsd/VnfdKey.java | 62 + .../rev190425/$YangModelBindingProvider.java | 12 + .../pnfd/rev190425/$YangModuleInfoImpl.java | 47 + .../nfv/pnfd/rev190425/EtsiNfvPnfdData.java | 42 + .../yang/etsi/nfv/pnfd/rev190425/Pnfd.java | 42 + .../etsi/nfv/pnfd/rev190425/PnfdBuilder.java | 537 +++ .../rev190318/$YangModelBindingProvider.java | 12 + .../vnfd/rev190318/$YangModuleInfoImpl.java | 47 + .../nfv/vnfd/rev190318/EtsiNfvVnfdData.java | 42 + .../yang/etsi/nfv/vnfd/rev190318/Vnfd.java | 42 + .../etsi/nfv/vnfd/rev190318/VnfdBuilder.java | 1044 +++++ .../norev/$YangModelBindingProvider.java | 12 + .../images/norev/$YangModuleInfoImpl.java | 47 + .../norev/ExtendedAlternativeImages.java | 53 + .../images/norev/ExtendedVimType.java | 46 + .../images/norev/SwImageDesc1.java | 22 + .../images/norev/SwImageDesc1Builder.java | 157 + .../yang/alternative/images/norev/Vdu1.java | 22 + .../alternative/images/norev/Vdu1Builder.java | 158 + .../norev/$YangModelBindingProvider.java | 12 + .../_interface/norev/$YangModuleInfoImpl.java | 49 + .../_interface/norev/ExtendedInterface.java | 79 + .../VirtualNetworkInterfaceRequirement1.java | 22 + ...alNetworkInterfaceRequirement1Builder.java | 255 ++ .../info/norev/$YangModelBindingProvider.java | 12 + .../info/norev/$YangModuleInfoImpl.java | 48 + .../info/norev/L3ProtocolData1.java | 23 + .../info/norev/L3ProtocolData1Builder.java | 157 + .../info/norev/VirtualStorageDesc1.java | 23 + .../norev/VirtualStorageDesc1Builder.java | 157 + .../augments/additional/info/norev/Vnfd1.java | 23 + .../additional/info/norev/Vnfd1Builder.java | 157 + .../norev/$YangModelBindingProvider.java | 12 + .../alarm/norev/$YangModuleInfoImpl.java | 48 + .../augments/alarm/norev/ExtendedAlarm.java | 61 + .../osm/yang/augments/alarm/norev/Vdu1.java | 22 + .../augments/alarm/norev/Vdu1Builder.java | 179 + .../alarm/norev/extended/alarm/Alarm.java | 79 + .../norev/extended/alarm/AlarmBuilder.java | 625 +++ .../alarm/norev/extended/alarm/AlarmKey.java | 62 + .../init/norev/$YangModelBindingProvider.java | 12 + .../cloud/init/norev/$YangModuleInfoImpl.java | 47 + .../cloud/init/norev/ExtendedCloudInit.java | 56 + .../yang/augments/cloud/init/norev/Vdu1.java | 22 + .../cloud/init/norev/Vdu1Builder.java | 158 + .../extended/cloud/init/CloudInitInput.java | 42 + .../cloud/init/cloud/init/input/Filename.java | 53 + .../cloud/init/input/FilenameBuilder.java | 227 + .../cloud/init/cloud/init/input/Inline.java | 53 + .../init/cloud/init/input/InlineBuilder.java | 227 + .../_2/norev/$YangModelBindingProvider.java | 12 + .../day1/_2/norev/$YangModuleInfoImpl.java | 48 + .../_2/norev/ExtendedVnfConfiguration.java | 64 + .../day1/_2/norev/OperateVnfOpConfig1.java | 22 + .../_2/norev/OperateVnfOpConfig1Builder.java | 179 + .../extended/vnf/configuration/Day12.java | 155 + .../vnf/configuration/Day12Builder.java | 588 +++ .../extended/vnf/configuration/Day12Key.java | 62 + .../epa/norev/$YangModelBindingProvider.java | 12 + .../epa/norev/$YangModuleInfoImpl.java | 47 + .../epa/norev/AllocationProperties.java | 75 + .../augments/epa/norev/ExtendedCpuPolicy.java | 127 + .../augments/epa/norev/ExtendedCpuQuota.java | 47 + .../epa/norev/ExtendedDiskIoQuota.java | 47 + .../augments/epa/norev/ExtendedMemQuota.java | 47 + .../epa/norev/ExtendedMempageSize.java | 129 + .../yang/augments/epa/norev/ExtendedNuma.java | 103 + .../augments/epa/norev/ExtendedVifQuota.java | 47 + .../osm/yang/augments/epa/norev/Pinning1.java | 22 + .../augments/epa/norev/Pinning1Builder.java | 157 + .../yang/augments/epa/norev/VirtualCpu1.java | 22 + .../epa/norev/VirtualCpu1Builder.java | 158 + .../augments/epa/norev/VirtualMemory1.java | 24 + .../epa/norev/VirtualMemory1Builder.java | 221 + .../VirtualNetworkInterfaceRequirement1.java | 22 + ...alNetworkInterfaceRequirement1Builder.java | 158 + .../epa/norev/VirtualStorageDesc1.java | 22 + .../epa/norev/VirtualStorageDesc1Builder.java | 158 + .../norev/extended/cpu/quota/CpuQuota.java | 46 + .../extended/cpu/quota/CpuQuotaBuilder.java | 335 ++ .../extended/disk/io/quota/DiskIoQuota.java | 46 + .../disk/io/quota/DiskIoQuotaBuilder.java | 335 ++ .../norev/extended/mem/quota/MemQuota.java | 46 + .../extended/mem/quota/MemQuotaBuilder.java | 335 ++ .../norev/extended/numa/NumaNodePolicy.java | 206 + .../extended/numa/NumaNodePolicyBuilder.java | 307 ++ .../extended/numa/numa/node/policy/Node.java | 139 + .../numa/numa/node/policy/NodeBuilder.java | 364 ++ .../numa/numa/node/policy/NodeKey.java | 75 + .../numa/node/policy/node/OmNumaType.java | 58 + .../numa/numa/node/policy/node/Vcpu.java | 63 + .../numa/node/policy/node/VcpuBuilder.java | 262 ++ .../numa/numa/node/policy/node/VcpuKey.java | 75 + .../node/policy/node/om/numa/type/Cores.java | 49 + .../node/om/numa/type/CoresBuilder.java | 241 + .../node/om/numa/type/PairedThreads.java | 60 + .../om/numa/type/PairedThreadsBuilder.java | 227 + .../policy/node/om/numa/type/Threads.java | 49 + .../node/om/numa/type/ThreadsBuilder.java | 241 + .../type/paired/threads/PairedThreads.java | 81 + .../paired/threads/PairedThreadsBuilder.java | 284 ++ .../paired/threads/PairedThreadIds.java | 68 + .../threads/PairedThreadIdsBuilder.java | 297 ++ .../paired/threads/PairedThreadIdsKey.java | 75 + .../norev/extended/vif/quota/VifQuota.java | 46 + .../extended/vif/quota/VifQuotaBuilder.java | 335 ++ .../norev/$YangModelBindingProvider.java | 12 + .../profiles/norev/$YangModuleInfoImpl.java | 49 + .../norev/ExtendedVldProtocolData.java | 105 + .../profiles/norev/VirtualLinkProfile1.java | 22 + .../norev/VirtualLinkProfile1Builder.java | 158 + .../data/VirtualLinkProtocolData.java | 137 + .../data/VirtualLinkProtocolDataBuilder.java | 276 ++ .../link/protocol/data/L2ProtocolData.java | 174 + .../protocol/data/L2ProtocolDataBuilder.java | 311 ++ .../link/protocol/data/L3ProtocolData.java | 278 ++ .../protocol/data/L3ProtocolDataBuilder.java | 368 ++ .../kdu/norev/$YangModelBindingProvider.java | 12 + .../kdu/norev/$YangModuleInfoImpl.java | 47 + .../augments/kdu/norev/ExtendedExtCpd.java | 47 + .../yang/augments/kdu/norev/ExtendedKdu.java | 138 + .../osm/yang/augments/kdu/norev/Vnfd1.java | 22 + .../yang/augments/kdu/norev/Vnfd1Builder.java | 249 ++ .../kdu/norev/extended/kdu/K8sCluster.java | 169 + .../norev/extended/kdu/K8sClusterBuilder.java | 293 ++ .../augments/kdu/norev/extended/kdu/Kdu.java | 104 + .../kdu/norev/extended/kdu/KduBuilder.java | 295 ++ .../kdu/norev/extended/kdu/KduKey.java | 62 + .../kdu/norev/extended/kdu/Service.java | 96 + .../norev/extended/kdu/ServiceBuilder.java | 295 ++ .../kdu/norev/extended/kdu/ServiceKey.java | 62 + .../norev/extended/kdu/k8s/cluster/Nets.java | 64 + .../extended/kdu/k8s/cluster/NetsBuilder.java | 248 + .../extended/kdu/k8s/cluster/NetsKey.java | 62 + .../kdu/norev/extended/kdu/kdu/KduModel.java | 48 + .../extended/kdu/kdu/kdu/model/HelmChart.java | 140 + .../kdu/kdu/kdu/model/HelmChartBuilder.java | 250 ++ .../kdu/kdu/kdu/model/JujuBundle.java | 57 + .../kdu/kdu/kdu/model/JujuBundleBuilder.java | 227 + .../norev/$YangModelBindingProvider.java | 12 + .../_interface/norev/$YangModuleInfoImpl.java | 47 + .../norev/ExtendedMgmtInterface.java | 48 + .../augments/mgmt/_interface/norev/Vnfd1.java | 22 + .../mgmt/_interface/norev/Vnfd1Builder.java | 157 + .../norev/$YangModelBindingProvider.java | 12 + .../augments/norev/$YangModuleInfoImpl.java | 43 + .../yang/augments/norev/AlarmProperties.java | 204 + .../augments/norev/AlarmSeverityType.java | 73 + .../augments/norev/AlarmStatisticType.java | 77 + .../augments/norev/ConfigurationMethod.java | 118 + .../osm/yang/augments/norev/Description.java | 42 + .../augments/norev/ParameterDataType.java | 73 + .../augments/norev/PrimitiveParameter.java | 124 + .../norev/PrimitiveParameterValue.java | 65 + .../norev/RelationalOperationType.java | 77 + .../norev/ScalingCriteriaOperation.java | 71 + .../augments/norev/ScalingPolicyType.java | 71 + .../yang/augments/norev/ScalingTrigger.java | 75 + .../yang/augments/norev/VduConfigAccess.java | 55 + .../yang/augments/norev/VirtualInterface.java | 63 + .../augments/norev/VnfcConfiguration.java | 158 + .../osm/yang/augments/norev/VnfcMetrics.java | 60 + .../yang/augments/norev/VnfcRelations.java | 68 + .../norev/alarm/properties/Actions.java | 104 + .../alarm/properties/ActionsBuilder.java | 331 ++ .../norev/alarm/properties/actions/Alarm.java | 58 + .../properties/actions/AlarmBuilder.java | 248 + .../alarm/properties/actions/AlarmKey.java | 62 + .../properties/actions/InsufficientData.java | 58 + .../actions/InsufficientDataBuilder.java | 248 + .../actions/InsufficientDataKey.java | 62 + .../norev/alarm/properties/actions/Ok.java | 58 + .../alarm/properties/actions/OkBuilder.java | 248 + .../norev/alarm/properties/actions/OkKey.java | 62 + .../configuration/method/ConfigMethod.java | 104 + .../method/ExecutionEnvironmentList.java | 100 + .../ExecutionEnvironmentListBuilder.java | 246 + .../method/config/method/Juju.java | 62 + .../method/config/method/JujuBuilder.java | 227 + .../method/config/method/Script.java | 54 + .../method/config/method/ScriptBuilder.java | 227 + .../list/ExecutionEnvironmentList.java | 132 + .../list/ExecutionEnvironmentListBuilder.java | 318 ++ .../list/ExecutionEnvironmentListKey.java | 62 + .../list/ExecutionEnvironmentModel.java | 61 + .../environment/model/HelmChart.java | 141 + .../environment/model/HelmChartBuilder.java | 250 ++ .../execution/environment/model/Juju.java | 62 + .../environment/model/JujuBuilder.java | 227 + .../environment/model/juju/Juju.java | 153 + .../environment/model/juju/JujuBuilder.java | 274 ++ .../method/config/method/juju/Juju.java | 153 + .../config/method/juju/JujuBuilder.java | 274 ++ .../method/config/method/script/Script.java | 122 + .../config/method/script/ScriptBuilder.java | 227 + .../primitive/parameter/value/Parameter.java | 88 + .../parameter/value/ParameterBuilder.java | 295 ++ .../parameter/value/ParameterKey.java | 62 + .../norev/vdu/config/access/ConfigAccess.java | 64 + .../config/access/ConfigAccessBuilder.java | 228 + .../access/config/access/SshAccess.java | 71 + .../config/access/SshAccessBuilder.java | 251 ++ .../virtual/_interface/VirtualInterface.java | 177 + .../_interface/VirtualInterfaceBuilder.java | 287 ++ .../vnfc/configuration/ConfigPrimitive.java | 129 + .../configuration/ConfigPrimitiveBuilder.java | 360 ++ .../configuration/ConfigPrimitiveKey.java | 62 + .../configuration/InitialConfigPrimitive.java | 85 + .../InitialConfigPrimitiveBuilder.java | 286 ++ .../InitialConfigPrimitiveKey.java | 75 + .../TerminateConfigPrimitive.java | 106 + .../TerminateConfigPrimitiveBuilder.java | 394 ++ .../TerminateConfigPrimitiveKey.java | 75 + .../config/primitive/Parameter.java | 52 + .../config/primitive/ParameterBuilder.java | 420 ++ .../config/primitive/ParameterKey.java | 62 + .../config/primitive/PrimitiveType.java | 44 + .../primitive/type/PrimitiveDefinition.java | 83 + .../type/PrimitiveDefinitionBuilder.java | 336 ++ .../augments/norev/vnfc/metrics/Metrics.java | 63 + .../norev/vnfc/metrics/MetricsBuilder.java | 248 + .../norev/vnfc/metrics/MetricsKey.java | 62 + .../norev/vnfc/relations/Relation.java | 94 + .../norev/vnfc/relations/RelationBuilder.java | 291 ++ .../norev/vnfc/relations/RelationKey.java | 62 + .../vnfc/relations/relation/Entities.java | 78 + .../relations/relation/EntitiesBuilder.java | 271 ++ .../vnfc/relations/relation/EntitiesKey.java | 62 + .../norev/$YangModelBindingProvider.java | 12 + .../norev/$YangModuleInfoImpl.java | 48 + .../norev/ExtendedNsConfiguration.java | 47 + .../augments/ns/configuration/norev/Nsd1.java | 22 + .../ns/configuration/norev/Nsd1Builder.java | 158 + .../ns/configuration/NsConfiguration.java | 48 + .../configuration/NsConfigurationBuilder.java | 489 ++ .../norev/$YangModelBindingProvider.java | 12 + .../ns/various/norev/$YangModuleInfoImpl.java | 49 + .../ns/various/norev/ExtendedFloatingIp.java | 49 + .../various/norev/ExtendedSecurityGroup.java | 46 + .../ns/various/norev/L3ProtocolData1.java | 22 + .../various/norev/L3ProtocolData1Builder.java | 157 + .../yang/augments/ns/various/norev/Nsd1.java | 23 + .../ns/various/norev/Nsd1Builder.java | 157 + .../yang/augments/ns/various/norev/Sapd1.java | 22 + .../ns/various/norev/Sapd1Builder.java | 158 + .../vld/norev/$YangModelBindingProvider.java | 12 + .../ns/vld/norev/$YangModuleInfoImpl.java | 48 + .../vld/norev/DeviatedConstituentCpdId.java | 71 + .../augments/ns/vld/norev/ExtendedVld.java | 79 + .../vld/norev/VirtualLinkConnectivity1.java | 22 + .../VirtualLinkConnectivity1Builder.java | 179 + .../ns/vld/norev/VirtualLinkDesc1.java | 22 + .../ns/vld/norev/VirtualLinkDesc1Builder.java | 209 + .../constituent/cpd/id/ConstituentCpdId.java | 95 + .../cpd/id/ConstituentCpdIdBuilder.java | 295 ++ .../cpd/id/ConstituentCpdIdKey.java | 78 + .../norev/extended/vld/ProviderNetwork.java | 69 + .../extended/vld/ProviderNetworkBuilder.java | 264 ++ .../norev/$YangModelBindingProvider.java | 12 + .../scaling/norev/$YangModuleInfoImpl.java | 49 + .../scaling/norev/ExtendedScaling.java | 132 + .../scaling/norev/ScalingAspect1.java | 22 + .../scaling/norev/ScalingAspect1Builder.java | 223 + .../extended/scaling/ScalingConfigAction.java | 78 + .../scaling/ScalingConfigActionBuilder.java | 272 ++ .../scaling/ScalingConfigActionKey.java | 63 + .../norev/extended/scaling/ScalingPolicy.java | 191 + .../scaling/ScalingPolicyBuilder.java | 458 ++ .../extended/scaling/ScalingPolicyKey.java | 62 + .../scaling/policy/ScalingCriteria.java | 129 + .../policy/ScalingCriteriaBuilder.java | 373 ++ .../scaling/policy/ScalingCriteriaKey.java | 62 + .../norev/$YangModelBindingProvider.java | 12 + .../various/norev/$YangModuleInfoImpl.java | 47 + .../yang/augments/various/norev/ExtCpd1.java | 22 + .../various/norev/ExtCpd1Builder.java | 183 + .../augments/various/norev/ExtendedCpd.java | 133 + .../various/norev/ExtendedDeviceBus.java | 122 + .../various/norev/ExtendedSecurityGroup.java | 46 + .../augments/various/norev/ExtendedVdu.java | 61 + .../augments/various/norev/ExtendedVld.java | 51 + .../yang/augments/various/norev/IntCpd1.java | 22 + .../various/norev/IntCpd1Builder.java | 183 + .../various/norev/IntVirtualLinkDesc1.java | 22 + .../norev/IntVirtualLinkDesc1Builder.java | 158 + .../various/norev/L3ProtocolData1.java | 22 + .../various/norev/L3ProtocolData1Builder.java | 157 + .../osm/yang/augments/various/norev/Vdu1.java | 22 + .../augments/various/norev/Vdu1Builder.java | 183 + .../various/norev/VirtualStorageDesc1.java | 22 + .../norev/VirtualStorageDesc1Builder.java | 157 + .../extended/vdu/SupplementalBootData.java | 56 + .../vdu/SupplementalBootDataBuilder.java | 228 + .../norev/extended/vld/ProviderNetwork.java | 69 + .../extended/vld/ProviderNetworkBuilder.java | 264 ++ .../vip/norev/$YangModelBindingProvider.java | 12 + .../vip/norev/$YangModuleInfoImpl.java | 47 + .../yang/augments/vip/norev/ExtendedVip.java | 72 + .../osm/yang/augments/vip/norev/Vnfd1.java | 22 + .../yang/augments/vip/norev/Vnfd1Builder.java | 179 + .../augments/vip/norev/extended/vip/Vip.java | 92 + .../vip/norev/extended/vip/VipBuilder.java | 291 ++ .../vip/norev/extended/vip/VipKey.java | 62 + .../extended/vip/vip/PairedInterfaces.java | 78 + .../vip/vip/PairedInterfacesBuilder.java | 271 ++ .../extended/vip/vip/PairedInterfacesKey.java | 62 + .../rev180914/$YangModelBindingProvider.java | 12 + .../rev180914/$YangModuleInfoImpl.java | 50 + .../rev180914/InternalVldParams.java | 84 + .../rev180914/IpProfileUpdateSchema.java | 99 + .../parameters/rev180914/NsParams.java | 88 + .../parameters/rev180914/VduParams.java | 96 + .../parameters/rev180914/VldCommonParams.java | 59 + .../parameters/rev180914/VldParams.java | 67 + .../parameters/rev180914/VnfParams.java | 88 + .../InternalConnectionPoint.java | 67 + .../InternalConnectionPointBuilder.java | 272 ++ .../InternalConnectionPointKey.java | 62 + .../internal_vld_params/IpProfile.java | 44 + .../internal_vld_params/IpProfileBuilder.java | 371 ++ .../ip/profile/update/schema/DhcpParams.java | 69 + .../update/schema/DhcpParamsBuilder.java | 289 ++ .../ip/profile/update/schema/DnsServer.java | 58 + .../update/schema/DnsServerBuilder.java | 249 ++ .../profile/update/schema/DnsServerKey.java | 63 + .../parameters/rev180914/ns_params/Vld.java | 51 + .../rev180914/ns_params/VldBuilder.java | 373 ++ .../rev180914/ns_params/VldKey.java | 62 + .../parameters/rev180914/ns_params/Vnf.java | 51 + .../rev180914/ns_params/VnfBuilder.java | 382 ++ .../rev180914/ns_params/VnfKey.java | 62 + .../rev180914/vdu_params/Interface.java | 85 + .../vdu_params/InterfaceBuilder.java | 320 ++ .../rev180914/vdu_params/InterfaceKey.java | 62 + .../rev180914/vdu_params/Volume.java | 66 + .../rev180914/vdu_params/VolumeBuilder.java | 271 ++ .../rev180914/vdu_params/VolumeKey.java | 62 + .../vld_common_params/IpProfile.java | 44 + .../vld_common_params/IpProfileBuilder.java | 371 ++ .../vld_params/VnfdConnectionPointRef.java | 79 + .../VnfdConnectionPointRefBuilder.java | 295 ++ .../vld_params/VnfdConnectionPointRefKey.java | 77 + .../rev180914/vnf_params/InternalVld.java | 51 + .../vnf_params/InternalVldBuilder.java | 364 ++ .../rev180914/vnf_params/InternalVldKey.java | 62 + .../parameters/rev180914/vnf_params/Vdu.java | 51 + .../rev180914/vnf_params/VduBuilder.java | 357 ++ .../rev180914/vnf_params/VduKey.java | 62 + .../rev170208/$YangModelBindingProvider.java | 12 + .../types/rev170208/$YangModuleInfoImpl.java | 48 + .../mano/types/rev170208/ActionParam.java | 77 + .../mano/types/rev170208/AggregationType.java | 77 + .../mano/types/rev170208/AlarmMetricType.java | 73 + .../mano/types/rev170208/AlarmProperties.java | 204 + .../types/rev170208/AlarmSeverityType.java | 73 + .../types/rev170208/AlarmStatisticType.java | 77 + .../types/rev170208/AllocationProperties.java | 75 + .../yang/mano/types/rev170208/ApiType.java | 73 + .../types/rev170208/CloudAccountType.java | 83 + .../mano/types/rev170208/CloudConfig.java | 99 + .../yang/mano/types/rev170208/ConfigFile.java | 62 + .../types/rev170208/ConfigurationMethod.java | 118 + .../types/rev170208/ConnectionPointType.java | 69 + .../mano/types/rev170208/ControlParam.java | 96 + .../mano/types/rev170208/CpuFeatureType.java | 359 ++ .../mano/types/rev170208/EventConfig.java | 96 + .../yang/mano/types/rev170208/GuestEpa.java | 160 + .../mano/types/rev170208/HostAggregate.java | 61 + .../yang/mano/types/rev170208/HostEpa.java | 114 + .../mano/types/rev170208/HttpEndpoints.java | 89 + .../yang/mano/types/rev170208/HttpMethod.java | 79 + .../mano/types/rev170208/HypervisorEpa.java | 49 + .../mano/types/rev170208/ImageProperties.java | 62 + .../mano/types/rev170208/InputParameter.java | 63 + .../types/rev170208/InputParameterXpath.java | 65 + .../mano/types/rev170208/IpProfileInfo.java | 76 + .../mano/types/rev170208/IpProfileList.java | 64 + .../mano/types/rev170208/JsonQueryMethod.java | 73 + .../mano/types/rev170208/MetaDataType.java | 69 + .../rev170208/MonitoringParamAggregation.java | 124 + .../rev170208/MonitoringParamUiData.java | 79 + .../types/rev170208/MonitoringParamValue.java | 111 + .../yang/mano/types/rev170208/NamedValue.java | 50 + .../mano/types/rev170208/NfviMetricType.java | 87 + .../mano/types/rev170208/NfviMetrics.java | 188 + .../mano/types/rev170208/PackageType.java | 71 + .../mano/types/rev170208/ParamValueType.java | 73 + .../types/rev170208/ParameterDataType.java | 73 + .../types/rev170208/PlacementGroupInfo.java | 147 + .../types/rev170208/PlacementGroupInput.java | 87 + .../types/rev170208/PrimitiveParameter.java | 124 + .../rev170208/PrimitiveParameterValue.java | 65 + .../mano/types/rev170208/ProviderNetwork.java | 50 + .../rev170208/RelationalOperationType.java | 77 + .../mano/types/rev170208/RpcProjectName.java | 49 + .../rev170208/ScalingCriteriaOperation.java | 71 + .../types/rev170208/ScalingPolicyType.java | 71 + .../mano/types/rev170208/ScalingTrigger.java | 75 + .../types/rev170208/SupplementalBootData.java | 45 + .../types/rev170208/UiPrimitiveGroup.java | 67 + .../mano/types/rev170208/VcaConfigAccess.java | 55 + .../types/rev170208/VcaConfiguration.java | 158 + .../yang/mano/types/rev170208/VcaMetrics.java | 68 + .../mano/types/rev170208/VcaRelations.java | 68 + .../mano/types/rev170208/VirtualLinkType.java | 73 + .../yang/mano/types/rev170208/VmFlavor.java | 49 + .../mano/types/rev170208/VmFlavorName.java | 46 + .../yang/mano/types/rev170208/VolumeInfo.java | 252 ++ .../yang/mano/types/rev170208/VswitchEpa.java | 54 + .../yang/mano/types/rev170208/WidgetType.java | 79 + .../rev170208/action/param/ActionParam.java | 126 + .../action/param/ActionParamBuilder.java | 388 ++ .../action/param/ActionParamKey.java | 62 + .../rev170208/alarm/properties/Actions.java | 104 + .../alarm/properties/ActionsBuilder.java | 331 ++ .../alarm/properties/actions/Alarm.java | 58 + .../properties/actions/AlarmBuilder.java | 248 + .../alarm/properties/actions/AlarmKey.java | 62 + .../properties/actions/InsufficientData.java | 58 + .../actions/InsufficientDataBuilder.java | 248 + .../actions/InsufficientDataKey.java | 62 + .../alarm/properties/actions/Ok.java | 58 + .../alarm/properties/actions/OkBuilder.java | 248 + .../alarm/properties/actions/OkKey.java | 62 + .../types/rev170208/cloud/config/KeyPair.java | 76 + .../cloud/config/KeyPairBuilder.java | 271 ++ .../rev170208/cloud/config/KeyPairKey.java | 62 + .../types/rev170208/cloud/config/User.java | 105 + .../rev170208/cloud/config/UserBuilder.java | 314 ++ .../types/rev170208/cloud/config/UserKey.java | 62 + .../rev170208/cloud/config/user/KeyPair.java | 76 + .../cloud/config/user/KeyPairBuilder.java | 271 ++ .../cloud/config/user/KeyPairKey.java | 62 + .../rev170208/config/file/ConfigFile.java | 74 + .../config/file/ConfigFileBuilder.java | 271 ++ .../rev170208/config/file/ConfigFileKey.java | 62 + .../configuration/method/ConfigMethod.java | 104 + .../method/ExecutionEnvironmentList.java | 100 + .../ExecutionEnvironmentListBuilder.java | 246 + .../method/config/method/Juju.java | 62 + .../method/config/method/JujuBuilder.java | 227 + .../method/config/method/Script.java | 54 + .../method/config/method/ScriptBuilder.java | 227 + .../list/ExecutionEnvironmentList.java | 132 + .../list/ExecutionEnvironmentListBuilder.java | 318 ++ .../list/ExecutionEnvironmentListKey.java | 62 + .../list/ExecutionEnvironmentModel.java | 61 + .../environment/model/HelmChart.java | 141 + .../environment/model/HelmChartBuilder.java | 250 ++ .../execution/environment/model/Juju.java | 62 + .../environment/model/JujuBuilder.java | 227 + .../environment/model/juju/Juju.java | 153 + .../environment/model/juju/JujuBuilder.java | 274 ++ .../method/config/method/juju/Juju.java | 153 + .../config/method/juju/JujuBuilder.java | 274 ++ .../method/config/method/script/Script.java | 122 + .../config/method/script/ScriptBuilder.java | 227 + .../rev170208/control/param/ControlParam.java | 205 + .../control/param/ControlParamBuilder.java | 577 +++ .../control/param/ControlParamKey.java | 62 + .../rev170208/event/config/Parameter.java | 70 + .../event/config/ParameterBuilder.java | 271 ++ .../rev170208/event/config/ParameterKey.java | 62 + .../types/rev170208/guest/epa/GuestEpa.java | 321 ++ .../rev170208/guest/epa/GuestEpaBuilder.java | 414 ++ .../guest/epa/guest/epa/CpuPolicy.java | 53 + .../guest/epa/guest/epa/DiskIoQuota.java | 46 + .../epa/guest/epa/DiskIoQuotaBuilder.java | 335 ++ .../guest/epa/guest/epa/MemQuota.java | 46 + .../guest/epa/guest/epa/MemQuotaBuilder.java | 335 ++ .../guest/epa/guest/epa/NumaPolicy.java | 92 + .../guest/epa/guest/epa/PcieDevice.java | 76 + .../epa/guest/epa/PcieDeviceBuilder.java | 285 ++ .../guest/epa/guest/epa/PcieDeviceKey.java | 62 + .../guest/epa/guest/epa/VifQuota.java | 46 + .../guest/epa/guest/epa/VifQuotaBuilder.java | 335 ++ .../epa/guest/epa/cpu/policy/CpuPinning.java | 217 + .../epa/cpu/policy/CpuPinningBuilder.java | 250 ++ .../epa/guest/epa/cpu/policy/CpuQuota.java | 53 + .../guest/epa/cpu/policy/CpuQuotaBuilder.java | 227 + .../epa/cpu/policy/cpu/quota/CpuQuota.java | 46 + .../cpu/policy/cpu/quota/CpuQuotaBuilder.java | 335 ++ .../epa/guest/epa/numa/policy/NumaAware.java | 110 + .../epa/numa/policy/NumaAwareBuilder.java | 228 + .../guest/epa/numa/policy/NumaUnaware.java | 49 + .../epa/numa/policy/NumaUnawareBuilder.java | 228 + .../policy/numa/aware/NumaNodePolicy.java | 206 + .../numa/aware/NumaNodePolicyBuilder.java | 307 ++ .../numa/aware/numa/node/policy/Node.java | 139 + .../aware/numa/node/policy/NodeBuilder.java | 364 ++ .../numa/aware/numa/node/policy/NodeKey.java | 75 + .../numa/node/policy/node/OmNumaType.java | 58 + .../aware/numa/node/policy/node/Vcpu.java | 63 + .../numa/node/policy/node/VcpuBuilder.java | 262 ++ .../aware/numa/node/policy/node/VcpuKey.java | 75 + .../node/policy/node/om/numa/type/Cores.java | 49 + .../node/om/numa/type/CoresBuilder.java | 241 + .../node/om/numa/type/PairedThreads.java | 60 + .../om/numa/type/PairedThreadsBuilder.java | 227 + .../policy/node/om/numa/type/Threads.java | 49 + .../node/om/numa/type/ThreadsBuilder.java | 241 + .../type/paired/threads/PairedThreads.java | 81 + .../paired/threads/PairedThreadsBuilder.java | 284 ++ .../paired/threads/PairedThreadIds.java | 68 + .../threads/PairedThreadIdsBuilder.java | 297 ++ .../paired/threads/PairedThreadIdsKey.java | 75 + .../host/aggregate/HostAggregate.java | 74 + .../host/aggregate/HostAggregateBuilder.java | 271 ++ .../host/aggregate/HostAggregateKey.java | 62 + .../types/rev170208/host/epa/HostEpa.java | 459 ++ .../rev170208/host/epa/HostEpaBuilder.java | 488 ++ .../host/epa/host/epa/CpuFeature.java | 63 + .../host/epa/host/epa/CpuFeatureBuilder.java | 249 ++ .../host/epa/host/epa/CpuFeatureKey.java | 63 + .../host/epa/host/epa/OmCpuFeature.java | 63 + .../epa/host/epa/OmCpuFeatureBuilder.java | 248 + .../host/epa/host/epa/OmCpuFeatureKey.java | 62 + .../http/endpoints/HttpEndpoint.java | 171 + .../http/endpoints/HttpEndpointBuilder.java | 446 ++ .../http/endpoints/HttpEndpointKey.java | 62 + .../http/endpoints/http/endpoint/Headers.java | 75 + .../http/endpoint/HeadersBuilder.java | 271 ++ .../endpoints/http/endpoint/HeadersKey.java | 62 + .../hypervisor/epa/HypervisorEpa.java | 132 + .../hypervisor/epa/HypervisorEpaBuilder.java | 250 ++ .../input/parameter/InputParameter.java | 75 + .../parameter/InputParameterBuilder.java | 271 ++ .../input/parameter/InputParameterKey.java | 62 + .../parameter/xpath/InputParameterXpath.java | 87 + .../xpath/InputParameterXpathBuilder.java | 294 ++ .../xpath/InputParameterXpathKey.java | 62 + .../ip/profile/info/IpProfileParams.java | 143 + .../profile/info/IpProfileParamsBuilder.java | 389 ++ .../info/ip/profile/params/DhcpParams.java | 82 + .../ip/profile/params/DhcpParamsBuilder.java | 289 ++ .../info/ip/profile/params/DnsServer.java | 62 + .../ip/profile/params/DnsServerBuilder.java | 249 ++ .../info/ip/profile/params/DnsServerKey.java | 63 + .../rev170208/ip/profile/list/IpProfiles.java | 79 + .../ip/profile/list/IpProfilesBuilder.java | 315 ++ .../ip/profile/list/IpProfilesKey.java | 62 + .../param/value/NumericConstraints.java | 67 + .../value/NumericConstraintsBuilder.java | 276 ++ .../param/value/TextConstraints.java | 67 + .../param/value/TextConstraintsBuilder.java | 276 ++ .../rev170208/nfvi/metrics/ExternalPorts.java | 69 + .../nfvi/metrics/ExternalPortsBuilder.java | 264 ++ .../rev170208/nfvi/metrics/InternalPorts.java | 69 + .../nfvi/metrics/InternalPortsBuilder.java | 264 ++ .../types/rev170208/nfvi/metrics/Memory.java | 97 + .../rev170208/nfvi/metrics/MemoryBuilder.java | 345 ++ .../types/rev170208/nfvi/metrics/Network.java | 112 + .../nfvi/metrics/NetworkBuilder.java | 275 ++ .../types/rev170208/nfvi/metrics/Storage.java | 97 + .../nfvi/metrics/StorageBuilder.java | 345 ++ .../types/rev170208/nfvi/metrics/Vcpu.java | 85 + .../rev170208/nfvi/metrics/VcpuBuilder.java | 310 ++ .../nfvi/metrics/network/Incoming.java | 110 + .../nfvi/metrics/network/IncomingBuilder.java | 354 ++ .../nfvi/metrics/network/Outgoing.java | 110 + .../nfvi/metrics/network/OutgoingBuilder.java | 354 ++ .../placement/group/input/CloudProvider.java | 68 + .../group/input/cloud/provider/Aws.java | 49 + .../input/cloud/provider/AwsBuilder.java | 228 + .../group/input/cloud/provider/Cloudsim.java | 49 + .../input/cloud/provider/CloudsimBuilder.java | 228 + .../group/input/cloud/provider/Mock.java | 49 + .../input/cloud/provider/MockBuilder.java | 228 + .../group/input/cloud/provider/Openmano.java | 49 + .../input/cloud/provider/OpenmanoBuilder.java | 228 + .../group/input/cloud/provider/Openstack.java | 73 + .../cloud/provider/OpenstackBuilder.java | 315 ++ .../group/input/cloud/provider/Vsphere.java | 49 + .../input/cloud/provider/VsphereBuilder.java | 228 + .../provider/openstack/AvailabilityZone.java | 52 + .../openstack/AvailabilityZoneBuilder.java | 227 + .../cloud/provider/openstack/ServerGroup.java | 52 + .../openstack/ServerGroupBuilder.java | 227 + .../primitive/parameter/value/Parameter.java | 88 + .../parameter/value/ParameterBuilder.java | 295 ++ .../parameter/value/ParameterKey.java | 62 + .../provider/network/ProviderNetwork.java | 68 + .../network/ProviderNetworkBuilder.java | 264 ++ .../boot/data/SupplementalBootData.java | 55 + .../data/SupplementalBootDataBuilder.java | 228 + .../ui/primitive/group/ParameterGroup.java | 101 + .../group/ParameterGroupBuilder.java | 315 ++ .../ui/primitive/group/ParameterGroupKey.java | 62 + .../group/parameter/group/Parameter.java | 52 + .../parameter/group/ParameterBuilder.java | 420 ++ .../group/parameter/group/ParameterKey.java | 62 + .../vca/config/access/ConfigAccess.java | 64 + .../config/access/ConfigAccessBuilder.java | 228 + .../access/config/access/SshAccess.java | 71 + .../config/access/SshAccessBuilder.java | 251 ++ .../vca/configuration/ConfigPrimitive.java | 129 + .../configuration/ConfigPrimitiveBuilder.java | 360 ++ .../vca/configuration/ConfigPrimitiveKey.java | 62 + .../configuration/InitialConfigPrimitive.java | 85 + .../InitialConfigPrimitiveBuilder.java | 286 ++ .../InitialConfigPrimitiveKey.java | 75 + .../TerminateConfigPrimitive.java | 106 + .../TerminateConfigPrimitiveBuilder.java | 394 ++ .../TerminateConfigPrimitiveKey.java | 75 + .../config/primitive/Parameter.java | 52 + .../config/primitive/ParameterBuilder.java | 420 ++ .../config/primitive/ParameterKey.java | 62 + .../config/primitive/PrimitiveType.java | 44 + .../primitive/type/PrimitiveDefinition.java | 83 + .../type/PrimitiveDefinitionBuilder.java | 336 ++ .../types/rev170208/vca/metrics/Metrics.java | 90 + .../rev170208/vca/metrics/MetricsBuilder.java | 294 ++ .../rev170208/vca/metrics/MetricsKey.java | 62 + .../rev170208/vca/relations/Relation.java | 94 + .../vca/relations/RelationBuilder.java | 291 ++ .../rev170208/vca/relations/RelationKey.java | 62 + .../vca/relations/relation/Entities.java | 78 + .../relations/relation/EntitiesBuilder.java | 271 ++ .../vca/relations/relation/EntitiesKey.java | 62 + .../types/rev170208/vm/flavor/VmFlavor.java | 79 + .../rev170208/vm/flavor/VmFlavorBuilder.java | 313 ++ .../rev170208/volume/info/VolumeSource.java | 41 + .../volume/info/volume/source/Ephemeral.java | 49 + .../info/volume/source/EphemeralBuilder.java | 228 + .../volume/info/volume/source/Image.java | 42 + .../info/volume/source/ImageBuilder.java | 272 ++ .../rev170208/vswitch/epa/VswitchEpa.java | 208 + .../vswitch/epa/VswitchEpaBuilder.java | 250 ++ .../rev181128/$YangModelBindingProvider.java | 12 + .../rev181128/$YangModuleInfoImpl.java | 50 + .../parameters/rev181128/NetsliceParams.java | 88 + .../rev181128/NetsliceSubnetParams.java | 45 + .../rev181128/NetsliceVldParams.java | 68 + .../netslice_params/NetsliceSubnet.java | 51 + .../NetsliceSubnetBuilder.java | 417 ++ .../netslice_params/NetsliceSubnetKey.java | 62 + .../netslice_params/NetsliceVld.java | 51 + .../netslice_params/NetsliceVldBuilder.java | 373 ++ .../netslice_params/NetsliceVldKey.java | 62 + .../NssConnectionPointRef.java | 83 + .../NssConnectionPointRefBuilder.java | 307 ++ .../NssConnectionPointRefKey.java | 77 + .../rev170228/$YangModelBindingProvider.java | 12 + .../base/rev170228/$YangModuleInfoImpl.java | 49 + .../nsd/base/rev170228/ClassifierCommon.java | 114 + .../yang/nsd/base/rev170228/FgdCommon.java | 106 + .../base/rev170228/MonitoringParamCommon.java | 60 + .../rev170228/NsdConnectionPointCommon.java | 63 + .../base/rev170228/NsdDescriptorCommon.java | 468 ++ .../yang/nsd/base/rev170228/NsdVldCommon.java | 59 + .../base/rev170228/PrimitiveParameter.java | 97 + .../yang/nsd/base/rev170228/RspCommon.java | 58 + .../rev170228/ScalingCriteriaOperation.java | 71 + .../nsd/base/rev170228/ScalingTrigger.java | 75 + .../yang/nsd/base/rev170228/VldCommon.java | 158 + .../classifier/common/MatchAttributes.java | 126 + .../common/MatchAttributesBuilder.java | 379 ++ .../classifier/common/MatchAttributesKey.java | 62 + .../descriptor/common/ConnectionPoint.java | 106 + .../common/ConnectionPointBuilder.java | 342 ++ .../descriptor/common/ConnectionPointKey.java | 62 + .../nsd/descriptor/common/KeyPair.java | 76 + .../nsd/descriptor/common/KeyPairBuilder.java | 271 ++ .../nsd/descriptor/common/KeyPairKey.java | 62 + .../descriptor/common/NsConfiguration.java | 48 + .../common/NsConfigurationBuilder.java | 489 ++ .../nsd/descriptor/common/ParameterPool.java | 81 + .../common/ParameterPoolBuilder.java | 272 ++ .../descriptor/common/ParameterPoolKey.java | 62 + .../common/ScalingGroupDescriptor.java | 222 + .../common/ScalingGroupDescriptorBuilder.java | 447 ++ .../common/ScalingGroupDescriptorKey.java | 62 + .../rev170228/nsd/descriptor/common/User.java | 105 + .../nsd/descriptor/common/UserBuilder.java | 314 ++ .../nsd/descriptor/common/UserKey.java | 62 + .../nsd/descriptor/common/Vnffgd.java | 134 + .../nsd/descriptor/common/VnffgdBuilder.java | 478 ++ .../nsd/descriptor/common/VnffgdKey.java | 62 + .../common/connection/point/Connection.java | 55 + .../connection/point/connection/VldRef.java | 55 + .../point/connection/VldRefBuilder.java | 227 + .../connection/VnfdConnectionPointRef.java | 86 + .../VnfdConnectionPointRefBuilder.java | 273 ++ .../common/parameter/pool/Range.java | 68 + .../common/parameter/pool/RangeBuilder.java | 276 ++ .../group/descriptor/ScalingConfigAction.java | 78 + .../ScalingConfigActionBuilder.java | 272 ++ .../descriptor/ScalingConfigActionKey.java | 63 + .../group/descriptor/ScalingPolicy.java | 189 + .../descriptor/ScalingPolicyBuilder.java | 458 ++ .../group/descriptor/ScalingPolicyKey.java | 62 + .../scaling/group/descriptor/VnfdMember.java | 80 + .../group/descriptor/VnfdMemberBuilder.java | 285 ++ .../group/descriptor/VnfdMemberKey.java | 63 + .../scaling/policy/ScalingCriteria.java | 128 + .../policy/ScalingCriteriaBuilder.java | 390 ++ .../scaling/policy/ScalingCriteriaKey.java | 62 + .../nsd/descriptor/common/user/KeyPair.java | 76 + .../common/user/KeyPairBuilder.java | 271 ++ .../descriptor/common/user/KeyPairKey.java | 62 + .../descriptor/common/vnffgd/Classifier.java | 100 + .../common/vnffgd/ClassifierBuilder.java | 432 ++ .../common/vnffgd/ClassifierKey.java | 62 + .../nsd/descriptor/common/vnffgd/Rsp.java | 95 + .../descriptor/common/vnffgd/RspBuilder.java | 336 ++ .../nsd/descriptor/common/vnffgd/RspKey.java | 62 + .../vnffgd/rsp/VnfdConnectionPointRef.java | 127 + .../rsp/VnfdConnectionPointRefBuilder.java | 354 ++ .../vnffgd/rsp/VnfdConnectionPointRefKey.java | 63 + .../rev170228/nsd/vld/common/InitParams.java | 43 + .../common/init/params/VimNetworkProfile.java | 55 + .../init/params/VimNetworkProfileBuilder.java | 227 + .../vld/common/init/params/VimNetworkRef.java | 54 + .../init/params/VimNetworkRefBuilder.java | 227 + .../rev170228/$YangModelBindingProvider.java | 12 + .../nsd/rev170228/$YangModuleInfoImpl.java | 50 + .../osm/yang/nsd/rev170228/NsdCatalog.java | 79 + .../yang/nsd/rev170228/NsdCatalogBuilder.java | 270 ++ .../nsd/rev170228/NsdConstituentVnfd.java | 68 + .../etsi/osm/yang/nsd/rev170228/NsdData.java | 164 + .../nsd/rev170228/NsdMonitoringParam.java | 71 + .../nsd/rev170228/NsdPlacementGroups.java | 70 + .../etsi/osm/yang/nsd/rev170228/NsdVld.java | 74 + .../yang/nsd/rev170228/NsdVnfDependency.java | 66 + .../yang/nsd/rev170228/nsd/catalog/Nsd.java | 66 + .../nsd/rev170228/nsd/catalog/NsdBuilder.java | 1073 +++++ .../nsd/rev170228/nsd/catalog/NsdKey.java | 62 + .../nsd/constituent/vnfd/ConstituentVnfd.java | 92 + .../vnfd/ConstituentVnfdBuilder.java | 307 ++ .../constituent/vnfd/ConstituentVnfdKey.java | 62 + .../nsd/monitoring/param/MonitoringParam.java | 90 + .../param/MonitoringParamBuilder.java | 651 +++ .../monitoring/param/MonitoringParamKey.java | 62 + .../monitoring/param/VnfdMonitoringParam.java | 93 + .../param/VnfdMonitoringParamBuilder.java | 294 ++ .../param/VnfdMonitoringParamKey.java | 78 + .../nsd/placement/groups/PlacementGroups.java | 86 + .../groups/PlacementGroupsBuilder.java | 362 ++ .../placement/groups/PlacementGroupsKey.java | 62 + .../groups/placement/groups/MemberVnfd.java | 79 + .../placement/groups/MemberVnfdBuilder.java | 271 ++ .../placement/groups/MemberVnfdKey.java | 63 + .../osm/yang/nsd/rev170228/nsd/vld/Vld.java | 93 + .../nsd/rev170228/nsd/vld/VldBuilder.java | 640 +++ .../yang/nsd/rev170228/nsd/vld/VldKey.java | 62 + .../nsd/vld/vld/VnfdConnectionPointRef.java | 106 + .../vld/VnfdConnectionPointRefBuilder.java | 318 ++ .../vld/vld/VnfdConnectionPointRefKey.java | 78 + .../nsd/vnf/dependency/VnfDependency.java | 75 + .../vnf/dependency/VnfDependencyBuilder.java | 295 ++ .../nsd/vnf/dependency/VnfDependencyKey.java | 62 + .../rev180928/$YangModelBindingProvider.java | 12 + .../nsi/rev180928/$YangModuleInfoImpl.java | 51 + .../etsi/osm/yang/nsi/rev180928/Nsi$G.java | 159 + .../urn/etsi/osm/yang/nsi/rev180928/Nsi.java | 49 + .../osm/yang/nsi/rev180928/NsiBuilder.java | 510 +++ .../etsi/osm/yang/nsi/rev180928/NsiData.java | 107 + .../etsi/osm/yang/nsi/rev180928/NsiKey.java | 63 + .../nsi/InstantiationParameters.java | 44 + .../nsi/InstantiationParametersBuilder.java | 361 ++ .../rev180928/nsi/NetworkSliceTemplate.java | 44 + .../nsi/NetworkSliceTemplateBuilder.java | 501 +++ .../yang/nsi/rev180928/nsi/NsrRefList.java | 66 + .../nsi/rev180928/nsi/NsrRefListBuilder.java | 249 ++ .../yang/nsi/rev180928/nsi/NsrRefListKey.java | 63 + .../osm/yang/nsi/rev180928/nsi/VlrList.java | 64 + .../nsi/rev180928/nsi/VlrListBuilder.java | 249 ++ .../yang/nsi/rev180928/nsi/VlrListKey.java | 63 + .../rev170208/$YangModelBindingProvider.java | 12 + .../nsr/rev170208/$YangModuleInfoImpl.java | 55 + .../osm/yang/nsr/rev170208/CloudConfig.java | 98 + .../osm/yang/nsr/rev170208/ConfigStates.java | 79 + .../nsr/rev170208/EventConfigPrimitive.java | 96 + .../rev170208/ExecNsConfigPrimitiveInput.java | 147 + .../ExecNsConfigPrimitiveInputBuilder.java | 495 ++ .../ExecNsConfigPrimitiveOutput.java | 182 + .../ExecNsConfigPrimitiveOutputBuilder.java | 569 +++ .../yang/nsr/rev170208/ExecScaleInInput.java | 71 + .../rev170208/ExecScaleInInputBuilder.java | 337 ++ .../yang/nsr/rev170208/ExecScaleInOutput.java | 53 + .../rev170208/ExecScaleInOutputBuilder.java | 241 + .../yang/nsr/rev170208/ExecScaleOutInput.java | 70 + .../rev170208/ExecScaleOutInputBuilder.java | 351 ++ .../nsr/rev170208/ExecScaleOutOutput.java | 53 + .../rev170208/ExecScaleOutOutputBuilder.java | 241 + .../GetNsConfigPrimitiveValuesInput.java | 55 + ...etNsConfigPrimitiveValuesInputBuilder.java | 314 ++ .../GetNsConfigPrimitiveValuesOutput.java | 147 + ...tNsConfigPrimitiveValuesOutputBuilder.java | 331 ++ .../nsr/rev170208/NsInstanceConfigParams.java | 70 + .../NsInstanceConfigParamsCommon.java | 94 + .../nsr/rev170208/NsOperationalStatus.java | 93 + .../osm/yang/nsr/rev170208/NsrService.java | 308 ++ .../etsi/osm/yang/nsr/rev170208/Project1.java | 44 + .../yang/nsr/rev170208/Project1Builder.java | 159 + .../etsi/osm/yang/nsr/rev170208/Project2.java | 28 + .../yang/nsr/rev170208/Project2Builder.java | 138 + .../etsi/osm/yang/nsr/rev170208/Project3.java | 28 + .../yang/nsr/rev170208/Project3Builder.java | 138 + .../osm/yang/nsr/rev170208/RpcCommon.java | 51 + .../rev170208/StartNetworkServiceInput.java | 131 + .../StartNetworkServiceInputBuilder.java | 493 ++ .../rev170208/StartNetworkServiceOutput.java | 53 + .../StartNetworkServiceOutputBuilder.java | 228 + .../osm/yang/nsr/rev170208/TriggerType.java | 71 + .../etsi/osm/yang/nsr/rev170208/Vnffgr.java | 217 + .../rev170208/VnffgrOperationalStatus.java | 77 + .../cloud/config/SshAuthorizedKey.java | 65 + .../cloud/config/SshAuthorizedKeyBuilder.java | 248 + .../cloud/config/SshAuthorizedKeyKey.java | 63 + .../yang/nsr/rev170208/cloud/config/User.java | 105 + .../rev170208/cloud/config/UserBuilder.java | 314 ++ .../nsr/rev170208/cloud/config/UserKey.java | 62 + .../cloud/config/user/SshAuthorizedKey.java | 66 + .../config/user/SshAuthorizedKeyBuilder.java | 248 + .../config/user/SshAuthorizedKeyKey.java | 63 + .../event/config/primitive/Parameter.java | 66 + .../config/primitive/ParameterBuilder.java | 271 ++ .../event/config/primitive/ParameterKey.java | 62 + .../primitive/input/ParameterGroup.java | 66 + .../input/ParameterGroupBuilder.java | 311 ++ .../primitive/input/ParameterGroupKey.java | 62 + .../ns/config/primitive/input/VnfList.java | 106 + .../primitive/input/VnfListBuilder.java | 329 ++ .../ns/config/primitive/input/VnfListKey.java | 75 + .../input/vnf/list/VnfPrimitive.java | 79 + .../input/vnf/list/VnfPrimitiveBuilder.java | 348 ++ .../input/vnf/list/VnfPrimitiveKey.java | 75 + .../primitive/output/ParameterGroup.java | 66 + .../output/ParameterGroupBuilder.java | 311 ++ .../primitive/output/ParameterGroupKey.java | 62 + .../config/primitive/output/VnfOutList.java | 115 + .../primitive/output/VnfOutListBuilder.java | 329 ++ .../primitive/output/VnfOutListKey.java | 75 + .../output/vnf/out/list/VnfOutPrimitive.java | 115 + .../vnf/out/list/VnfOutPrimitiveBuilder.java | 417 ++ .../vnf/out/list/VnfOutPrimitiveKey.java | 75 + .../primitive/values/output/NsParameter.java | 75 + .../values/output/NsParameterBuilder.java | 271 ++ .../values/output/NsParameterGroup.java | 92 + .../output/NsParameterGroupBuilder.java | 291 ++ .../values/output/NsParameterGroupKey.java | 62 + .../values/output/NsParameterKey.java | 62 + .../values/output/VnfPrimitiveGroup.java | 114 + .../output/VnfPrimitiveGroupBuilder.java | 314 ++ .../values/output/VnfPrimitiveGroupKey.java | 62 + .../output/ns/parameter/group/Parameter.java | 75 + .../ns/parameter/group/ParameterBuilder.java | 271 ++ .../ns/parameter/group/ParameterKey.java | 62 + .../output/vnf/primitive/group/Primitive.java | 104 + .../vnf/primitive/group/PrimitiveBuilder.java | 328 ++ .../vnf/primitive/group/PrimitiveKey.java | 75 + .../primitive/group/primitive/Parameter.java | 75 + .../group/primitive/ParameterBuilder.java | 271 ++ .../group/primitive/ParameterKey.java | 62 + .../config/params/VnfdPlacementGroupMaps.java | 86 + .../params/VnfdPlacementGroupMapsBuilder.java | 342 ++ .../params/VnfdPlacementGroupMapsKey.java | 79 + .../params/common/NsdPlacementGroupMaps.java | 67 + .../common/NsdPlacementGroupMapsBuilder.java | 318 ++ .../common/NsdPlacementGroupMapsKey.java | 62 + .../config/params/common/ScalingGroup.java | 89 + .../params/common/ScalingGroupBuilder.java | 291 ++ .../config/params/common/ScalingGroupKey.java | 62 + .../params/common/scaling/group/Instance.java | 63 + .../common/scaling/group/InstanceBuilder.java | 262 ++ .../common/scaling/group/InstanceKey.java | 75 + .../yang/nsr/rev170208/project/KeyPair.java | 76 + .../nsr/rev170208/project/KeyPairBuilder.java | 271 ++ .../nsr/rev170208/project/KeyPairKey.java | 62 + .../rev170208/project/NsInstanceConfig.java | 93 + .../project/NsInstanceConfigBuilder.java | 247 + .../rev170208/project/NsInstanceOpdata.java | 270 ++ .../project/NsInstanceOpdataBuilder.java | 247 + .../project/ns/instance/config/Nsr.java | 216 + .../ns/instance/config/NsrBuilder.java | 695 +++ .../project/ns/instance/config/NsrKey.java | 63 + .../project/ns/instance/config/nsr/Nsd.java | 60 + .../ns/instance/config/nsr/NsdBuilder.java | 1052 +++++ .../project/ns/instance/opdata/Nsr.java | 455 ++ .../ns/instance/opdata/NsrBuilder.java | 777 ++++ .../project/ns/instance/opdata/NsrKey.java | 63 + .../instance/opdata/nsr/ConfigAgentJob.java | 278 ++ .../opdata/nsr/ConfigAgentJobBuilder.java | 539 +++ .../opdata/nsr/ConfigAgentJobKey.java | 75 + .../instance/opdata/nsr/ConnectionPoint.java | 80 + .../opdata/nsr/ConnectionPointBuilder.java | 272 ++ .../opdata/nsr/ConnectionPointKey.java | 62 + .../opdata/nsr/ConstituentVnfrRef.java | 65 + .../opdata/nsr/ConstituentVnfrRefBuilder.java | 248 + .../opdata/nsr/ConstituentVnfrRefKey.java | 62 + .../instance/opdata/nsr/MonitoringParam.java | 122 + .../opdata/nsr/MonitoringParamBuilder.java | 653 +++ .../opdata/nsr/MonitoringParamKey.java | 62 + .../instance/opdata/nsr/NsConfiguration.java | 44 + .../opdata/nsr/NsConfigurationBuilder.java | 439 ++ .../opdata/nsr/ScalingGroupRecord.java | 119 + .../opdata/nsr/ScalingGroupRecordBuilder.java | 291 ++ .../opdata/nsr/ScalingGroupRecordKey.java | 63 + .../project/ns/instance/opdata/nsr/Vlr.java | 97 + .../ns/instance/opdata/nsr/VlrBuilder.java | 292 ++ .../ns/instance/opdata/nsr/VlrKey.java | 63 + .../nsr/config/agent/job/ParameterGroup.java | 66 + .../agent/job/ParameterGroupBuilder.java | 311 ++ .../config/agent/job/ParameterGroupKey.java | 62 + .../opdata/nsr/config/agent/job/Vnfr.java | 186 + .../nsr/config/agent/job/VnfrBuilder.java | 315 ++ .../opdata/nsr/config/agent/job/VnfrKey.java | 63 + .../nsr/config/agent/job/vnfr/Primitive.java | 174 + .../agent/job/vnfr/PrimitiveBuilder.java | 380 ++ .../config/agent/job/vnfr/PrimitiveKey.java | 62 + .../nsr/monitoring/param/VnfrMonParamRef.java | 79 + .../param/VnfrMonParamRefBuilder.java | 272 ++ .../monitoring/param/VnfrMonParamRefKey.java | 79 + .../nsr/scaling/group/record/Instance.java | 237 + .../scaling/group/record/InstanceBuilder.java | 417 ++ .../nsr/scaling/group/record/InstanceKey.java | 75 + .../nsr/vlr/VnfrConnectionPointRef.java | 80 + .../vlr/VnfrConnectionPointRefBuilder.java | 272 ++ .../nsr/vlr/VnfrConnectionPointRefKey.java | 63 + .../service/input/VnfdPlacementGroupMaps.java | 150 + .../input/VnfdPlacementGroupMapsBuilder.java | 427 ++ .../input/VnfdPlacementGroupMapsKey.java | 79 + .../group/maps/SshAuthorizedKey.java | 65 + .../group/maps/SshAuthorizedKeyBuilder.java | 248 + .../group/maps/SshAuthorizedKeyKey.java | 63 + .../input/vnfd/placement/group/maps/User.java | 104 + .../placement/group/maps/UserBuilder.java | 314 ++ .../vnfd/placement/group/maps/UserKey.java | 62 + .../group/maps/user/SshAuthorizedKey.java | 66 + .../maps/user/SshAuthorizedKeyBuilder.java | 248 + .../group/maps/user/SshAuthorizedKeyKey.java | 63 + .../osm/yang/nsr/rev170208/vnffgr/Vnffgr.java | 305 ++ .../nsr/rev170208/vnffgr/VnffgrBuilder.java | 450 ++ .../yang/nsr/rev170208/vnffgr/VnffgrKey.java | 63 + .../rev170208/vnffgr/vnffgr/Classifier.java | 189 + .../vnffgr/vnffgr/ClassifierBuilder.java | 503 +++ .../vnffgr/vnffgr/ClassifierKey.java | 63 + .../yang/nsr/rev170208/vnffgr/vnffgr/Rsp.java | 222 + .../rev170208/vnffgr/vnffgr/RspBuilder.java | 444 ++ .../nsr/rev170208/vnffgr/vnffgr/RspKey.java | 63 + .../vnffgr/rsp/VnfrConnectionPointRef.java | 209 + .../rsp/VnfrConnectionPointRefBuilder.java | 506 +++ .../vnffgr/rsp/VnfrConnectionPointRefKey.java | 75 + .../point/ref/ConnectionPointParams.java | 93 + .../ref/ConnectionPointParamsBuilder.java | 344 ++ .../point/ref/ServiceFunctionForwarder.java | 81 + .../ref/ServiceFunctionForwarderBuilder.java | 275 ++ .../rev180820/$YangModelBindingProvider.java | 12 + .../nst/rev180820/$YangModuleInfoImpl.java | 50 + .../osm/yang/nst/rev180820/Classifier.java | 57 + .../yang/nst/rev180820/ConnectionPoints.java | 73 + .../etsi/osm/yang/nst/rev180820/FiveQi.java | 106 + .../yang/nst/rev180820/NetsliceSubnet.java | 97 + .../osm/yang/nst/rev180820/Netslicefgd.java | 82 + .../osm/yang/nst/rev180820/NetworkSlice.java | 142 + .../yang/nst/rev180820/NetworkSliceType.java | 85 + .../urn/etsi/osm/yang/nst/rev180820/Nst.java | 48 + .../osm/yang/nst/rev180820/NstBuilder.java | 522 +++ .../etsi/osm/yang/nst/rev180820/NstData.java | 249 ++ .../etsi/osm/yang/nst/rev180820/NstKey.java | 62 + .../etsi/osm/yang/nst/rev180820/Nsvld.java | 73 + .../osm/yang/nst/rev180820/ResourceType.java | 85 + .../urn/etsi/osm/yang/nst/rev180820/Rsp.java | 72 + .../nst/rev180820/SliceConnectionPoints.java | 72 + .../etsi/osm/yang/nst/rev180820/Snssai.java | 58 + .../subnet/InstantiationParameters.java | 44 + .../InstantiationParametersBuilder.java | 361 ++ .../nst/rev180820/netslicefgd/Classifier.java | 51 + .../netslicefgd/ClassifierBuilder.java | 435 ++ .../rev180820/netslicefgd/ClassifierKey.java | 62 + .../yang/nst/rev180820/netslicefgd/Rsp.java | 51 + .../nst/rev180820/netslicefgd/RspBuilder.java | 346 ++ .../nst/rev180820/netslicefgd/RspKey.java | 62 + .../slice/NetsliceConnectionPoint.java | 51 + .../slice/NetsliceConnectionPointBuilder.java | 328 ++ .../slice/NetsliceConnectionPointKey.java | 62 + .../network/slice/NetsliceSubnet.java | 50 + .../network/slice/NetsliceSubnetBuilder.java | 394 ++ .../network/slice/NetsliceSubnetKey.java | 62 + .../rev180820/network/slice/NetsliceVld.java | 51 + .../network/slice/NetsliceVldBuilder.java | 616 +++ .../network/slice/NetsliceVldKey.java | 62 + .../rev180820/network/slice/Netslicefgd.java | 50 + .../network/slice/NetslicefgdBuilder.java | 494 ++ .../network/slice/NetslicefgdKey.java | 62 + .../network/slice/QualityOfService.java | 44 + .../slice/QualityOfServiceBuilder.java | 435 ++ .../network/slice/SNSSAIIdentifier.java | 44 + .../slice/SNSSAIIdentifierBuilder.java | 273 ++ .../nsvld/NssConnectionPointRef.java | 92 + .../nsvld/NssConnectionPointRefBuilder.java | 307 ++ .../nsvld/NssConnectionPointRefKey.java | 77 + .../rev180820/rsp/NsdConnectionPointRef.java | 88 + .../rsp/NsdConnectionPointRefBuilder.java | 320 ++ .../rsp/NsdConnectionPointRefKey.java | 62 + .../slice/connection/points/Connection.java | 50 + .../points/connection/NetsliceVldRef.java | 55 + .../connection/NetsliceVldRefBuilder.java | 227 + .../connection/NsdConnectionPointRef.java | 65 + .../NsdConnectionPointRefBuilder.java | 262 ++ .../rev150910/$YangModelBindingProvider.java | 12 + .../rev150910/$YangModuleInfoImpl.java | 43 + .../osm/project/rev150910/OsmProjectData.java | 69 + .../yang/osm/project/rev150910/Project.java | 83 + .../osm/project/rev150910/ProjectBuilder.java | 283 ++ .../osm/project/rev150910/ProjectKey.java | 62 + .../rev170228/$YangModelBindingProvider.java | 12 + .../nsd/rev170228/$YangModuleInfoImpl.java | 50 + .../nsd/rev170228/NsdConstituentVnfd.java | 68 + .../project/nsd/rev170228/NsdDescriptor.java | 45 + .../nsd/rev170228/NsdMonitoringParam.java | 71 + .../nsd/rev170228/NsdPlacementGroups.java | 70 + .../yang/project/nsd/rev170228/NsdVld.java | 71 + .../nsd/rev170228/NsdVnfDependency.java | 66 + .../nsd/rev170228/NsrNsdConstituentVnfd.java | 68 + .../nsd/rev170228/NsrNsdMonitoringParam.java | 69 + .../nsd/rev170228/NsrNsdPlacementGroups.java | 70 + .../yang/project/nsd/rev170228/NsrNsdVld.java | 69 + .../nsd/rev170228/NsrNsdVnfDependency.java | 66 + .../yang/project/nsd/rev170228/Project1.java | 28 + .../nsd/rev170228/Project1Builder.java | 138 + .../nsd/constituent/vnfd/ConstituentVnfd.java | 93 + .../vnfd/ConstituentVnfdBuilder.java | 295 ++ .../constituent/vnfd/ConstituentVnfdKey.java | 62 + .../nsd/monitoring/param/MonitoringParam.java | 90 + .../param/MonitoringParamBuilder.java | 651 +++ .../monitoring/param/MonitoringParamKey.java | 62 + .../monitoring/param/VnfdMonitoringParam.java | 97 + .../param/VnfdMonitoringParamBuilder.java | 294 ++ .../param/VnfdMonitoringParamKey.java | 78 + .../nsd/placement/groups/PlacementGroups.java | 86 + .../groups/PlacementGroupsBuilder.java | 362 ++ .../placement/groups/PlacementGroupsKey.java | 62 + .../groups/placement/groups/MemberVnfd.java | 79 + .../placement/groups/MemberVnfdBuilder.java | 271 ++ .../placement/groups/MemberVnfdKey.java | 63 + .../project/nsd/rev170228/nsd/vld/Vld.java | 90 + .../nsd/rev170228/nsd/vld/VldBuilder.java | 640 +++ .../project/nsd/rev170228/nsd/vld/VldKey.java | 62 + .../nsd/vld/vld/VnfdConnectionPointRef.java | 96 + .../vld/VnfdConnectionPointRefBuilder.java | 294 ++ .../vld/vld/VnfdConnectionPointRefKey.java | 78 + .../nsd/vnf/dependency/VnfDependency.java | 75 + .../vnf/dependency/VnfDependencyBuilder.java | 271 ++ .../nsd/vnf/dependency/VnfDependencyKey.java | 63 + .../nsd/constituent/vnfd/ConstituentVnfd.java | 93 + .../vnfd/ConstituentVnfdBuilder.java | 295 ++ .../constituent/vnfd/ConstituentVnfdKey.java | 62 + .../nsd/monitoring/param/MonitoringParam.java | 88 + .../param/MonitoringParamBuilder.java | 651 +++ .../monitoring/param/MonitoringParamKey.java | 62 + .../monitoring/param/VnfdMonitoringParam.java | 96 + .../param/VnfdMonitoringParamBuilder.java | 294 ++ .../param/VnfdMonitoringParamKey.java | 78 + .../nsd/placement/groups/PlacementGroups.java | 86 + .../groups/PlacementGroupsBuilder.java | 362 ++ .../placement/groups/PlacementGroupsKey.java | 62 + .../groups/placement/groups/MemberVnfd.java | 79 + .../placement/groups/MemberVnfdBuilder.java | 271 ++ .../placement/groups/MemberVnfdKey.java | 63 + .../nsd/rev170228/nsr/nsd/vld/Vld.java | 88 + .../nsd/rev170228/nsr/nsd/vld/VldBuilder.java | 640 +++ .../nsd/rev170228/nsr/nsd/vld/VldKey.java | 62 + .../nsd/vld/vld/VnfdConnectionPointRef.java | 96 + .../vld/VnfdConnectionPointRefBuilder.java | 294 ++ .../vld/vld/VnfdConnectionPointRefKey.java | 78 + .../nsr/nsd/vnf/dependency/VnfDependency.java | 75 + .../vnf/dependency/VnfDependencyBuilder.java | 271 ++ .../nsd/vnf/dependency/VnfDependencyKey.java | 63 + .../nsd/rev170228/project/NsdCatalog.java | 62 + .../rev170228/project/NsdCatalogBuilder.java | 247 + .../rev170228/project/nsd/catalog/Nsd.java | 51 + .../project/nsd/catalog/NsdBuilder.java | 1100 +++++ .../rev170228/project/nsd/catalog/NsdKey.java | 62 + .../rev170228/$YangModelBindingProvider.java | 12 + .../vnfd/rev170228/$YangModuleInfoImpl.java | 48 + .../yang/project/vnfd/rev170228/Project1.java | 32 + .../vnfd/rev170228/Project1Builder.java | 138 + .../vnfd/rev170228/project/VnfdCatalog.java | 63 + .../rev170228/project/VnfdCatalogBuilder.java | 247 + .../rev170228/project/vnfd/catalog/Vnfd.java | 51 + .../project/vnfd/catalog/VnfdBuilder.java | 1040 +++++ .../project/vnfd/catalog/VnfdKey.java | 62 + .../rev170208/$YangModelBindingProvider.java | 12 + .../vlr/rev170208/$YangModuleInfoImpl.java | 49 + .../etsi/osm/yang/vlr/rev170208/Project1.java | 28 + .../yang/vlr/rev170208/Project1Builder.java | 138 + .../vlr/rev170208/project/VlrCatalog.java | 144 + .../rev170208/project/VlrCatalogBuilder.java | 270 ++ .../rev170208/project/vlr/catalog/Vlr.java | 431 ++ .../project/vlr/catalog/VlrBuilder.java | 769 ++++ .../rev170208/project/vlr/catalog/VlrKey.java | 63 + .../rev170228/$YangModelBindingProvider.java | 12 + .../base/rev170228/$YangModuleInfoImpl.java | 48 + .../base/rev170228/CommonConnectionPoint.java | 182 + .../vnfd/base/rev170228/InterfaceType.java | 71 + .../vnfd/base/rev170228/VirtualInterface.java | 63 + .../base/rev170228/VnfOperationalStatus.java | 79 + .../vnfd/base/rev170228/VnfdDescriptor.java | 903 ++++ .../virtual/_interface/VirtualInterface.java | 177 + .../_interface/VirtualInterfaceBuilder.java | 287 ++ .../vnfd/descriptor/ConnectionPoint.java | 77 + .../descriptor/ConnectionPointBuilder.java | 419 ++ .../vnfd/descriptor/ConnectionPointKey.java | 62 + .../vnfd/descriptor/InternalVld.java | 187 + .../vnfd/descriptor/InternalVldBuilder.java | 524 +++ .../vnfd/descriptor/InternalVldKey.java | 62 + .../rev170228/vnfd/descriptor/K8sCluster.java | 169 + .../vnfd/descriptor/K8sClusterBuilder.java | 293 ++ .../base/rev170228/vnfd/descriptor/Kdu.java | 155 + .../rev170228/vnfd/descriptor/KduBuilder.java | 362 ++ .../rev170228/vnfd/descriptor/KduKey.java | 62 + .../vnfd/descriptor/MgmtInterface.java | 108 + .../vnfd/descriptor/MgmtInterfaceBuilder.java | 276 ++ .../vnfd/descriptor/MonitoringParam.java | 161 + .../descriptor/MonitoringParamBuilder.java | 682 +++ .../vnfd/descriptor/MonitoringParamKey.java | 62 + .../vnfd/descriptor/PlacementGroups.java | 81 + .../descriptor/PlacementGroupsBuilder.java | 362 ++ .../vnfd/descriptor/PlacementGroupsKey.java | 62 + .../descriptor/ScalingGroupDescriptor.java | 225 + .../ScalingGroupDescriptorBuilder.java | 447 ++ .../descriptor/ScalingGroupDescriptorKey.java | 62 + .../base/rev170228/vnfd/descriptor/Vdu.java | 378 ++ .../rev170228/vnfd/descriptor/VduBuilder.java | 938 ++++ .../vnfd/descriptor/VduDependency.java | 75 + .../vnfd/descriptor/VduDependencyBuilder.java | 271 ++ .../vnfd/descriptor/VduDependencyKey.java | 62 + .../rev170228/vnfd/descriptor/VduKey.java | 62 + .../vnfd/descriptor/VnfConfiguration.java | 50 + .../descriptor/VnfConfigurationBuilder.java | 521 +++ .../descriptor/internal/vld/InitParams.java | 41 + .../internal/vld/InternalConnectionPoint.java | 78 + .../vld/InternalConnectionPointBuilder.java | 272 ++ .../vld/InternalConnectionPointKey.java | 62 + .../vld/init/params/VimNetworkProfile.java | 53 + .../init/params/VimNetworkProfileBuilder.java | 227 + .../vld/init/params/VimNetworkRef.java | 54 + .../vld/init/params/VimNetworkRefBuilder.java | 227 + .../vnfd/descriptor/k8s/cluster/Nets.java | 64 + .../descriptor/k8s/cluster/NetsBuilder.java | 248 + .../vnfd/descriptor/k8s/cluster/NetsKey.java | 62 + .../vnfd/descriptor/kdu/KduConfiguration.java | 133 + .../kdu/KduConfigurationBuilder.java | 494 ++ .../vnfd/descriptor/kdu/KduModel.java | 48 + .../vnfd/descriptor/kdu/Service.java | 94 + .../vnfd/descriptor/kdu/ServiceBuilder.java | 295 ++ .../vnfd/descriptor/kdu/ServiceKey.java | 62 + .../descriptor/kdu/kdu/model/HelmChart.java | 140 + .../kdu/kdu/model/HelmChartBuilder.java | 250 ++ .../descriptor/kdu/kdu/model/JujuBundle.java | 57 + .../kdu/kdu/model/JujuBundleBuilder.java | 227 + .../mgmt/_interface/DashboardParams.java | 82 + .../_interface/DashboardParamsBuilder.java | 275 ++ .../mgmt/_interface/EndpointType.java | 50 + .../mgmt/_interface/endpoint/type/Cp.java | 53 + .../_interface/endpoint/type/CpBuilder.java | 227 + .../mgmt/_interface/endpoint/type/Ip.java | 50 + .../_interface/endpoint/type/IpBuilder.java | 228 + .../mgmt/_interface/endpoint/type/VduId.java | 52 + .../endpoint/type/VduIdBuilder.java | 227 + .../monitoring/param/JsonQueryParams.java | 67 + .../param/JsonQueryParamsBuilder.java | 250 ++ .../monitoring/param/MonitoringType.java | 70 + .../param/monitoring/type/VduMetric.java | 58 + .../monitoring/type/VduMetricBuilder.java | 227 + .../monitoring/type/VduMonitoringParam.java | 58 + .../type/VduMonitoringParamBuilder.java | 227 + .../param/monitoring/type/VnfMetric.java | 53 + .../monitoring/type/VnfMetricBuilder.java | 227 + .../monitoring/type/vdu/metric/VduMetric.java | 64 + .../type/vdu/metric/VduMetricBuilder.java | 250 ++ .../monitoring/param/VduMonitoringParam.java | 64 + .../param/VduMonitoringParamBuilder.java | 250 ++ .../monitoring/type/vnf/metric/VnfMetric.java | 53 + .../type/vnf/metric/VnfMetricBuilder.java | 227 + .../placement/groups/MemberVdus.java | 61 + .../placement/groups/MemberVdusBuilder.java | 248 + .../placement/groups/MemberVdusKey.java | 62 + .../group/descriptor/ScalingConfigAction.java | 78 + .../ScalingConfigActionBuilder.java | 272 ++ .../descriptor/ScalingConfigActionKey.java | 63 + .../group/descriptor/ScalingPolicy.java | 193 + .../descriptor/ScalingPolicyBuilder.java | 458 ++ .../group/descriptor/ScalingPolicyKey.java | 62 + .../scaling/group/descriptor/Vdu.java | 80 + .../scaling/group/descriptor/VduBuilder.java | 285 ++ .../scaling/group/descriptor/VduKey.java | 62 + .../scaling/policy/ScalingCriteria.java | 131 + .../policy/ScalingCriteriaBuilder.java | 373 ++ .../scaling/policy/ScalingCriteriaKey.java | 62 + .../rev170228/vnfd/descriptor/vdu/Alarm.java | 79 + .../vnfd/descriptor/vdu/AlarmBuilder.java | 625 +++ .../vnfd/descriptor/vdu/AlarmKey.java | 62 + .../descriptor/vdu/AlternativeImages.java | 70 + .../vdu/AlternativeImagesBuilder.java | 316 ++ .../descriptor/vdu/AlternativeImagesKey.java | 62 + .../vnfd/descriptor/vdu/CloudInitInput.java | 42 + .../vnfd/descriptor/vdu/Interface.java | 146 + .../vnfd/descriptor/vdu/InterfaceBuilder.java | 424 ++ .../vnfd/descriptor/vdu/InterfaceKey.java | 62 + .../vdu/InternalConnectionPoint.java | 67 + .../vdu/InternalConnectionPointBuilder.java | 419 ++ .../vdu/InternalConnectionPointKey.java | 62 + .../vnfd/descriptor/vdu/MonitoringParam.java | 91 + .../vdu/MonitoringParamBuilder.java | 295 ++ .../descriptor/vdu/MonitoringParamKey.java | 62 + .../vnfd/descriptor/vdu/VduConfiguration.java | 47 + .../vdu/VduConfigurationBuilder.java | 471 ++ .../vnfd/descriptor/vdu/Volumes.java | 65 + .../vnfd/descriptor/vdu/VolumesBuilder.java | 408 ++ .../vnfd/descriptor/vdu/VolumesKey.java | 62 + .../vdu/_interface/ConnectionPointType.java | 44 + .../connection/point/type/External.java | 55 + .../point/type/ExternalBuilder.java | 227 + .../connection/point/type/Internal.java | 55 + .../point/type/InternalBuilder.java | 227 + .../vdu/cloud/init/input/Filename.java | 53 + .../vdu/cloud/init/input/FilenameBuilder.java | 227 + .../vdu/cloud/init/input/Inline.java | 53 + .../vdu/cloud/init/input/InlineBuilder.java | 227 + .../rev170228/$YangModelBindingProvider.java | 12 + .../vnfd/rev170228/$YangModuleInfoImpl.java | 47 + .../osm/yang/vnfd/rev170228/VnfdCatalog.java | 75 + .../vnfd/rev170228/VnfdCatalogBuilder.java | 270 ++ .../osm/yang/vnfd/rev170228/VnfdData.java | 52 + .../vnfd/rev170228/vnfd/catalog/Vnfd.java | 51 + .../rev170228/vnfd/catalog/VnfdBuilder.java | 1040 +++++ .../vnfd/rev170228/vnfd/catalog/VnfdKey.java | 62 + .../rev170208/$YangModelBindingProvider.java | 12 + .../vnffgd/rev170208/$YangModuleInfoImpl.java | 48 + .../osm/yang/vnffgd/rev170208/Project1.java | 28 + .../vnffgd/rev170208/Project1Builder.java | 138 + .../rev170208/project/VnffgdCatalog.java | 76 + .../project/VnffgdCatalogBuilder.java | 247 + .../project/vnffgd/catalog/Vnffgd.java | 111 + .../project/vnffgd/catalog/VnffgdBuilder.java | 341 ++ .../project/vnffgd/catalog/VnffgdKey.java | 63 + .../rev170228/$YangModelBindingProvider.java | 12 + .../vnfr/rev170228/$YangModuleInfoImpl.java | 54 + .../vnfr/rev170228/AssociatedVirtualCps.java | 62 + .../vnfr/rev170228/PlacementGroupInfo.java | 58 + .../osm/yang/vnfr/rev170228/Project1.java | 28 + .../yang/vnfr/rev170228/Project1Builder.java | 138 + .../vnfr/rev170228/VduOperationalStatus.java | 85 + .../yang/vnfr/rev170228/VirtualInterface.java | 70 + .../vnfr/rev170228/VnfOperationalStatus.java | 89 + .../associated/virtual/cps/VirtualCps.java | 90 + .../virtual/cps/VirtualCpsBuilder.java | 466 ++ .../associated/virtual/cps/VirtualCpsKey.java | 62 + .../group/info/PlacementGroupsInfo.java | 54 + .../info/PlacementGroupsInfoBuilder.java | 377 ++ .../group/info/PlacementGroupsInfoKey.java | 62 + .../vnfr/rev170228/project/VnfrCatalog.java | 364 ++ .../rev170228/project/VnfrCatalogBuilder.java | 270 ++ .../rev170228/project/vnfr/catalog/Vnfr.java | 651 +++ .../project/vnfr/catalog/VnfrBuilder.java | 915 ++++ .../project/vnfr/catalog/VnfrKey.java | 63 + .../vnfr/catalog/vnfr/CloudConfig.java | 43 + .../vnfr/catalog/vnfr/CloudConfigBuilder.java | 311 ++ .../vnfr/catalog/vnfr/ConnectionPoint.java | 111 + .../catalog/vnfr/ConnectionPointBuilder.java | 541 +++ .../vnfr/catalog/vnfr/ConnectionPointKey.java | 62 + .../vnfr/catalog/vnfr/InternalVlr.java | 76 + .../vnfr/catalog/vnfr/InternalVlrBuilder.java | 273 ++ .../vnfr/catalog/vnfr/InternalVlrKey.java | 63 + .../vnfr/catalog/vnfr/MgmtInterface.java | 78 + .../catalog/vnfr/MgmtInterfaceBuilder.java | 276 ++ .../vnfr/catalog/vnfr/MonitoringParam.java | 121 + .../catalog/vnfr/MonitoringParamBuilder.java | 339 ++ .../vnfr/catalog/vnfr/MonitoringParamKey.java | 62 + .../project/vnfr/catalog/vnfr/Vdur.java | 364 ++ .../vnfr/catalog/vnfr/VdurBuilder.java | 929 ++++ .../project/vnfr/catalog/vnfr/VdurKey.java | 63 + .../vnfr/catalog/vnfr/VnfConfiguration.java | 44 + .../catalog/vnfr/VnfConfigurationBuilder.java | 439 ++ .../project/vnfr/catalog/vnfr/Vnfd.java | 45 + .../vnfr/catalog/vnfr/VnfdBuilder.java | 1019 +++++ .../catalog/vnfr/mgmt/_interface/SshKey.java | 68 + .../vnfr/mgmt/_interface/SshKeyBuilder.java | 250 ++ .../vnfr/monitoring/param/MonitoringType.java | 70 + .../param/monitoring/type/VduMetric.java | 58 + .../monitoring/type/VduMetricBuilder.java | 227 + .../monitoring/type/VduMonitoringParam.java | 58 + .../type/VduMonitoringParamBuilder.java | 227 + .../param/monitoring/type/VnfMetric.java | 53 + .../monitoring/type/VnfMetricBuilder.java | 227 + .../monitoring/type/vdu/metric/VduMetric.java | 64 + .../type/vdu/metric/VduMetricBuilder.java | 251 ++ .../monitoring/param/VduMonitoringParam.java | 64 + .../param/VduMonitoringParamBuilder.java | 251 ++ .../monitoring/type/vnf/metric/VnfMetric.java | 53 + .../type/vnf/metric/VnfMetricBuilder.java | 227 + .../vnfr/catalog/vnfr/vdur/Interface.java | 116 + .../catalog/vnfr/vdur/InterfaceBuilder.java | 377 ++ .../vnfr/catalog/vnfr/vdur/InterfaceKey.java | 62 + .../vnfr/vdur/InternalConnectionPoint.java | 93 + .../vdur/InternalConnectionPointBuilder.java | 517 +++ .../vnfr/vdur/InternalConnectionPointKey.java | 62 + .../catalog/vnfr/vdur/MonitoringParam.java | 91 + .../vnfr/vdur/MonitoringParamBuilder.java | 295 ++ .../catalog/vnfr/vdur/MonitoringParamKey.java | 62 + .../catalog/vnfr/vdur/VduConfiguration.java | 44 + .../vnfr/vdur/VduConfigurationBuilder.java | 439 ++ .../vnfr/catalog/vnfr/vdur/Volumes.java | 77 + .../catalog/vnfr/vdur/VolumesBuilder.java | 431 ++ .../vnfr/catalog/vnfr/vdur/VolumesKey.java | 62 + .../vdur/_interface/ConnectionPointType.java | 44 + .../connection/point/type/External.java | 55 + .../point/type/ExternalBuilder.java | 227 + .../connection/point/type/Internal.java | 55 + .../point/type/InternalBuilder.java | 227 + .../virtual/_interface/VirtualInterface.java | 262 ++ .../_interface/VirtualInterfaceBuilder.java | 356 ++ .../rev130715/$YangModelBindingProvider.java | 12 + .../types/rev130715/$YangModuleInfoImpl.java | 43 + .../ietf/inet/types/rev130715/AsNumber.java | 91 + .../ietf/inet/types/rev130715/DomainName.java | 90 + .../yang/ietf/inet/types/rev130715/Dscp.java | 95 + .../yang/ietf/inet/types/rev130715/Host.java | 99 + .../inet/types/rev130715/HostBuilder.java | 23 + .../ietf/inet/types/rev130715/IpAddress.java | 99 + .../types/rev130715/IpAddressBuilder.java | 23 + .../inet/types/rev130715/IpAddressNoZone.java | 99 + .../rev130715/IpAddressNoZoneBuilder.java | 23 + .../ietf/inet/types/rev130715/IpPrefix.java | 99 + .../inet/types/rev130715/IpPrefixBuilder.java | 23 + .../ietf/inet/types/rev130715/IpVersion.java | 85 + .../inet/types/rev130715/Ipv4Address.java | 85 + .../types/rev130715/Ipv4AddressNoZone.java | 56 + .../ietf/inet/types/rev130715/Ipv4Prefix.java | 85 + .../inet/types/rev130715/Ipv6Address.java | 85 + .../types/rev130715/Ipv6AddressNoZone.java | 56 + .../inet/types/rev130715/Ipv6FlowLabel.java | 95 + .../ietf/inet/types/rev130715/Ipv6Prefix.java | 85 + .../ietf/inet/types/rev130715/PortNumber.java | 91 + .../yang/ietf/inet/types/rev130715/Uri.java | 73 + .../rev130715/$YangModelBindingProvider.java | 12 + .../types/rev130715/$YangModuleInfoImpl.java | 43 + .../ietf/yang/types/rev130715/Counter32.java | 91 + .../ietf/yang/types/rev130715/Counter64.java | 91 + .../yang/types/rev130715/DateAndTime.java | 85 + .../ietf/yang/types/rev130715/DottedQuad.java | 85 + .../ietf/yang/types/rev130715/Gauge32.java | 91 + .../ietf/yang/types/rev130715/Gauge64.java | 91 + .../ietf/yang/types/rev130715/HexString.java | 85 + .../ietf/yang/types/rev130715/MacAddress.java | 85 + .../types/rev130715/ObjectIdentifier.java | 85 + .../types/rev130715/ObjectIdentifier128.java | 56 + .../yang/types/rev130715/PhysAddress.java | 85 + .../ietf/yang/types/rev130715/Timestamp.java | 60 + .../ietf/yang/types/rev130715/Timeticks.java | 91 + .../yang/ietf/yang/types/rev130715/Uuid.java | 85 + .../ietf/yang/types/rev130715/Xpath10.java | 73 + .../yang/types/rev130715/YangIdentifier.java | 90 + .../types/rev130715/ZeroBasedCounter32.java | 60 + .../types/rev130715/ZeroBasedCounter64.java | 60 + src/main/resources/log4j.properties | 35 + src/main/resources/logback.xml | 25 + src/main/resources/osm5.properties.xml | 28 + src/main/yang/augments/additional-info.yang | 42 + src/main/yang/augments/alarm.yang | 70 + .../yang/augments/alternative-images.yang | 57 + src/main/yang/augments/cloud-init.yang | 54 + src/main/yang/augments/common-augments.yang | 677 +++ src/main/yang/augments/day1-2.yang | 59 + src/main/yang/augments/epa.yang | 262 ++ src/main/yang/augments/etsi-nfv-common.yang | 736 +++ .../yang/augments/etsi-nfv-descriptors.yang | 65 + src/main/yang/augments/etsi-nfv-ns.yang | 1585 +++++++ src/main/yang/augments/etsi-nfv-nsd.yang | 62 + src/main/yang/augments/etsi-nfv-pnf.yang | 121 + src/main/yang/augments/etsi-nfv-pnfd.yang | 26 + src/main/yang/augments/etsi-nfv-vnf.yang | 2580 +++++++++++ src/main/yang/augments/etsi-nfv-vnfd.yang | 26 + src/main/yang/augments/interface.yang | 68 + src/main/yang/augments/ip-profiles.yang | 218 + src/main/yang/augments/kdu.yang | 177 + src/main/yang/augments/mgmt-interface.yang | 40 + src/main/yang/augments/ns-configuration.yang | 44 + src/main/yang/augments/ns-various.yang | 65 + src/main/yang/augments/ns-vld.yang | 131 + src/main/yang/augments/scaling.yang | 168 + src/main/yang/augments/various.yang | 131 + src/main/yang/augments/vip.yang | 63 + src/main/yang/ietf-inet-types.yang | 458 ++ src/main/yang/ietf-yang-types.yang | 474 ++ src/main/yang/instantiation-parameters.yang | 204 + src/main/yang/mano-types.yang | 2379 ++++++++++ .../netslice-instantiation-parameters.yang | 95 + src/main/yang/nsd-base.yang | 897 ++++ src/main/yang/nsd.yang | 254 ++ src/main/yang/nsi.yang | 118 + src/main/yang/nsr.yang | 1533 +++++++ src/main/yang/nst.yang | 325 ++ src/main/yang/osm-project.yang | 63 + src/main/yang/project-nsd.yang | 440 ++ src/main/yang/project-vnfd.yang | 57 + src/main/yang/vlr.yang | 199 + src/main/yang/vnfd-base.yang | 1126 +++++ src/main/yang/vnfd.yang | 60 + src/main/yang/vnffgd.yang | 82 + src/main/yang/vnfr.yang | 708 +++ src/test/resources/readme.txt | 0 1900 files changed, 313347 insertions(+), 90 deletions(-) create mode 100644 .gitignore create mode 100644 hackfest_multivdu_vnf.tar create mode 100644 hackfest_multivdu_vnf.zip create mode 100644 pathname create mode 100644 pathname.tar create mode 100644 pathname.tar.gz create mode 100644 pom-generate-sources.xml create mode 100644 pom.xml create mode 100644 src/main/java/OSM10NBIClient/NSActionRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/NSCreateInstanceRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/NSInstantiateInstanceRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/NSScaleRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/OSM10Client.java create mode 100644 src/main/java/OSM10NBIClient/OSM10NBIClientT.java create mode 100644 src/main/java/OSM10NBIClient/ProjectCreateRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/ProjectEditRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/ProjectRoleMapping.java create mode 100644 src/main/java/OSM10NBIClient/UserCreateRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/UserEditRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/VIMCreateRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/VIMEditRequestPayload.java create mode 100644 src/main/java/OSM10NBIClient/testjsonparse.java create mode 100644 src/main/java/OSM10Util/OSM10ArchiveExtractor/OSM10NSExtractor.java create mode 100644 src/main/java/OSM10Util/OSM10ArchiveExtractor/OSM10VNFDExtractor.java create mode 100644 src/main/java/OSM10Util/OSM10NSReq/OSM10NSRequirements.java create mode 100644 src/main/java/OSM10Util/OSM10VNFReq/OSM10VNFRequirements.java create mode 100644 src/main/java/OSM10Util/examples/Example.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AddressType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityScope.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChangeVnfFlavour.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChecksumAlgorithm.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ConnectivityType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/CpRole.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Cpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EphemeralStorage.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ethernet.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EtsiNfvDescriptorsData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/FlowPattern.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/HealVnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InstantiateVnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InternalLifecycleManagementScriptEvent.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/IpAddress.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv4.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv6.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LayerProtocol.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Leaf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LinkBitrateRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LocalAffinityOrAntiAffinityRule.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MacAddress.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ModifyVnfInformation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MonitoringParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Mpls.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nfv.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/NfvBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nsd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Odu2.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/OperateVnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Pnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/PseudoWire.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/QueryVnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ResourceHandle.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Root.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/RootStorage.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnfToLevel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityGroupRule.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityParameters.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha224.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha256.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha384.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha512.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/StorageType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SupportedOperation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SwapStorage.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/TerminateVnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/VirtualNetworkInterfaceRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Vnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityTypeBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/Protocol.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRule.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Nsd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Pnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Vnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Df.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScript.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Sapd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDesc.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Vnffgd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/Dependencies.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspect.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/PrimaryId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/SecondaryId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfoBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMapping.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMapping.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMapping.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivity.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivity.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivity.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/CpdOrVirtualLink.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Ns.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/NsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Pnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/PnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDesc.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDescBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Vnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/Ns.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/NsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/Pnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/PnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/Vnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/VnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/Df.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/Qos.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/QosBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPool.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/Nfpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentBaseElementId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentCpdId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Ns.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/NsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Pnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/PnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Vnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/VnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/Ns.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/NsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/Pnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/PnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/Vnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/VnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/Security.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRule.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirement.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurableProperties.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurablePropertiesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Df.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Indicator.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDesc.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScript.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributes.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDesc.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Vdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDesc.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDesc.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/Flavour.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParameters.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/Qos.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/QosBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurableProperty.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/Indicator.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspect.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfaces.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetails.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetailsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/Deltas.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDelta.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDelta.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetails.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/CpConnection.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDesc.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDescBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNet.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNetBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/Checksum.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/ChecksumBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurableProperties.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNode.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapability.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemory.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemoryBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetail.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParameters.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/Pinning.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/PinningBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/Rule.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirements.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/EtsiNfvNsdData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/Nsd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/NsdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Nsd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Pnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Vnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/EtsiNfvPnfdData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/Pnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/PnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/EtsiNfvVnfdData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/Vnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/VnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedAlternativeImages.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedVimType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/ExtendedInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/ExtendedAlarm.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/Alarm.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/ExtendedCloudInit.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/CloudInitInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Filename.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/FilenameBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Inline.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/InlineBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/ExtendedVnfConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Key.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/AllocationProperties.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuPolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedDiskIoQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMemQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMempageSize.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedNuma.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedVifQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/Node.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/OmNumaType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/Vcpu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Cores.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/CoresBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreads.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreadsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Threads.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/ThreadsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreads.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreadsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIds.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/ExtendedVldProtocolData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedExtCpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedKdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sCluster.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sClusterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Kdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Service.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/Nets.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/KduModel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChart.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChartBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundle.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundleBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/ExtendedMgmtInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmProperties.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmSeverityType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmStatisticType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ConfigurationMethod.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/Description.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ParameterDataType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameterValue.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/RelationalOperationType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingCriteriaOperation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingPolicyType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingTrigger.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VduConfigAccess.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VirtualInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcMetrics.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcRelations.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/Actions.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/ActionsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Alarm.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Ok.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/ConfigMethod.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Script.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ScriptBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/ExecutionEnvironmentList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/ExecutionEnvironmentListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/ExecutionEnvironmentListKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/execution/environment/list/ExecutionEnvironmentModel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/HelmChart.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/HelmChartBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/juju/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/juju/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/juju/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/juju/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/script/Script.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/script/ScriptBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/primitive/parameter/value/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/primitive/parameter/value/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/primitive/parameter/value/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vdu/config/access/ConfigAccess.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vdu/config/access/ConfigAccessBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vdu/config/access/config/access/SshAccess.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vdu/config/access/config/access/SshAccessBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/virtual/_interface/VirtualInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/virtual/_interface/VirtualInterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/ConfigPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/ConfigPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/ConfigPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/InitialConfigPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/InitialConfigPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/InitialConfigPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/TerminateConfigPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/TerminateConfigPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/TerminateConfigPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/config/primitive/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/config/primitive/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/config/primitive/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/initial/config/primitive/PrimitiveType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/initial/config/primitive/primitive/type/PrimitiveDefinition.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/configuration/initial/config/primitive/primitive/type/PrimitiveDefinitionBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/metrics/Metrics.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/metrics/MetricsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/metrics/MetricsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/relations/Relation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/relations/RelationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/relations/RelationKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/relations/relation/Entities.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/relations/relation/EntitiesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/vnfc/relations/relation/EntitiesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/configuration/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/configuration/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/configuration/norev/ExtendedNsConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/configuration/norev/Nsd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/configuration/norev/Nsd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/configuration/norev/extended/ns/configuration/NsConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/configuration/norev/extended/ns/configuration/NsConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/ExtendedFloatingIp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/ExtendedSecurityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/L3ProtocolData1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/L3ProtocolData1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/Nsd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/Nsd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/Sapd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/various/norev/Sapd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/DeviatedConstituentCpdId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/ExtendedVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/VirtualLinkConnectivity1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/VirtualLinkConnectivity1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/VirtualLinkDesc1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/VirtualLinkDesc1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/deviated/constituent/cpd/id/ConstituentCpdId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/deviated/constituent/cpd/id/ConstituentCpdIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/deviated/constituent/cpd/id/ConstituentCpdIdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/extended/vld/ProviderNetwork.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/extended/vld/ProviderNetworkBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/ExtendedScaling.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/ScalingAspect1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/ScalingAspect1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/ScalingConfigAction.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/ScalingConfigActionBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/ScalingConfigActionKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/ScalingPolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/ScalingPolicyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/ScalingPolicyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/scaling/policy/ScalingCriteria.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/scaling/policy/ScalingCriteriaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/scaling/norev/extended/scaling/scaling/policy/ScalingCriteriaKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/ExtCpd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/ExtCpd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/ExtendedCpd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/ExtendedDeviceBus.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/ExtendedSecurityGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/ExtendedVdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/ExtendedVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/IntCpd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/IntCpd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/IntVirtualLinkDesc1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/IntVirtualLinkDesc1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/L3ProtocolData1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/L3ProtocolData1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/Vdu1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/Vdu1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/VirtualStorageDesc1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/VirtualStorageDesc1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/extended/vdu/SupplementalBootData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/extended/vdu/SupplementalBootDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/extended/vld/ProviderNetwork.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/various/norev/extended/vld/ProviderNetworkBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/ExtendedVip.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/Vnfd1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/Vnfd1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/extended/vip/Vip.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/extended/vip/VipBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/extended/vip/VipKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/extended/vip/vip/PairedInterfaces.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/extended/vip/vip/PairedInterfacesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/vip/norev/extended/vip/vip/PairedInterfacesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/InternalVldParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/IpProfileUpdateSchema.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/NsParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/VduParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/VldCommonParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/VldParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/VnfParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/internal_vld_params/InternalConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/internal_vld_params/InternalConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/internal_vld_params/InternalConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/internal_vld_params/IpProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/internal_vld_params/IpProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ip/profile/update/schema/DhcpParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ip/profile/update/schema/DhcpParamsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ip/profile/update/schema/DnsServer.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ip/profile/update/schema/DnsServerBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ip/profile/update/schema/DnsServerKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ns_params/Vld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ns_params/VldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ns_params/VldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ns_params/Vnf.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ns_params/VnfBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/ns_params/VnfKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vdu_params/Interface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vdu_params/InterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vdu_params/InterfaceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vdu_params/Volume.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vdu_params/VolumeBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vdu_params/VolumeKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vld_common_params/IpProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vld_common_params/IpProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vld_params/VnfdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vld_params/VnfdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vld_params/VnfdConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vnf_params/InternalVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vnf_params/InternalVldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vnf_params/InternalVldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vnf_params/Vdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vnf_params/VduBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/instantiation/parameters/rev180914/vnf_params/VduKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ActionParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/AggregationType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/AlarmMetricType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/AlarmProperties.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/AlarmSeverityType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/AlarmStatisticType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/AllocationProperties.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ApiType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/CloudAccountType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/CloudConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ConfigFile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ConfigurationMethod.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ConnectionPointType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ControlParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/CpuFeatureType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/EventConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/GuestEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/HostAggregate.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/HostEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/HttpEndpoints.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/HttpMethod.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/HypervisorEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ImageProperties.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/InputParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/InputParameterXpath.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/IpProfileInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/IpProfileList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/JsonQueryMethod.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/MetaDataType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/MonitoringParamAggregation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/MonitoringParamUiData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/MonitoringParamValue.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/NamedValue.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/NfviMetricType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/NfviMetrics.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/PackageType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ParamValueType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ParameterDataType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/PlacementGroupInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/PlacementGroupInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/PrimitiveParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/PrimitiveParameterValue.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ProviderNetwork.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/RelationalOperationType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/RpcProjectName.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ScalingCriteriaOperation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ScalingPolicyType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ScalingTrigger.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/SupplementalBootData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/UiPrimitiveGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VcaConfigAccess.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VcaConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VcaMetrics.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VcaRelations.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VirtualLinkType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VmFlavor.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VmFlavorName.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VolumeInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/VswitchEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/WidgetType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/action/param/ActionParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/action/param/ActionParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/action/param/ActionParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/Actions.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/ActionsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/Alarm.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/AlarmBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/AlarmKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/InsufficientData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/InsufficientDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/InsufficientDataKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/Ok.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/OkBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/alarm/properties/actions/OkKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/KeyPair.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/KeyPairBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/KeyPairKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/User.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/UserBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/UserKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/user/KeyPair.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/user/KeyPairBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/cloud/config/user/KeyPairKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/config/file/ConfigFile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/config/file/ConfigFileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/config/file/ConfigFileKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/ConfigMethod.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/ExecutionEnvironmentList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/ExecutionEnvironmentListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/Script.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/ScriptBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/ExecutionEnvironmentList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/ExecutionEnvironmentListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/ExecutionEnvironmentListKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/execution/environment/list/ExecutionEnvironmentModel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/HelmChart.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/HelmChartBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/juju/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/execution/environment/list/execution/environment/list/execution/environment/model/juju/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/juju/Juju.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/juju/JujuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/script/Script.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/configuration/method/config/method/script/ScriptBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/control/param/ControlParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/control/param/ControlParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/control/param/ControlParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/event/config/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/event/config/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/event/config/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/GuestEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/GuestEpaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/CpuPolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/DiskIoQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/DiskIoQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/MemQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/MemQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/NumaPolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/PcieDevice.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/PcieDeviceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/PcieDeviceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/VifQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/VifQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/cpu/policy/CpuPinning.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/cpu/policy/CpuPinningBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/cpu/policy/CpuQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/cpu/policy/CpuQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/cpu/policy/cpu/quota/CpuQuota.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/cpu/policy/cpu/quota/CpuQuotaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/NumaAware.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/NumaAwareBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/NumaUnaware.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/NumaUnawareBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/NumaNodePolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/NumaNodePolicyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/Node.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/NodeBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/NodeKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/OmNumaType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/Vcpu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/VcpuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/VcpuKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/Cores.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/CoresBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/PairedThreads.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/PairedThreadsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/Threads.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/ThreadsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/paired/threads/PairedThreads.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/paired/threads/PairedThreadsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIds.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/guest/epa/guest/epa/numa/policy/numa/aware/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/aggregate/HostAggregate.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/aggregate/HostAggregateBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/aggregate/HostAggregateKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/HostEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/HostEpaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/host/epa/CpuFeature.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/host/epa/CpuFeatureBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/host/epa/CpuFeatureKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/host/epa/OmCpuFeature.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/host/epa/OmCpuFeatureBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/host/epa/host/epa/OmCpuFeatureKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/http/endpoints/HttpEndpoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/http/endpoints/HttpEndpointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/http/endpoints/HttpEndpointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/http/endpoints/http/endpoint/Headers.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/http/endpoints/http/endpoint/HeadersBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/http/endpoints/http/endpoint/HeadersKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/hypervisor/epa/HypervisorEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/hypervisor/epa/HypervisorEpaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/input/parameter/InputParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/input/parameter/InputParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/input/parameter/InputParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/input/parameter/xpath/InputParameterXpath.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/input/parameter/xpath/InputParameterXpathBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/input/parameter/xpath/InputParameterXpathKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/info/IpProfileParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/info/IpProfileParamsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/info/ip/profile/params/DhcpParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/info/ip/profile/params/DhcpParamsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/info/ip/profile/params/DnsServer.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/info/ip/profile/params/DnsServerBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/info/ip/profile/params/DnsServerKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/list/IpProfiles.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/list/IpProfilesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ip/profile/list/IpProfilesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/monitoring/param/value/NumericConstraints.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/monitoring/param/value/NumericConstraintsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/monitoring/param/value/TextConstraints.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/monitoring/param/value/TextConstraintsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/ExternalPorts.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/ExternalPortsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/InternalPorts.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/InternalPortsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/Memory.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/MemoryBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/Network.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/NetworkBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/Storage.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/StorageBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/Vcpu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/VcpuBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/network/Incoming.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/network/IncomingBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/network/Outgoing.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/nfvi/metrics/network/OutgoingBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/CloudProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/Aws.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/AwsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/Cloudsim.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/CloudsimBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/Mock.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/MockBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/Openmano.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/OpenmanoBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/Openstack.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/OpenstackBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/Vsphere.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/VsphereBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/openstack/AvailabilityZone.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/openstack/AvailabilityZoneBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/openstack/ServerGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/placement/group/input/cloud/provider/openstack/ServerGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/primitive/parameter/value/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/primitive/parameter/value/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/primitive/parameter/value/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/provider/network/ProviderNetwork.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/provider/network/ProviderNetworkBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/supplemental/boot/data/SupplementalBootData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/supplemental/boot/data/SupplementalBootDataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ui/primitive/group/ParameterGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ui/primitive/group/ParameterGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ui/primitive/group/ParameterGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ui/primitive/group/parameter/group/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ui/primitive/group/parameter/group/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/ui/primitive/group/parameter/group/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/config/access/ConfigAccess.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/config/access/ConfigAccessBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/config/access/config/access/SshAccess.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/config/access/config/access/SshAccessBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/ConfigPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/ConfigPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/ConfigPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/InitialConfigPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/InitialConfigPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/InitialConfigPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/TerminateConfigPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/TerminateConfigPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/TerminateConfigPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/config/primitive/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/config/primitive/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/config/primitive/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/initial/config/primitive/PrimitiveType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/initial/config/primitive/primitive/type/PrimitiveDefinition.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/configuration/initial/config/primitive/primitive/type/PrimitiveDefinitionBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/metrics/Metrics.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/metrics/MetricsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/metrics/MetricsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/relations/Relation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/relations/RelationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/relations/RelationKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/relations/relation/Entities.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/relations/relation/EntitiesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vca/relations/relation/EntitiesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vm/flavor/VmFlavor.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vm/flavor/VmFlavorBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/volume/info/VolumeSource.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/volume/info/volume/source/Ephemeral.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/volume/info/volume/source/EphemeralBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/volume/info/volume/source/Image.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/volume/info/volume/source/ImageBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vswitch/epa/VswitchEpa.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/vswitch/epa/VswitchEpaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/NetsliceParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/NetsliceSubnetParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/NetsliceVldParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_params/NetsliceSubnet.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_params/NetsliceSubnetBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_params/NetsliceSubnetKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_params/NetsliceVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_params/NetsliceVldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_params/NetsliceVldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_vld_params/NssConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_vld_params/NssConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/netslice/instantiation/parameters/rev181128/netslice_vld_params/NssConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/ClassifierCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/FgdCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/MonitoringParamCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/NsdConnectionPointCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/NsdDescriptorCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/NsdVldCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/PrimitiveParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/RspCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/ScalingCriteriaOperation.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/ScalingTrigger.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/VldCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/classifier/common/MatchAttributes.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/classifier/common/MatchAttributesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/classifier/common/MatchAttributesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/KeyPair.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/KeyPairBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/KeyPairKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/NsConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/NsConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ParameterPool.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ParameterPoolBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ParameterPoolKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ScalingGroupDescriptor.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ScalingGroupDescriptorBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/ScalingGroupDescriptorKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/User.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/UserBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/UserKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/Vnffgd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/VnffgdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/VnffgdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/connection/point/Connection.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/connection/point/connection/VldRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/connection/point/connection/VldRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/connection/point/connection/VnfdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/connection/point/connection/VnfdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/parameter/pool/Range.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/parameter/pool/RangeBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/ScalingConfigAction.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/ScalingConfigActionBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/ScalingConfigActionKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/ScalingPolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/ScalingPolicyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/ScalingPolicyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/VnfdMember.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/VnfdMemberBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/VnfdMemberKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/scaling/policy/ScalingCriteria.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/scaling/policy/ScalingCriteriaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/scaling/group/descriptor/scaling/policy/ScalingCriteriaKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/user/KeyPair.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/user/KeyPairBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/user/KeyPairKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/Classifier.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/ClassifierBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/ClassifierKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/Rsp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/RspBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/RspKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/rsp/VnfdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/rsp/VnfdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/descriptor/common/vnffgd/rsp/VnfdConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/vld/common/InitParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/vld/common/init/params/VimNetworkProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/vld/common/init/params/VimNetworkProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/vld/common/init/params/VimNetworkRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/base/rev170228/nsd/vld/common/init/params/VimNetworkRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdCatalog.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdCatalogBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdConstituentVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdPlacementGroups.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/NsdVnfDependency.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/catalog/Nsd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/catalog/NsdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/catalog/NsdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/constituent/vnfd/ConstituentVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/constituent/vnfd/ConstituentVnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/constituent/vnfd/ConstituentVnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/monitoring/param/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/monitoring/param/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/monitoring/param/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/monitoring/param/monitoring/param/VnfdMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/monitoring/param/monitoring/param/VnfdMonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/monitoring/param/monitoring/param/VnfdMonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/placement/groups/PlacementGroups.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/placement/groups/PlacementGroupsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/placement/groups/PlacementGroupsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/placement/groups/placement/groups/MemberVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/placement/groups/placement/groups/MemberVnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/placement/groups/placement/groups/MemberVnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vld/Vld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vld/VldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vld/VldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vld/vld/VnfdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vld/vld/VnfdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vld/vld/VnfdConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vnf/dependency/VnfDependency.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vnf/dependency/VnfDependencyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsd/rev170228/nsd/vnf/dependency/VnfDependencyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/Nsi$G.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/Nsi.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/NsiBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/NsiData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/NsiKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/InstantiationParameters.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/InstantiationParametersBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/NetworkSliceTemplate.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/NetworkSliceTemplateBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/NsrRefList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/NsrRefListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/NsrRefListKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/VlrList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/VlrListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsi/rev180928/nsi/VlrListKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/CloudConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ConfigStates.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/EventConfigPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecNsConfigPrimitiveInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecNsConfigPrimitiveInputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecNsConfigPrimitiveOutput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecNsConfigPrimitiveOutputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleInInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleInInputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleInOutput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleInOutputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleOutInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleOutInputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleOutOutput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ExecScaleOutOutputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/GetNsConfigPrimitiveValuesInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/GetNsConfigPrimitiveValuesInputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/GetNsConfigPrimitiveValuesOutput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/GetNsConfigPrimitiveValuesOutputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/NsInstanceConfigParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/NsInstanceConfigParamsCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/NsOperationalStatus.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/NsrService.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/Project1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/Project1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/Project2.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/Project2Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/Project3.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/Project3Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/RpcCommon.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/StartNetworkServiceInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/StartNetworkServiceInputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/StartNetworkServiceOutput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/StartNetworkServiceOutputBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/TriggerType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/Vnffgr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/VnffgrOperationalStatus.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/SshAuthorizedKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/SshAuthorizedKeyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/SshAuthorizedKeyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/User.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/UserBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/UserKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/user/SshAuthorizedKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/user/SshAuthorizedKeyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/cloud/config/user/SshAuthorizedKeyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/event/config/primitive/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/event/config/primitive/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/event/config/primitive/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/ParameterGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/ParameterGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/ParameterGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/VnfList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/VnfListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/VnfListKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/vnf/list/VnfPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/vnf/list/VnfPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/input/vnf/list/VnfPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/ParameterGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/ParameterGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/ParameterGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/VnfOutList.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/VnfOutListBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/VnfOutListKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/vnf/out/list/VnfOutPrimitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/vnf/out/list/VnfOutPrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/exec/ns/config/primitive/output/vnf/out/list/VnfOutPrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/NsParameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/NsParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/NsParameterGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/NsParameterGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/NsParameterGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/NsParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/VnfPrimitiveGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/VnfPrimitiveGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/VnfPrimitiveGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/ns/parameter/group/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/ns/parameter/group/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/ns/parameter/group/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/vnf/primitive/group/Primitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/vnf/primitive/group/PrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/vnf/primitive/group/PrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/vnf/primitive/group/primitive/Parameter.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/vnf/primitive/group/primitive/ParameterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/get/ns/config/primitive/values/output/vnf/primitive/group/primitive/ParameterKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/VnfdPlacementGroupMaps.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/VnfdPlacementGroupMapsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/VnfdPlacementGroupMapsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/NsdPlacementGroupMaps.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/NsdPlacementGroupMapsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/NsdPlacementGroupMapsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/ScalingGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/ScalingGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/ScalingGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/scaling/group/Instance.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/scaling/group/InstanceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/ns/instance/config/params/common/scaling/group/InstanceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/KeyPair.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/KeyPairBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/KeyPairKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/NsInstanceConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/NsInstanceConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/NsInstanceOpdata.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/NsInstanceOpdataBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/config/Nsr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/config/NsrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/config/NsrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/config/nsr/Nsd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/config/nsr/NsdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/Nsr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/NsrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/NsrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConfigAgentJob.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConfigAgentJobBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConfigAgentJobKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConstituentVnfrRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConstituentVnfrRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ConstituentVnfrRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/NsConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/NsConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ScalingGroupRecord.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ScalingGroupRecordBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/ScalingGroupRecordKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/Vlr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/VlrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/VlrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/ParameterGroup.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/ParameterGroupBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/ParameterGroupKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/Vnfr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/VnfrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/VnfrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/vnfr/Primitive.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/vnfr/PrimitiveBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/config/agent/job/vnfr/PrimitiveKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/monitoring/param/VnfrMonParamRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/monitoring/param/VnfrMonParamRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/monitoring/param/VnfrMonParamRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/scaling/group/record/Instance.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/scaling/group/record/InstanceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/scaling/group/record/InstanceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/vlr/VnfrConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/vlr/VnfrConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/project/ns/instance/opdata/nsr/vlr/VnfrConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/VnfdPlacementGroupMaps.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/VnfdPlacementGroupMapsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/VnfdPlacementGroupMapsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/SshAuthorizedKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/SshAuthorizedKeyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/SshAuthorizedKeyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/User.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/UserBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/UserKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/user/SshAuthorizedKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/user/SshAuthorizedKeyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/start/network/service/input/vnfd/placement/group/maps/user/SshAuthorizedKeyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/Vnffgr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/VnffgrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/VnffgrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/Classifier.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/ClassifierBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/ClassifierKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/Rsp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/RspBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/RspKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/rsp/VnfrConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/rsp/VnfrConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/rsp/VnfrConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/rsp/vnfr/connection/point/ref/ConnectionPointParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/rsp/vnfr/connection/point/ref/ConnectionPointParamsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/rsp/vnfr/connection/point/ref/ServiceFunctionForwarder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nsr/rev170208/vnffgr/vnffgr/rsp/vnfr/connection/point/ref/ServiceFunctionForwarderBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/Classifier.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/ConnectionPoints.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/FiveQi.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/NetsliceSubnet.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/Netslicefgd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/NetworkSlice.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/NetworkSliceType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/Nst.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/NstBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/NstData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/NstKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/Nsvld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/ResourceType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/Rsp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/SliceConnectionPoints.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/Snssai.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslice/subnet/InstantiationParameters.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslice/subnet/InstantiationParametersBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslicefgd/Classifier.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslicefgd/ClassifierBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslicefgd/ClassifierKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslicefgd/Rsp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslicefgd/RspBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/netslicefgd/RspKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceSubnet.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceSubnetBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceSubnetKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceVldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetsliceVldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/Netslicefgd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetslicefgdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/NetslicefgdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/QualityOfService.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/QualityOfServiceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/SNSSAIIdentifier.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/network/slice/SNSSAIIdentifierBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/nsvld/NssConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/nsvld/NssConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/nsvld/NssConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/rsp/NsdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/rsp/NsdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/rsp/NsdConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/slice/connection/points/Connection.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/slice/connection/points/connection/NetsliceVldRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/slice/connection/points/connection/NetsliceVldRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/slice/connection/points/connection/NsdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/nst/rev180820/slice/connection/points/connection/NsdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/osm/project/rev150910/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/osm/project/rev150910/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/osm/project/rev150910/OsmProjectData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/osm/project/rev150910/Project.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/osm/project/rev150910/ProjectBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/osm/project/rev150910/ProjectKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsdConstituentVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsdDescriptor.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsdMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsdPlacementGroups.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsdVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsdVnfDependency.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsrNsdConstituentVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsrNsdMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsrNsdPlacementGroups.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsrNsdVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/NsrNsdVnfDependency.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/Project1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/Project1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/constituent/vnfd/ConstituentVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/constituent/vnfd/ConstituentVnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/constituent/vnfd/ConstituentVnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/monitoring/param/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/monitoring/param/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/monitoring/param/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/monitoring/param/monitoring/param/VnfdMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/monitoring/param/monitoring/param/VnfdMonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/monitoring/param/monitoring/param/VnfdMonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/placement/groups/PlacementGroups.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/placement/groups/PlacementGroupsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/placement/groups/PlacementGroupsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/placement/groups/placement/groups/MemberVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/placement/groups/placement/groups/MemberVnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/placement/groups/placement/groups/MemberVnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vld/Vld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vld/VldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vld/VldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vld/vld/VnfdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vld/vld/VnfdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vld/vld/VnfdConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vnf/dependency/VnfDependency.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vnf/dependency/VnfDependencyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsd/vnf/dependency/VnfDependencyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/constituent/vnfd/ConstituentVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/constituent/vnfd/ConstituentVnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/constituent/vnfd/ConstituentVnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/monitoring/param/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/monitoring/param/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/monitoring/param/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/monitoring/param/monitoring/param/VnfdMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/monitoring/param/monitoring/param/VnfdMonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/monitoring/param/monitoring/param/VnfdMonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/placement/groups/PlacementGroups.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/placement/groups/PlacementGroupsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/placement/groups/PlacementGroupsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/placement/groups/placement/groups/MemberVnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/placement/groups/placement/groups/MemberVnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/placement/groups/placement/groups/MemberVnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vld/Vld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vld/VldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vld/VldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vld/vld/VnfdConnectionPointRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vld/vld/VnfdConnectionPointRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vld/vld/VnfdConnectionPointRefKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vnf/dependency/VnfDependency.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vnf/dependency/VnfDependencyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/nsr/nsd/vnf/dependency/VnfDependencyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/project/NsdCatalog.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/project/NsdCatalogBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/project/nsd/catalog/Nsd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/project/nsd/catalog/NsdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/nsd/rev170228/project/nsd/catalog/NsdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/Project1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/Project1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/project/VnfdCatalog.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/project/VnfdCatalogBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/project/vnfd/catalog/Vnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/project/vnfd/catalog/VnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/project/vnfd/rev170228/project/vnfd/catalog/VnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/Project1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/Project1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/project/VlrCatalog.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/project/VlrCatalogBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/project/vlr/catalog/Vlr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/project/vlr/catalog/VlrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vlr/rev170208/project/vlr/catalog/VlrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/CommonConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/InterfaceType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/VirtualInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/VnfOperationalStatus.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/VnfdDescriptor.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/virtual/_interface/VirtualInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/virtual/_interface/VirtualInterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/ConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/ConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/ConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/InternalVld.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/InternalVldBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/InternalVldKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/K8sCluster.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/K8sClusterBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/Kdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/KduBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/KduKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/MgmtInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/MgmtInterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/PlacementGroups.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/PlacementGroupsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/PlacementGroupsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/ScalingGroupDescriptor.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/ScalingGroupDescriptorBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/ScalingGroupDescriptorKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/Vdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/VduBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/VduDependency.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/VduDependencyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/VduDependencyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/VduKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/VnfConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/VnfConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/InitParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/InternalConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/InternalConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/InternalConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/init/params/VimNetworkProfile.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/init/params/VimNetworkProfileBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/init/params/VimNetworkRef.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/internal/vld/init/params/VimNetworkRefBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/k8s/cluster/Nets.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/k8s/cluster/NetsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/k8s/cluster/NetsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/KduConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/KduConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/KduModel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/Service.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/ServiceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/ServiceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/kdu/model/HelmChart.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/kdu/model/HelmChartBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/kdu/model/JujuBundle.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/kdu/kdu/model/JujuBundleBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/DashboardParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/DashboardParamsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/EndpointType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/endpoint/type/Cp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/endpoint/type/CpBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/endpoint/type/Ip.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/endpoint/type/IpBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/endpoint/type/VduId.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/mgmt/_interface/endpoint/type/VduIdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/JsonQueryParams.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/JsonQueryParamsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/MonitoringType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/VduMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/VduMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/VduMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/VduMonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/VnfMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/VnfMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/vdu/metric/VduMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/vdu/metric/VduMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/vdu/monitoring/param/VduMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/vdu/monitoring/param/VduMonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/vnf/metric/VnfMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/monitoring/param/monitoring/type/vnf/metric/VnfMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/placement/groups/MemberVdus.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/placement/groups/MemberVdusBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/placement/groups/MemberVdusKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/ScalingConfigAction.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/ScalingConfigActionBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/ScalingConfigActionKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/ScalingPolicy.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/ScalingPolicyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/ScalingPolicyKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/Vdu.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/VduBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/VduKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/scaling/policy/ScalingCriteria.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/scaling/policy/ScalingCriteriaBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/scaling/group/descriptor/scaling/policy/ScalingCriteriaKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/Alarm.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/AlarmBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/AlarmKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/AlternativeImages.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/AlternativeImagesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/AlternativeImagesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/CloudInitInput.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/Interface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/InterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/InterfaceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/InternalConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/InternalConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/InternalConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/VduConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/VduConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/Volumes.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/VolumesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/VolumesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/_interface/ConnectionPointType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/_interface/connection/point/type/External.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/_interface/connection/point/type/ExternalBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/_interface/connection/point/type/Internal.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/_interface/connection/point/type/InternalBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/cloud/init/input/Filename.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/cloud/init/input/FilenameBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/cloud/init/input/Inline.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/base/rev170228/vnfd/descriptor/vdu/cloud/init/input/InlineBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/VnfdCatalog.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/VnfdCatalogBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/VnfdData.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/vnfd/catalog/Vnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/vnfd/catalog/VnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfd/rev170228/vnfd/catalog/VnfdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/Project1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/Project1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/project/VnffgdCatalog.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/project/VnffgdCatalogBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/project/vnffgd/catalog/Vnffgd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/project/vnffgd/catalog/VnffgdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnffgd/rev170208/project/vnffgd/catalog/VnffgdKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/AssociatedVirtualCps.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/PlacementGroupInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/Project1.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/Project1Builder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/VduOperationalStatus.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/VirtualInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/VnfOperationalStatus.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/associated/virtual/cps/VirtualCps.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/associated/virtual/cps/VirtualCpsBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/associated/virtual/cps/VirtualCpsKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/placement/group/info/PlacementGroupsInfo.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/placement/group/info/PlacementGroupsInfoBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/placement/group/info/PlacementGroupsInfoKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/VnfrCatalog.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/VnfrCatalogBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/Vnfr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/VnfrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/VnfrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/CloudConfig.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/CloudConfigBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/ConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/ConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/ConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/InternalVlr.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/InternalVlrBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/InternalVlrKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/MgmtInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/MgmtInterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/Vdur.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/VdurBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/VdurKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/VnfConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/VnfConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/Vnfd.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/VnfdBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/mgmt/_interface/SshKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/mgmt/_interface/SshKeyBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/MonitoringType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/VduMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/VduMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/VduMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/VduMonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/VnfMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/VnfMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/vdu/metric/VduMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/vdu/metric/VduMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/vdu/monitoring/param/VduMonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/vdu/monitoring/param/VduMonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/vnf/metric/VnfMetric.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/monitoring/param/monitoring/type/vnf/metric/VnfMetricBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/Interface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/InterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/InterfaceKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/InternalConnectionPoint.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/InternalConnectionPointBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/InternalConnectionPointKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/MonitoringParam.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/MonitoringParamBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/MonitoringParamKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/VduConfiguration.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/VduConfigurationBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/Volumes.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/VolumesBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/VolumesKey.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/_interface/ConnectionPointType.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/_interface/connection/point/type/External.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/_interface/connection/point/type/ExternalBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/_interface/connection/point/type/Internal.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/_interface/connection/point/type/InternalBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/virtual/_interface/VirtualInterface.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/virtual/_interface/VirtualInterfaceBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/AsNumber.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/DomainName.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Dscp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Host.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddress.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZone.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefix.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpVersion.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Ipv4Address.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Ipv4AddressNoZone.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Ipv4Prefix.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Ipv6Address.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Ipv6AddressNoZone.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Ipv6FlowLabel.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Ipv6Prefix.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/PortNumber.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/Uri.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/$YangModelBindingProvider.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/$YangModuleInfoImpl.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Counter32.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Counter64.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/DateAndTime.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/DottedQuad.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Gauge32.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Gauge64.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/HexString.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/MacAddress.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/ObjectIdentifier.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/ObjectIdentifier128.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/PhysAddress.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Timestamp.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Timeticks.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Uuid.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/Xpath10.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/YangIdentifier.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/ZeroBasedCounter32.java create mode 100644 src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev130715/ZeroBasedCounter64.java create mode 100644 src/main/resources/log4j.properties create mode 100644 src/main/resources/logback.xml create mode 100644 src/main/resources/osm5.properties.xml create mode 100644 src/main/yang/augments/additional-info.yang create mode 100644 src/main/yang/augments/alarm.yang create mode 100644 src/main/yang/augments/alternative-images.yang create mode 100644 src/main/yang/augments/cloud-init.yang create mode 100644 src/main/yang/augments/common-augments.yang create mode 100644 src/main/yang/augments/day1-2.yang create mode 100644 src/main/yang/augments/epa.yang create mode 100644 src/main/yang/augments/etsi-nfv-common.yang create mode 100644 src/main/yang/augments/etsi-nfv-descriptors.yang create mode 100644 src/main/yang/augments/etsi-nfv-ns.yang create mode 100644 src/main/yang/augments/etsi-nfv-nsd.yang create mode 100644 src/main/yang/augments/etsi-nfv-pnf.yang create mode 100644 src/main/yang/augments/etsi-nfv-pnfd.yang create mode 100644 src/main/yang/augments/etsi-nfv-vnf.yang create mode 100644 src/main/yang/augments/etsi-nfv-vnfd.yang create mode 100644 src/main/yang/augments/interface.yang create mode 100644 src/main/yang/augments/ip-profiles.yang create mode 100644 src/main/yang/augments/kdu.yang create mode 100644 src/main/yang/augments/mgmt-interface.yang create mode 100644 src/main/yang/augments/ns-configuration.yang create mode 100644 src/main/yang/augments/ns-various.yang create mode 100644 src/main/yang/augments/ns-vld.yang create mode 100644 src/main/yang/augments/scaling.yang create mode 100644 src/main/yang/augments/various.yang create mode 100644 src/main/yang/augments/vip.yang create mode 100644 src/main/yang/ietf-inet-types.yang create mode 100644 src/main/yang/ietf-yang-types.yang create mode 100644 src/main/yang/instantiation-parameters.yang create mode 100644 src/main/yang/mano-types.yang create mode 100644 src/main/yang/netslice-instantiation-parameters.yang create mode 100644 src/main/yang/nsd-base.yang create mode 100644 src/main/yang/nsd.yang create mode 100644 src/main/yang/nsi.yang create mode 100644 src/main/yang/nsr.yang create mode 100644 src/main/yang/nst.yang create mode 100644 src/main/yang/osm-project.yang create mode 100644 src/main/yang/project-nsd.yang create mode 100644 src/main/yang/project-vnfd.yang create mode 100644 src/main/yang/vlr.yang create mode 100644 src/main/yang/vnfd-base.yang create mode 100644 src/main/yang/vnfd.yang create mode 100644 src/main/yang/vnffgd.yang create mode 100644 src/main/yang/vnfr.yang create mode 100644 src/test/resources/readme.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5daa7fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/target/ +/bin/ +/target-ide/ +/.project +/.classpath +/.settings + diff --git a/README.md b/README.md index c6d3f3e..c33123d 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,3 @@ # org.etsi.osl.sol005nbi.osm10 - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://labs.etsi.org/rep/osl/code/org.etsi.osl.sol005nbi.osm10.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://labs.etsi.org/rep/osl/code/org.etsi.osl.sol005nbi.osm10/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +OSM TEN NBI implementation diff --git a/hackfest_multivdu_vnf.tar b/hackfest_multivdu_vnf.tar new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d GIT binary patch literal 27816 zcmd>Gg;pI+v&A8}yE}m(f#B}$1PM;C;O_43?(XisR@ICBd%pV^cM&9T&P;d7u3ge& zL}M~CbXHxTDwUguhAQS@e@sU(6|>p&?A4)0)6pIEpCS2f8g_zuNdE(X^I~_=mqaO zq_fCK+Tu-mZV4*o9$KV#o`|cm;qf@?ZIk5@9x3G!S`j|@IU`$K4O{HX5OWKT*6>X_AgtS@I|Tc%s97|Go7x zI!cmXI=BZf{_@~Y=fotw{8~$J~nE|HLO|#M5(ZHqAT4 z(TpFoyv;MJwR9U#3xDX8M`@0haG^R`K9HmVI>7ICxtG=z_?CwZYx$n$U@RL7!UEBI$eK@ZOtnUP}GU0n*e$Up$7!5iC5+M--^#htF%7~<_pHq-?W~h&+>>|x`HVhkhS$sJf>$%JonhXfc{lZda4}iF zHI}7!Pni(@Xi^lRO+Icb!lqB_JANuU@-+9hSkgwQi4vdlt~E_IC6%XmNa+;QE-dee z?r1ZSw`m$0|4g7qb#+>*gbA$BHZRA=^D~`OFHOUEr#<-CD!-Oyy?t8fT%|}#1>W%F zK~KpEv`lvizj%>`EqKaC))n@8o6F{Rj-})utFy=%$wtJ+}(`23}{NR|s!KKzQ(T z8lzEuYt#4luYxQ;c?|2`5#tdJ+BN4V>}ZxJyA<1a--JKwBzWBc=5gutN0IN_glo*o zchHh~1ijL;IL(^#1av>c``}pmFQZo#@mqwKNF_UhaxhE2T8RtH;9PS2seeo2H z$F=GDQ9rF|(v^)UP3xOT^O@2&npLK5yBPT0sTJTkjUVG(ze61T1b6!np-%Dhg`OMF z_!i@moAmmPMp~+Z&<=1paWgi5d zIo|RpqcK;+0AVMix^&)VAWk!>d~5_nx~BamzO2>+vOe-*d1N3D(7H<^7XA*8_;jT; zSFI}ArYXeEC1BY;ulfV4dQ{8lNFVWi15yWw9)wr`%Em%<=oXs4g#~o;WE>&Lt?)7y z|5n3$H2fnfQmfL&fZhsu)AOMW~utuCY;_+}@UMztZd?w4mNtS7#!dV?y7EY6ZwFMh2dPGO~V#CkQULN>q z214$Ji>aRQI|e#1Napp|_@{WSEZ95jRtALmBa~hqd(}^c%ZwDVz! zYji_{8JYfw)h7tlZw~Ts&HWT;`3l;SoCoktU>+vY= zz2ZSH!GKZ$4-WnU!lvB$na{O(LKYCc10f#RX!B+}jXTliAG-Rk57_tsH0r`9=CGb! z80IV=)zWB69kjg@4KN<$H#3)dZ12V#Bw(Ju^x_lnQqUW|ROTJs9Nw@om5PAkzNCWX z<-vOo6lj3Yl3N6DFM$p8sM+(bBDC`;Toh3WdwH&rN=N{F&hZVc)LLV$^Uk>HAZ^uQ z17F_)rSx2Rt}I=LM`R)*p^7g+<)JvFy#Xm*>R@3fwCY5wikYpTBiFQD|6A6z#@C0Q zHE{Vo#dP|Vjq&9LsCb<3@d4n{iQv9iQ0!)U&ZV<|+@~fd8&8KY)M*`)I5&9a0?mK` z>F~O$Q7!k|(yr)V1zIlVdodqgD}w>;02NkvzN#5f=K!=>jr!C7kS!t)TC|R4-(-sGZEfO6<4PXDUiBt*!jD% zy(UfYWCoOWCJ(CeKxa{!Jf1~JdL(%$o2Oc7uz_xa6!=Lj%}%of?vf)FZ#VL(Ip2w0`4H54ngVpLG7))*$J-DiXL`8ZyF7mO!>%MI-`E=tEP@KoTq6RCG+|3y5?HHowg$ zjpEq%AU?V?fRuy0Py6O2mH#B1e0i$E+wYgJA;RINmmI_(d`tu3Hx&Z`zkNI=kn0Ve zQxFoVCHVSVJKtngxa!ffm^{C0iGp@Q2HYcxIKCiOL?6FP_!wYx1BAN|qW27hm@&Gq zuLpu33v?H(W{Qt15<%Q{0SSVD2Y|uL?zF|-McB`WB`uXz@^pQZE6=;pO_h-+bl>fu z+8`MMK)FwA;8hw6m-Mltbz@ChQ{XQIE~79Rxnh{q1n-Dw!+Wvn>L}hs+y;X3rkS$C zuNF|_DNTC;-0o>0L{^*j^O123S%v%fK%9f&H0?ygu+L4zj0fJU(o6gq#r@#9^yyMU zFBwvxcqcTH?Z&r}O1k#6j)ZrbwtRovmsGXzR(2{ByoEhor0`@O!0a4iU*oSoyyHiM z%7JuK?roQaz`2XPAM#*1P5AS@3-yQ6l_~&xk`JPS%&6N;9jjlV$3JxL&U>x^kx@Iy zY?t~4K^GxhYncL_7HL-+su_@jir2d|dDXX5OM-7p=+Qb4)Nh-mVr(+lKyccuS0*G)x-dE0?tMlNUi-W?-os z$xR?OSQ*dLc>|sQQUYxN5bMyegfB10Xa-ZSPPsL`Wr=HsghTC*xKD3AuSUa51`wIL z&9Inm$oy0+I7vO%4NlsvBEvn1^*cP2hAj>K{^63Glf%m$%~g=p2XeqqUityk8-)v; zmgAE1u%l%#jIBEE&H&}PrXE!qfur=L(Y!HVy777{^(!Mn+|y}WGbqSY$8Riig+5AP z(SRT$DZGBS04o{L&kf>JdMeEd;a-vI;J^|%(}zlRVW%+<{=kYac*ByfgTbC2Y28=K zP}U-Zkd_undhufn9j2Sploa^jGcP-Wc&^fV6(sNCMz66HwzQZO0ZA&>p|pK>C+*fxN6Q)g0cyM{$OK@@O=IpTBw2+ppia z@4O(>G;1qf2XVaRmv){`$(9V_ix`>T6%w?T9S6Ia)>4%M_kOa4T-SM3ULTvChcw=^ zjb#LrS>ir%f!A~?WFSP&Qg=O12Gv&3Km<@=q)lF49~GuMD}@+9$T{SVGJ_A@|Dqua z8ZY!pqX}BDR{z0IL7?OBe^deuVe>=07Zle~!ON0R+GR1V7M2@F%p+W7zXl|0r7pn69S4q5alWydzMfo)l7`AK!7<;LvRcmZ#24QZ%mxeSzTt;aWCcG2I z{eke6B{%A;uC*<@ie8k(A(_x@r^`+;kK973Gt|Y;)RGbf#q!YkCq9g9p#b z(rX#7#Tzy7t|ae!)10QZFa9%M00dl%uqbno?gHYU^NA%aND$#79lHBcUk7gmB{b5M zN`4q!Y14)yxY(i)=7c!*)!+>TT7c`nc+)fW7P@Kku{m$Z<V(y=UG6+4yCL7qFv-2r`c!LzrJ$@5Gr-J&GcM#r%5 zQ5qKoZ#gNbgmSJVY{X1qGMf$}b-341E}xVHl<}k-FN?+HYZdU8E=*##?mG?Vn9_L+ zB=L^eL+hRRen2lZx-?W+hqA;64VqDZnj+kA*VyU5VD##V^=~0tz2nW;Sj4nNX$z!* zB>|<7{4|*P?$2;O$mChnRi=SS{NVG=P+#4d?~SqSw`|2O1c(t_d0w2?{P;zrUDLtJ zwA8=KU7QcXJE5laTA&Gvq@roq*Or$*_Z#z+pFZ~U#QSEn)GlklZ=G^k(p@x#waf$d zr$9U&m1~k!oB|yL<&PtL&(`ARSBNxy{E!8=oIqk>h~WNONBfSn+D6;Cl47DTsTY*< zx?tf)@X3z~p0J_yANR@4!w&*4Ix@56ZUiZW zu4x)E&_Fy~Kt#L-?k-C>!MM}4fAUTVBK>qcy&8fyO|~oYrW`H$<9$ouXS;s92X~y} zUO8Fnp-r_ge|oG{;N`4FR|EZ0XI<(x(xpK^AksEg0ifjL(j*>h;OiXzkfU);K5kX1 z3Wfi5i-9{lOY(YAI^V}BXl2KyLV#~6;nm=xCB0O5>W$3De@U;f5z3bF>@TZLrK;fPMR@1f6vIIY9L;Y`23Iy)i z=L>Wh;GPKF@`^{I#Ik-Gx${P+IIa5er)>o;KUzeWO?)F~tO(de+kvj5`7pr)ZZMc1 z<>Ddg`HxOT?V7MpMA`l_m2WhmAkMqdkkSZE6&u0vr)d5UKl?HWB+VgmKZMbjI{cp3V&wShCtpH7y`~2eOsYs3App-~lH)o)58;hl!jiWY9H| zx(#t?_X*_H$h9j@^yYP$u}{w)H<$0q#*ID4_u*K8l5$2OZ#LJ&5A(F#9*2Mn;Gd z)GEX?M=K(l(VFxC?S5%W_|k$Kbo7FFcB2f$dgb*}KK7+|BRIpMT`&(hYy8XMcNNn* z9fjW+Z2-<~faP14NB|%I%l+0Ij9X07s5;DOKoJ0Q*M(oe`%Kg5y`3M_cp_Ab?|+$L z`7cJTMJjxg=gNIn^af$Q(|QhFThL&T?Z#Q8Zf#O-ejtgGjToS1l8 zK#)6b`vfv`!Ou!o2-%-5u+MXQ6L9WsMHm<|RQ@p0(c{Nl<5)f2xa{msnywN6YDfvP z0Z!3Tmxv#qcq(BFr)W*_wzxmgf5wFG_3{&Vy~O`dr;fKO&6e7gX)Du42+(8^A!REV z7C^)tRB2qBsYt$OzEh!I-!F;#9}Ifc@=g$5bQy75k~334UKr+g&(YgmrEE0 zj)MyBR>pFceZg7b9(&v!1Q%PNH5Jc!%!dMokaW+4{r7iN{zcr)LcoxDUKjQU z&fo`QKmh$h)AZ8=b=t0|D1?8!C-9pOJY~Xxx?B0k5V_V9 zWc-D7y;gq1mR~HWN6HH6t22;lQyP6(UbQpkom_}_k2WF2ex7ll9yuCxrC~J$x0DJw zM3ZI&p=*HE6zw>-S%yQ|v<>&4_O0jFR`9w$K2iQ<*KUL`w$;khEqw0VsN8OtrfA4F zN${stD`8cZbQ%Rzp5r5VM4m5R;ql)*ZzZRKHYd%<(GsLQVgy>w6ZvtxqWO<=tt9E`R}&2uzEbGCXN(?t}yZK=g^& zI)=cpi?CjpNh^Rvc(T7bcboa@XajQI;4Mo$FBYfi?V2cr&t(-DML#r!8-My^D>uU2 zKo9bS88;{ezHz~{4> z?YBVcbL9RCXL{2RyjCNfp93p@>8WtPzF{U@^Z~z}wKGl=^X4=Km83r`>uYvDl z>B2)QiC+DFVp-dK?na;DVP2K~z_zPwSVDI(WHL&x`DQYFkdW*kFD7^{D*t74Ur0+> z>PfT;_|kd3E}g)}Fg*d+-RDU=8nZ%}U3dI$EDFGy2`iP!f>oXdGGH5V=gcs&Ii{)} zk#-50>Oh8Bsv`R4Sj0mFO+@612e}BcEJ*sL;JX%#dIv(8R8K&w z6`Nb-aXWtZ72|s=?)8S-9{Tf8v7dNSk_Deywqifav>Rm?2c=@>r5&04qnlfEO=vuW zoA&T~m{ccCsL&Zy@}9PdCsewo5x2YNOK zZJMqG9axD9<|P9@2&HR-5FY-+6I#~%pe0eLO1s)g4vdMC9Y?T-^(NUAe)NX+m%K`U z@+qu!Mx79e?o0|{=+8!Gd9H52b4Oss z4&5uzwqlMtFlH*NE6poQg=DXnU1~7+7I;=4Ums|+6;zeI5?iMhy4SN^{ zU;l(DAH%zfc!qmY5X4Uv&EoM zOLSNW%$f=gZ3pq{F;SzT78=io4V^*TOaB>Do&-YXC@gLicKk}Ge$das4_*_`cIG7$ zbT(;PkH#ec9Y_NKPRJtfzfn(J3L=L&Kh|TL*NufV3#-szSTB z{23>><6)$Y8-E(}n1ikd?TK=)WFi!{%lrK77|6pkPyGS5mX-Y2l!C>r{-b_t>QRDr zj>Awm$S*Pi6Fs4UzctD-H2se+%*?1S5&ZIz9&I77J$en|>qG3{$d!4< zr>(t9O3vD@0yRbxI)WxnGpIKY?>o^3>-?l)-xvdaG~)q%8dc&+1e)ADg!ng*`8itl zF$?bGQ`-hq2lK47QGg3KX|0aL+vdHBplxsjTH!rs_cnWA-<_#3^#s9AZ=!iko@WA$ z0(mDHKC)Z`QH@xm!Zr&G?x~L9EvYtoL+QONuf3GE!hF0%#c8PZpE1ul*SqjXkQHCJ zDIiVXrsr0z|bneK3O8|YC#m}hFzTvTXK z5Yd%!Dl)2_Y(Dk3w-qlyQNRVxhUqSCp`OE!raTx6R<+|n=OF+xbda3kCGSb}6k5e+ zjI>9h){!2H@i!pQ8BI6*;fH?#LU87(&OeA^$fn>$Ye2|;8*_)CiVi~>Gr{(rXhhso z!L}WCv7-a5M)AMlH(YfGms-P?pXp01uqCm)z(gNNca+N`5^(tApfvhGA*7+Z;l(9^&q(fX(s^#v2;>T&vClW_hAR z%kFKcOQj~!RJMDm6nzv`LPb5ipJq{lAI^Eult$}myvrir9|Bn8S3iAKNhMlQ0haHy zpzF^2{(RyKVQlhtvsNiM+*bHc>iez5m(68hXp1SdUTp#Xb;t9_HxN6hS6;1?pNwhU zJvluInLMb>ZThaOdPu>Jg!tyh^MYCVSe*+u`DTgZGR8?r%^vvSD24OJRdmkH1J`ASI??ClF(BOA|R{K+zB!s4Y6J=GuZ~y4+ z58z{=Py+FHT+Q5u=HjuFM}MKhCvOjvnTL`e1qQzBpF>~a6>X`|=`+u{{6gk=WCS{~ zP)Hk^N{Qc`Xu(QIU;_9ZumxF6I5dhWL4EsxhyDTxvOh8m7azqNd*u;3H<06fVNKg2 z$V!Ky7#jK+Og-X;=2{Ne{U}QGgb_CIXOL}l&&-Qr9mM4tY9Q_h1fPRKwBf?|@JB0O z2hnSAej3kc;o1W}w2by3R*iA9AAs*!bGY83D-XB9p-*YpnEQWXrUcX#qp@@wL$Afw z`2CVGpE_VUi}jkmB@PHrdp-@;0Iqq*7+Mr{;|nyQ_URxH0(q(r2X2g&@MREps|H2} z7x6?2pV`1Wc6iN&PTZW+`HQE6lq#B0a+~3ya?mn*SCa{(^CEQ`ux$55d!q;T+ihB; ztw`ezg~hZ}8r7}==-PmN?a&FBMu)wmghVFdU0^j{T&QQJ+T;hLY~iSYCz zHQLFy63;}4hY_qh>EQiGa2B9%mmDf#XF2?A09oFn6NlSBA>@8(dmyXqgxT!I(J4&SE@52z_JD=Ai1VS=fe$Af78l6r2CKDos-9KgUSY8p| zSLM-zi)2@Ne1x8(Ctf!M#J_`Cd!mBTVx{i=vyc~5=pzgpZ%de@$6E5REA=2;Up`3=fw*cO#v47@KckK zhX}3K(UHGrogu&+ZDuQkv||e%FtwmlR0F~R<@f(VasN*jWOyfPHjw2eh8ockR_5*s zdU5<^!kd9$-XlDr1{2ukE9GXw)EA5kA$?S+yFMV+oFK&>_Wg?y8;psn!bQ-Wmi3aRQALB+{6!LS_jsx>+-OD}T{#{IZG^i$>ATQ`I28TvNl3%!%p#EH>rL(Si!(C*NPl;!hB+(&txs|3 z73UaV=azgx(y%24*kVzg+fgek%tXMMjRlMkDHTHuLRIR5C#Aqm`XlJtwAGBq<;rMK zk56mEvGS2X2}j5u<3-x~dg9Ws|32FQ1U3gi!)7H9Srm!E&=ld;n8dKiD-eM+`}k2q zUtiuD@<0z*=$~Bh3f&aIe#U7hJ;+G`w_S#xU8;%D826c?si4=8ZUM~ggFr0;;BIHXYE z1=f4v6bQjC!D@GE_^O=u#mpF)eS0q5nyU~BB7Mq#`8r(;vE$TNiQZdywTdUB!IHKL zLoqps%xYPNF2Wrf-Q>Vv2mNJ$OV{7kWlbTO<9q`nBVhMda&mGoGPN04*i(F+8=r#w zhVq;STzI@P8PFu;6DSZUd)7A6Jc#tRBuzm9tBAW8^+id9$7}%JsPzW9mkR^ahx8^! zhb8<{=R^DLpq&?WohBeNbD^MZ*wHXPVGN9!*dYx7IR>}*0B!@wj!{MzkB2fN=}HH( z{h-zIP%tdo5d{Korqfj%Kk-C#5?{viQ;7|n8d)d5h{9yX+h8lx*>IC#K33~ObPS;} zP0;>bR1Nlc%Z|RPdD8(2QV$K)mD7|TtaBdOZEv+6qHvG9kb9n)qeohVd-Nmo^D*`| zwc~qrXAj)SkGjDmo~*zy4h4)UN7B(PK`Yv{+T{qjZYM)=$A2KHJKEE){f=;XgqPf! z|FtMboOqSx>yrGka#;6p5MR0@pI@s2?hd+CRnlb@4>ZuK0_ab_K`T#T&_SZLH8Vzwbj=?&PY-Aqv^1XEWv@g|VlIv=W<(j&NG zXD%DjsH#B%D^8nLs>z$BJO&v_TElS0X)i&HcO+U77_akmyxq_=)&}>u06*Jz4}ixn z;Byvo?r9V-mHlI z4^Uq~aSTjr56<-pZ^0lYq21rtBF}p~D?xMLHS3b3zeV$AK&0q5G4THzMyI^4oex9o zmGgNJ(jBA0i0^z_$>ULUBLUH@rJ3{duhv|ejN@Ao+~$^tOyO`sFA`iN7a~|zGUD-8 z75gSc@BX%EdmL-fFry1M{=g`{vL2eZVgR>6BN~AmM+$?Ze^aj=jncYTdIrGwBOXS% zDPWNp7JkkvL7ht9nrT(OwO*TMGF0+R8W9uLcu9}XQW^a=1)kJ|6|QQL&?uXg3<|P^ zN$k>yVh!x>443Rz&?zY?$A32el_@(W30e9s%>gTW;Kvg*;SA}a3KE=$eE;URB7FtA z@vtB7m}zCYA#Lu#teX-FbF+TpV(r{r!uL-2?MC~z?`@a{6^=6DY)b--iVF&m0QIiakcE~r)$@t&)FZAc=Ih!}KjQJ$V!A=mzNxe0VL>FY_Q;#9- za^Ejt%^AJsCK3kY$Ei;ljcPfdkkGi^h8s)-2YI)F`M$}Rpb|zCzj>(Qr%N5+^OV-0 ziF;bc1PkttBTTd_j~EujsE@&FJ``a}8>Wa1-M|ZlvMN53(4yU1sec${Wb|lJnn1W7 zD4>fro4`=BFxzy0wz}p+uOBKGZt~gWja+?^UiLGPL3)n$M34sMphOd!0$N zcCdG)V2Y5|myAXT6f~`pWDkp*Gxvf6y~?-p!7qA^ggizNNI$;wn71U)he8uinI@X> zK18NFn9+!*t}4IjM?kFS@Q*3JG(*gM;mb^19%K9Mh$~yZyq^46_|7{fxt7>Nt3`w?My85S^;zQ0o)&8PCX%nQE??vIet{rP~lZ)Kg$fB z3P&`Zk>Pn|*y$6U262yMu5}=~hgiyKa6$@?#Zouq`teg)=O5f>9AQMrFZrZXF0TzS zZ|fT^Df6UmqBakOAe=wbD!pVHsoO%NBNjB11Hd}t0oA`hi_rPljInHUu}5%PQdLzo z7K%;o)NPM%5YaKpl8@*e*cx>~qziz!Qyx=>KkpjhkXejkXmJ(KMB;2vY)}&|lplCSjXwA+6l=cb?MgkEX)$#7M#D~Y1wN3F?Ud+9OWJPcad80qc|?e9U5R?( zFcaq2kx{L-*}Gx|D{#~ebbWzbk04Le$%t52CGGH|yCmw@rkgsSM1F6C6oI~jbP-@c zJ9Tsz@6tsdEto9nhLP<6{~m)J!79E)aV&zbwAy$B*{ymiEj8J;=X=^&@=}m`2TdAC z=?8qr0%mEX5mWL%e*EBlL!4%51glzw-OtuI!5TiCV_?t|kobNR_eJ>y`2_^hTuLJ# zVFLl=g)zI(49YyD1Y3PUacrl6rxfYj6P_}H;Sw52<1a5Q{PBj?N)y2!Cs05V4K4?L z!ps?Jbi5W5$d})Y>ClO9QuU*B%Zr5cX&dl(qe8tIaG?hzAJ_CITBr6KWc^FY49K=Z z4^BdYQ!P^Jipm69kK*+1Lra9ojjdvJq*Q2h#qn%=G555gc_B#$g`TD~XOhXg%Bi$i zW{hgX9)AV#u8E{`6X?Mx52;YMI~=|r;4}i~-SQ^J$S?SOxdTnIj%vTFPgjw6K@R=am>DGlZ2q(2Ys}J^8h$2nQ-=VJZi< zzj=(7E3nN+>IHy|;t11juIL$4 zQZzurL9`Oxm;YPO6LMr&v#YF=&O*gkh+aWTlHst)^|9yN?20JMz9c?SmIg>dT?=l>xOrxzKT9 z4#r6;eo4rgL7!tZoDY%i0e~)LO5wmrrk&w3GdVmXEzD~#@~f5%rlNlUqA_7onOBB$;oAe9fUrG(-$A}txIxL{=23~7~DP9)wu6bE00?#=;8occf9m?vdNH!91}3T=YsIIMteojKT4ndc|h_1=)D)DH|i+#2e{W=2u}x98b$c@n;%B?jcX7W=a*%okZ|Ao^gk1 zUxvX5Zi;Et+Y2*(%isZXdimQh!bd0{=j` zCHg&LIQ)it7XTaRt1NZP1NvuC!)`DETOG%Va!vW)ooNu?AolbC zkij1FWL&KXbkE=fmo-WDn{y;DH}-nFkys z=a*8RRupD6Pl2dU-n48H=c5auKGGYmG5)8CKgFB9_$Gp;<>);k0?~dBna2QXy2~kE zeC%EW6CBhqZ7RXIgfR^})1+N-1aHTO^ZPgG^bBjb3;?_7Glpk^C?Favqp}9Pd(spR z6n_-r94V}D0kLzXF%y1w8UPV5#qm2PErNAvHHU|~Xirr&RJ6X6deA+jiNC2yD5TjN zij@GP=Jd4x#)!aF=B0s)dzGL>0HvumJ{*A1cZe{P`u>)5tCbEXACR?*#nBI)5I${^7mMT> zP1>*a)oL;hq#0EeE%AWP?6gWO=$JbKp$H4i&p&w}t?nn6={+W>1S z(8+lv-}nJ+A7V7Jc-j>~s|Sv~Mw2df1n62VMiU>j@C#bQ^8o;PtJp<1)`!F!pU1Qy z&zB+z{H{bpKH@1psquIX1}F9GdAkvBy-K2!A~@YTTmfEb{t#d2xMQ$SIh2+ZI%q&K zNT2)caq>RR4uFo~IE0-IbF{+-@Gt>*!X)tM4HkHTq~;7by2783)7o!nY&ch#E<5F0 zQ-LG#tSIbymHXWa(qkH3X-*r(n&?s?oVB2fYYDJNKWGe$eHxi7zi{iGywZ+_p;TL`0!l*fKH1lxDPnvUd6Z(Ea zCQmz=0G)M2<5?{l*3UP0adYFou)@MJoJYb*jt3~^UDmS`Sal3UUmy&l!vXq>>OD%_ z(K_wcDN~}|Dn9nN!%Qg+s$i${UZ}GO{jHm#4AEwuZKk)33MZP*l%@-J6}oFdx#Sc_ z#`sD*%_7QJ4w!)nfBs`6z$QV8`PT^y~l= zx#a^M>q=;9f;Nt8s^BPSCSAer4*52Z*2DPC;I9O2#ANYy0Wf9{#2XXkxjdMa)W#Ea zrl3&IfKZw+P|^67WXVI&^lDBs2G;?gGxQWp-PPZCM+TO%9aLS)J#nU5fhd36fo1gP zBotTwmrE%-rD*5#lL&OV_*<&~`Ku;1cj+(45$xZnWO0M4ZaUe;A~Ggk7u?b7ntuffMK0En(~E89BKpolFe|* zORz)qIxMAZ2vy??3;}6Ep>Lrb2vB25X^_HtUWg*i!w(PnHJE#USweqEs@FwA`QEQm zU@nw@FnLIYtCT`&9rq)$~is4y+&fz~!m?~0Jj(`6fw;{vaF zM_9u%HqP|w5>=i58{R{>SO!%%;!PSt?eJR@!oi?$CJOW?Ef7;aj^Q{8greLct?B)P z@o%G%Hvyj*;HO+9al+BdVP4Gm@t057Z%j0BvtgPzubrrU8gPYk){wCfsW#1s^-Y z!FImX2@mz)Gu2FMfSNkO`tIAcxVP#!9#o_W9c=KvRe((?ak$Ksk-mDfOatiJK5`oAsrG+Z||PqA`_@lX*ImpJh_hvcPRWXrrV< z4Houp2t91^Y9LRQ@=OfE$O0f~lJC>q^^;*NN3i%XBSc*x9mFwyEPjC>OHC>|@$ZO^H2)37ep$EfV zqAxzHkIR6>)_!3)qdbv%wPDV;x~7$O?y%%x6{RLRl);szy?IDJ+MfpsFwrF(Ry>O5 z#SYEHj-q@ztd{)-)xsnK^u(myU`$s~;sG5O(VHQ*x6dQhd{zgp`Gk&2hb-?vs7A0c zhz?qrjdk?@i_sA}K(~x1t9e-JuMjWzwoH$woOrI2_W|YibZwl*Hx^jz4lX}x3J5wg z3W77uN_$Z6Ut|;~`gIv}@4~CKl6tzZ-^MthceN&ynduI}p3|FbnNl=zv;~^8wh2U# z?e6q6vZ@E17eCprx`W;q>U>~Q;#w~2`$)iaP*v@|5n!vK5>m0 z+^vA-vO65~mc}|`0nr;E3`Z8+pF~GAVq@!$M>?(K!S1>xLAbE?4SC@0e`glD=$Q|* zL~HrgP1#1@B?wsXNvopxB19z=7_mj1cGKX)b{?{aL_dLHW8MT_LzwRu<6bKRkk1+J z1FB7{(hK~`#T&ZN4Gt3;LPwIw|A9c^u=S=N>M!9+RdI z3qG@mcFn+H2}e0ll1WT^^SWjz=>8&}l922R3C*fobmIRHpg4zgl!%CkW5|O+)LWrj zXT>MEc3mL-$69n6XG(kdHD&aPX)wU$D}AA&xQLPt)-*0A8k7bd?jmH&@=7M4@X`@e zO@u>LPqCr_xWteg(tw2=9;+;?k^|GYg|wb{y0{tB6}+DiYz)AIxEUkX!Enk+$Vq4! zqP(Sv?gf&0KIj6P@A5#DUO13y^M@U1))YaUzXE{cgU95Ngb(ngv>`OK zqU#U{Nq*Lb(`>sWKjD!x`sgy$e+v~Z?n(FBkRDp9F`ymKl@Qr7zbY!yr8nP#r?*!@ z;g=ckL&0LEalDr1t-ypQG4PAk_9isNgE|dk-y1k1FbMN`fCrv+3E_A3J3Z3{255W~ zcq@!16V-G)+xgTwvBJ(75P1ny7|hhSLsXonlO&76!a^s&%S8o-WKfnkb|m2t+oTul z#=t*yU}w`bYEDa9_~}{1&fXra zb~?hXao~0tH@z`W^DvWf_2NrMlaf*yJkQM&0d~(q+|t~%9(#Gf9fz^owVX_d=Cc3_ z#&Jo(G=_rcMJ>XH_hj(rHy+^8Mz_XtH&kdz5Q#AH-Cc;R{GRXKG>~QXi_?UW2Oeqz z+T0Un)`e1r4@5N$zhBa5pamseWl^540O(C%=NKOmhSw)sC7|Cy#DOh!pm{Gprz-1v zHOfOyLedQzJ>gU8)($hU=I#7UnDilSadwC#b+T23<{q;JYhBYkO`M~VwH@dXqqi}R@v6Ne_N@e93 z0QEa>IP;}3qUJI{=jA7?<;qut@6u^XjlTZUa?B9gnXH=?JD3ccp?d2aka%H8sW3h$b`R6AP`SA5_}Sf(O)?XC-AFocyoX<`na>SlnQveD#dX` z9P$oM=BFs@Y}g@&R$ozmd2Z(AW}%pLECsD?*x>LoUDaU}9dz&lCU%MyZXj_x0L}WO z_a89om3WMQ#?oA*D{y#~=Y?kRt~d|{Bt`G9auCvP?p1IGJ?;hyd=%#@b}88KTa7XI z=@6bFcL;K^$d3~ITGNC&%sT80;V=s^<+TxoV>?>^WzW}I$fvI|+p*7O+SG(XAJmhv zg*QaT`*6k+2$q4_v#`>6n_zy33IYLx(s}nEzFZfUK;#)H zdv5)UzAV9oCXsOsVQ!C(yYP&eOZdqFWIXWW2hDY1P?XQGy#voW;h`WKIMzYKt-K#n zZ)(K72FiBQN(TJ;2b^%9myPles#j9|U z`#2nY=7v`FJDg}!6`XC@&5B=QOTBQ_4KS<=n#T%p8&6hejYB=s<4w1{KipBy~3wq72XjVNd^QY?eXwFp?H|#Hot+tN4y4L|kwdN7o2Z z;Ia*e6h1LUrOemXN>K1MjB%JIQ|VgG?ynBt zNBKmnE+9=B{RrOqA){h}h=qs$cq5jbrP7QStq0pEaKDqh(l^r|{#mrApxwzIf$4l8 z2b>uBlO|SZS}h}uKv(Sp37mY#(Q;9mD1)#rc{$P}h!*Kt){?g*Pzv$E$?hv02dmbi z*;IG|dIw4Mv{M-g#&{)74?@2g2a}qm_$!+aN@DP+ls|l}5dc%%>ZFgd3>CK@cCvJ) zZh;dJ7}eGbOM;2b!|uNXWZnFYB~2-$DJH;im$?UVRA?I>%c&NL6PrBfZcurcCO zV}1~WfqC#r4qs$RC;ur_$6K%XpioIw<{NBg{^vjLF~z!m{HF5^NvnVGoYOYOlOE1s zeb0y)U`tE$!0u6SI$Y{P zG^d2eo9Qsh9>zgKCDL%k!{VYMk1pPkazzNn*uQ5Zed1Xhx4imWGN8p*yD*|41`||8 z>Z%s7%nSZd)obje?vPR|>PdI{k%1#bSmH+{7Tv8O&Sxfgh=Q3J)_9#_4W~s_1Xms6 z6J1*sD_PJq7Y_i?Y`V8*QH3vG|HMs4HT*l;X#Fqs24JB$(1qa`r}|jTvntC%d{YVv zWkULWM{g!T#4UMxH<1iX$wAWjN{71Tknt<9k#5S;C1l|TNQ8J&+>dtJj72TVas4k| z@G3?C+R3DWOv>vDAHJuSRQM{`Wj_cp!kqqZXX$rL_asn5{Zboh6 zG=9`$v9Hzod}baEo12j5iOiBZx(GAFipN}WQ6aVa08(Jq>yHVYNh%;DZn;sfLKy=6 zI`?!6RibGDO5nXC4z#ULgTc9eG!hTMf8eVG+W+lKAGx$&gXb6=VX#k8N0lesWU?IW zBw^&J*#jPrIyHD4Ub0Vp*ydy);{KV3JeWV8^!iOMPYJ++8J`wUA1DqrSil^fffNP? zfTvgP(L%iussp{dq0mKbeZ<^e22B}b+2(NlWvw`^_$rNs%e<;d6HgN9V%r5FK#z+ zG-^hzk5?QE$}PE|RD#m=_uUQ6S&r0}J0QUPsiJ%A{5$(0E#<;q7wped_7F-BsblGO zKcfR|I$S2=4Lhd&uK>%{3WrLQu9g7D_45Ys$g$DL|6kT`{j@MZjdeII)8(mMzR!9mpcLkOxl#KHav{l|(y!ZDZLLHx@JB5F^xk1gljX@vuV zCuEdlf59U3`Q3z?4C0D(r+8y221^0_O2+MKt#u|Rx-Q>?^p_tZ+oMdLm1@Rg+|tjd zWo4Ifs$srF$sg)ZKg{v!0V`k7dJ^_ZkmBPZZQ8@2H?Cocy^b0VLt=)$r!JmLZ^j+# zh^BghJEDw}OQ>Pf9gn5P%O*CJ4X}UTxEtDUFZB;}0A!naf|CAW=Wyd4XQcXt&c6UJ zr+EICCy3K0=}gnHZPM&&7b0J5cmsRrEIpE{^OV(VlcO}`g*;5v;Sxtgw9nJRgioH3 z{||Szp`C|43F3Z`VYA;Qv&=k?DtJ^bwIq5F;1=xvN3eDrkR$z#WYg{%$A`wOwd<-< zCx0&FQt^co7=^kl{@9p$tim6%k$z6TBvj~6m$%kJic0CS-(O^msp^rH(j+=2nX-yX zr%;yU|Lj0yDKIw!EdR+$%MX+qM-#qOoeaT#yzX#6xDmfOr*`f1ak)$pb6lua|BENe zyn+PzoFan-AW9#{QTwk;G4Qy+@t?EGf`wA8F0`p!*F|4c`+a5{h&D+nsx}+rnm%h= ze2_zIF&FgJ6j5Z$HX&PD?Ps+9j{k>Dk?jQwyQv0tKZ#iO+CI?Xh;!O@JMs+@^o#C` zm0OwFuNl91!Sk(0cq}iOfb5OO2D={A!E-UF(I~gv2ho@eq;uVs-?Rf)HEeh-%ItXY zIX*(!fmb?db%Fgu6wkQqK+@+O6CE!RF|T79)&cC`2pCBgM}{p; ztGw-6mmig4bxjt7o%vr4Qoq+l$4}^ZlIbwZ=@uh*GWrti8G&r~%KvNwrTIT;da1PI ze>-Y@=h!vJH&!f>X)0Y1bRti)@zNQi6A3z0ndh6Klxq$Ar%t1@!#OF^`qYu3Mo)3( z$1{VpH%=C*(xQmd>ygykTzwpNOB>Dwl=045nGBJJOIWob2ZoxvmnEk07UN3SOQ0QTvkuaKN|a(yn*A*vBfNi5m;s~c{XHX6ZrB6c zBmc>#FtgT}cYy@;&vZ5A1}1O(q=)vTzUDBR>1XsYdj*<{{arx_<2ncZD~fIw$-oVn z02!Fp%=3S;^*UKk)Cn_->(q9?Y%-K_u&~eDolx*4h>!G~yljWk8`sbgi8L?0bJI^} zkm5~@%!W>sv5Rl~YNY4vsi!a_oVX*zWB{3Lb7qu@kw+hLrd9lzm#ryRHi8Ot#u;gu z4(8g|gM;N~wpXduZk!_c9lc6KiwWTwWiJ#^M=&Q;MxNfjj{RNdwx$vP{}}~+RT(lN9Vev<(zxbk82~P>!igmS&1yWXU`yx6+zOz6_klYn|hh%b~I+{m-(bDyewyVQn&^U$cC;39H64*WO9v{X$zBW~4RHGa)@d){d5B z`AdVB5Rog>*3HfhjjArs+;>f94jT1`e=G~hBv@wu9c81CaQp0Z3Y7yqO#O-_c6#1G(gLhV++R z=A1vqks~48vw+XayQxjq*5D{@lMQnWcl!CRe6!x2g(os{?RXgx-Y{HLj)NJ%Bu6;- zW(R>00uV++YVXM)okXj?c&Bpk#ti)$U3CgUd}io!3xmPcxwxaVbvIta_jcVlf^v@T zV~2xAw0h*cHoEhakABh`a9w)Ij6CwPOOJH+0u8$O)#jm1Wmhm~Mr(KT{fk*ULUi=m z+x?(E1p_8*A{8@8i&6JLtuQsIyZ@CISK0C_x4P|Xf@LWs1gOdvW71?jc6q8&X3u2H zO#G!I(r~PT+2GQ>-{uUTZj8q-Y}eY0*_Vuwup7H#^jEYs?l!F&D8!)cr9wVmbMy+~ zu}+rMphMnir0OyEO{eimN$_b~gpL%Q-<9hsKksRMd=4pk{aMM|TXSXfz`H2i@Uuqy z7UAi4;Pz)S?O2iyp4YPXwr*aOwHz@Tjj8TDaTLn^8F={Ug}{(+7?Vaf);CXc!g0=H z#v<|fk#Y}Q1ialHQziq-&+RoK&KJlK+N{zMVlRNg(ZyFy!G3*4ev1qyUoeHkp(alzdDyv!EbqJvZN3CZfW z*O9vqv{~9+Ahqy+X@ADkDJDC3OgECG&M9_BE`LvXS0VSy7e<8e#$g0`F2y0o5AmQq zYay~lBVWyH0?8De{ociS{-MjBh!cf=nF#GD;=Vwqa-a^T zWEN`e6YVR6SP}a@{mPT74%x7|lC={JV+a#FnEHn~fvyKjw5KrHBFV!xD(x_;+lcsq zRQH8ZSuHxdFGEIHj5LJf&$>U-_Z1;fkdDVep}sO9-}&z&{CU9RCiN}MkgQCGFc|is z9m?A-W1bE+nRjfJ1zF$p55nhUa*nMd-*t_l9HFSAseIDL4AK4KKcqOJx`g$*>Zw&mub|3@$Hb_7K`M z8lJD;qPg?MOj<;9bck7M*xD*HVUe-m=Q5DbU@X^|lO?!o(KoYYDKU`GZ|>y_3S`TK zDA#P0uGq7|ykdCA{YUVd5v6>@1pQ+tT^oU!|_x39!-mvkwR;;} zWq?EOOpK0sfh$hYKp01{5&N&#i}TuI41`%@G1Iha8XcA6m&>{CYPjEfJE|=AlNu@Z z*puiNE+e;g!#W4FHD2lpUIo5^JS|WsnEV`AsXyf7U3`kdVS=Uab5On}%m6{jA56ow z;lSst>8EBHRn{T*^;cM0fquIv-wi)*#2eY~R{9VoEDT2aP{*KrptUah$NK6A9iYh# zob8gihd5sKSLn73%H$ls9PyW5yWVB`B*sd+lNb6otPKJAGUHT`6)BBY-bYaI!T5CD z@@DYDD$w$k1q}V&?BYBAt^2Z!h1te)bniL1k4&|fo?vbt+WHY5P>`rs0l z7U9F;%zMxqbEiDiU@sVd)_C zh-k1SI5`4nwb3HQrO&2%%GYph`40fC;T9-h3XvZ#j-=bW8eg6bO7RLU0Hsyps@~cb zC|eI+X`e1e9NMK@q3-O1AdI!^zHld#YbJ_f81VWC9H&J2@=7|br8W?Y-E|LPVvGxG z-2fR{@}l!@@w*>aWaj7{)0w=RHrcZ3p;f782}|Y4>Prk@%SrkEC_ow`X>B;}eV+Eg zh|=hNP7V(a+i`^pWm;pW9Z|X*s8hO@w+ro9f-g)Vg-sbUNd@d^!QHTAnbtLv))wpL zQTZKU)`sUhaci)upTIjK8@zrMY;4RIrprEg6Zhu9^^^+q?teKleVuJjYKvWf&OFzN zLs-gcne}=OuJw5&U_%yA)|FTexJkZdpS26*;M;AyFM@deWH)M4Ipx)e93vk0Fc%s) ziR^5c6VTileA#Z9OAeKBCs{b>09ci zn=xEE*w+O8#5#_e*t;Gn~gWGaqFFX!$hwUdkuStrk@L(g<8@Knet*w6SC zyWlXdd|l9*3^u;WIoG`d>kE+Xg*RekUs}O9+vAVuJ?k!0BO6h38G#!+{VD~nIJ8{{ z+*3HvK3cK0!>ILMD~;gi+)chjfG1W{Vj;$ygt-#{=XY)NtMt{c_?HJLG`_%W;3vzqeW*F_Li}_q#n|v&FK< zi}m@=4hDAJcqlb~3?1N=#w26rKbhs%PN}o;Qa%m-KBl?9%}iCdtE0I$M*nW ziKzCLUSD6|d}^$WfdKS|+GANJT)@0ZS-nr1v=x!)%uhPxx9=t!fylJ56*m8jFJZm|7C(1(yLY2IS2F^Pa^T5Avq6f+zx%-rkOSxsHamw=+#BAQ!*;Va7 z=Pv|=>MrS4u1;lp-$j`^3rq<87%IV+(r}}!wp17H-Au9oi#l|xRKD}pr@U?pjp&CM V{Qb$DHpducb6f7mEG#T7{tsAOm~sFB literal 0 HcmV?d00001 diff --git a/hackfest_multivdu_vnf.zip b/hackfest_multivdu_vnf.zip new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d GIT binary patch literal 27816 zcmd>Gg;pI+v&A8}yE}m(f#B}$1PM;C;O_43?(XisR@ICBd%pV^cM&9T&P;d7u3ge& zL}M~CbXHxTDwUguhAQS@e@sU(6|>p&?A4)0)6pIEpCS2f8g_zuNdE(X^I~_=mqaO zq_fCK+Tu-mZV4*o9$KV#o`|cm;qf@?ZIk5@9x3G!S`j|@IU`$K4O{HX5OWKT*6>X_AgtS@I|Tc%s97|Go7x zI!cmXI=BZf{_@~Y=fotw{8~$J~nE|HLO|#M5(ZHqAT4 z(TpFoyv;MJwR9U#3xDX8M`@0haG^R`K9HmVI>7ICxtG=z_?CwZYx$n$U@RL7!UEBI$eK@ZOtnUP}GU0n*e$Up$7!5iC5+M--^#htF%7~<_pHq-?W~h&+>>|x`HVhkhS$sJf>$%JonhXfc{lZda4}iF zHI}7!Pni(@Xi^lRO+Icb!lqB_JANuU@-+9hSkgwQi4vdlt~E_IC6%XmNa+;QE-dee z?r1ZSw`m$0|4g7qb#+>*gbA$BHZRA=^D~`OFHOUEr#<-CD!-Oyy?t8fT%|}#1>W%F zK~KpEv`lvizj%>`EqKaC))n@8o6F{Rj-})utFy=%$wtJ+}(`23}{NR|s!KKzQ(T z8lzEuYt#4luYxQ;c?|2`5#tdJ+BN4V>}ZxJyA<1a--JKwBzWBc=5gutN0IN_glo*o zchHh~1ijL;IL(^#1av>c``}pmFQZo#@mqwKNF_UhaxhE2T8RtH;9PS2seeo2H z$F=GDQ9rF|(v^)UP3xOT^O@2&npLK5yBPT0sTJTkjUVG(ze61T1b6!np-%Dhg`OMF z_!i@moAmmPMp~+Z&<=1paWgi5d zIo|RpqcK;+0AVMix^&)VAWk!>d~5_nx~BamzO2>+vOe-*d1N3D(7H<^7XA*8_;jT; zSFI}ArYXeEC1BY;ulfV4dQ{8lNFVWi15yWw9)wr`%Em%<=oXs4g#~o;WE>&Lt?)7y z|5n3$H2fnfQmfL&fZhsu)AOMW~utuCY;_+}@UMztZd?w4mNtS7#!dV?y7EY6ZwFMh2dPGO~V#CkQULN>q z214$Ji>aRQI|e#1Napp|_@{WSEZ95jRtALmBa~hqd(}^c%ZwDVz! zYji_{8JYfw)h7tlZw~Ts&HWT;`3l;SoCoktU>+vY= zz2ZSH!GKZ$4-WnU!lvB$na{O(LKYCc10f#RX!B+}jXTliAG-Rk57_tsH0r`9=CGb! z80IV=)zWB69kjg@4KN<$H#3)dZ12V#Bw(Ju^x_lnQqUW|ROTJs9Nw@om5PAkzNCWX z<-vOo6lj3Yl3N6DFM$p8sM+(bBDC`;Toh3WdwH&rN=N{F&hZVc)LLV$^Uk>HAZ^uQ z17F_)rSx2Rt}I=LM`R)*p^7g+<)JvFy#Xm*>R@3fwCY5wikYpTBiFQD|6A6z#@C0Q zHE{Vo#dP|Vjq&9LsCb<3@d4n{iQv9iQ0!)U&ZV<|+@~fd8&8KY)M*`)I5&9a0?mK` z>F~O$Q7!k|(yr)V1zIlVdodqgD}w>;02NkvzN#5f=K!=>jr!C7kS!t)TC|R4-(-sGZEfO6<4PXDUiBt*!jD% zy(UfYWCoOWCJ(CeKxa{!Jf1~JdL(%$o2Oc7uz_xa6!=Lj%}%of?vf)FZ#VL(Ip2w0`4H54ngVpLG7))*$J-DiXL`8ZyF7mO!>%MI-`E=tEP@KoTq6RCG+|3y5?HHowg$ zjpEq%AU?V?fRuy0Py6O2mH#B1e0i$E+wYgJA;RINmmI_(d`tu3Hx&Z`zkNI=kn0Ve zQxFoVCHVSVJKtngxa!ffm^{C0iGp@Q2HYcxIKCiOL?6FP_!wYx1BAN|qW27hm@&Gq zuLpu33v?H(W{Qt15<%Q{0SSVD2Y|uL?zF|-McB`WB`uXz@^pQZE6=;pO_h-+bl>fu z+8`MMK)FwA;8hw6m-Mltbz@ChQ{XQIE~79Rxnh{q1n-Dw!+Wvn>L}hs+y;X3rkS$C zuNF|_DNTC;-0o>0L{^*j^O123S%v%fK%9f&H0?ygu+L4zj0fJU(o6gq#r@#9^yyMU zFBwvxcqcTH?Z&r}O1k#6j)ZrbwtRovmsGXzR(2{ByoEhor0`@O!0a4iU*oSoyyHiM z%7JuK?roQaz`2XPAM#*1P5AS@3-yQ6l_~&xk`JPS%&6N;9jjlV$3JxL&U>x^kx@Iy zY?t~4K^GxhYncL_7HL-+su_@jir2d|dDXX5OM-7p=+Qb4)Nh-mVr(+lKyccuS0*G)x-dE0?tMlNUi-W?-os z$xR?OSQ*dLc>|sQQUYxN5bMyegfB10Xa-ZSPPsL`Wr=HsghTC*xKD3AuSUa51`wIL z&9Inm$oy0+I7vO%4NlsvBEvn1^*cP2hAj>K{^63Glf%m$%~g=p2XeqqUityk8-)v; zmgAE1u%l%#jIBEE&H&}PrXE!qfur=L(Y!HVy777{^(!Mn+|y}WGbqSY$8Riig+5AP z(SRT$DZGBS04o{L&kf>JdMeEd;a-vI;J^|%(}zlRVW%+<{=kYac*ByfgTbC2Y28=K zP}U-Zkd_undhufn9j2Sploa^jGcP-Wc&^fV6(sNCMz66HwzQZO0ZA&>p|pK>C+*fxN6Q)g0cyM{$OK@@O=IpTBw2+ppia z@4O(>G;1qf2XVaRmv){`$(9V_ix`>T6%w?T9S6Ia)>4%M_kOa4T-SM3ULTvChcw=^ zjb#LrS>ir%f!A~?WFSP&Qg=O12Gv&3Km<@=q)lF49~GuMD}@+9$T{SVGJ_A@|Dqua z8ZY!pqX}BDR{z0IL7?OBe^deuVe>=07Zle~!ON0R+GR1V7M2@F%p+W7zXl|0r7pn69S4q5alWydzMfo)l7`AK!7<;LvRcmZ#24QZ%mxeSzTt;aWCcG2I z{eke6B{%A;uC*<@ie8k(A(_x@r^`+;kK973Gt|Y;)RGbf#q!YkCq9g9p#b z(rX#7#Tzy7t|ae!)10QZFa9%M00dl%uqbno?gHYU^NA%aND$#79lHBcUk7gmB{b5M zN`4q!Y14)yxY(i)=7c!*)!+>TT7c`nc+)fW7P@Kku{m$Z<V(y=UG6+4yCL7qFv-2r`c!LzrJ$@5Gr-J&GcM#r%5 zQ5qKoZ#gNbgmSJVY{X1qGMf$}b-341E}xVHl<}k-FN?+HYZdU8E=*##?mG?Vn9_L+ zB=L^eL+hRRen2lZx-?W+hqA;64VqDZnj+kA*VyU5VD##V^=~0tz2nW;Sj4nNX$z!* zB>|<7{4|*P?$2;O$mChnRi=SS{NVG=P+#4d?~SqSw`|2O1c(t_d0w2?{P;zrUDLtJ zwA8=KU7QcXJE5laTA&Gvq@roq*Or$*_Z#z+pFZ~U#QSEn)GlklZ=G^k(p@x#waf$d zr$9U&m1~k!oB|yL<&PtL&(`ARSBNxy{E!8=oIqk>h~WNONBfSn+D6;Cl47DTsTY*< zx?tf)@X3z~p0J_yANR@4!w&*4Ix@56ZUiZW zu4x)E&_Fy~Kt#L-?k-C>!MM}4fAUTVBK>qcy&8fyO|~oYrW`H$<9$ouXS;s92X~y} zUO8Fnp-r_ge|oG{;N`4FR|EZ0XI<(x(xpK^AksEg0ifjL(j*>h;OiXzkfU);K5kX1 z3Wfi5i-9{lOY(YAI^V}BXl2KyLV#~6;nm=xCB0O5>W$3De@U;f5z3bF>@TZLrK;fPMR@1f6vIIY9L;Y`23Iy)i z=L>Wh;GPKF@`^{I#Ik-Gx${P+IIa5er)>o;KUzeWO?)F~tO(de+kvj5`7pr)ZZMc1 z<>Ddg`HxOT?V7MpMA`l_m2WhmAkMqdkkSZE6&u0vr)d5UKl?HWB+VgmKZMbjI{cp3V&wShCtpH7y`~2eOsYs3App-~lH)o)58;hl!jiWY9H| zx(#t?_X*_H$h9j@^yYP$u}{w)H<$0q#*ID4_u*K8l5$2OZ#LJ&5A(F#9*2Mn;Gd z)GEX?M=K(l(VFxC?S5%W_|k$Kbo7FFcB2f$dgb*}KK7+|BRIpMT`&(hYy8XMcNNn* z9fjW+Z2-<~faP14NB|%I%l+0Ij9X07s5;DOKoJ0Q*M(oe`%Kg5y`3M_cp_Ab?|+$L z`7cJTMJjxg=gNIn^af$Q(|QhFThL&T?Z#Q8Zf#O-ejtgGjToS1l8 zK#)6b`vfv`!Ou!o2-%-5u+MXQ6L9WsMHm<|RQ@p0(c{Nl<5)f2xa{msnywN6YDfvP z0Z!3Tmxv#qcq(BFr)W*_wzxmgf5wFG_3{&Vy~O`dr;fKO&6e7gX)Du42+(8^A!REV z7C^)tRB2qBsYt$OzEh!I-!F;#9}Ifc@=g$5bQy75k~334UKr+g&(YgmrEE0 zj)MyBR>pFceZg7b9(&v!1Q%PNH5Jc!%!dMokaW+4{r7iN{zcr)LcoxDUKjQU z&fo`QKmh$h)AZ8=b=t0|D1?8!C-9pOJY~Xxx?B0k5V_V9 zWc-D7y;gq1mR~HWN6HH6t22;lQyP6(UbQpkom_}_k2WF2ex7ll9yuCxrC~J$x0DJw zM3ZI&p=*HE6zw>-S%yQ|v<>&4_O0jFR`9w$K2iQ<*KUL`w$;khEqw0VsN8OtrfA4F zN${stD`8cZbQ%Rzp5r5VM4m5R;ql)*ZzZRKHYd%<(GsLQVgy>w6ZvtxqWO<=tt9E`R}&2uzEbGCXN(?t}yZK=g^& zI)=cpi?CjpNh^Rvc(T7bcboa@XajQI;4Mo$FBYfi?V2cr&t(-DML#r!8-My^D>uU2 zKo9bS88;{ezHz~{4> z?YBVcbL9RCXL{2RyjCNfp93p@>8WtPzF{U@^Z~z}wKGl=^X4=Km83r`>uYvDl z>B2)QiC+DFVp-dK?na;DVP2K~z_zPwSVDI(WHL&x`DQYFkdW*kFD7^{D*t74Ur0+> z>PfT;_|kd3E}g)}Fg*d+-RDU=8nZ%}U3dI$EDFGy2`iP!f>oXdGGH5V=gcs&Ii{)} zk#-50>Oh8Bsv`R4Sj0mFO+@612e}BcEJ*sL;JX%#dIv(8R8K&w z6`Nb-aXWtZ72|s=?)8S-9{Tf8v7dNSk_Deywqifav>Rm?2c=@>r5&04qnlfEO=vuW zoA&T~m{ccCsL&Zy@}9PdCsewo5x2YNOK zZJMqG9axD9<|P9@2&HR-5FY-+6I#~%pe0eLO1s)g4vdMC9Y?T-^(NUAe)NX+m%K`U z@+qu!Mx79e?o0|{=+8!Gd9H52b4Oss z4&5uzwqlMtFlH*NE6poQg=DXnU1~7+7I;=4Ums|+6;zeI5?iMhy4SN^{ zU;l(DAH%zfc!qmY5X4Uv&EoM zOLSNW%$f=gZ3pq{F;SzT78=io4V^*TOaB>Do&-YXC@gLicKk}Ge$das4_*_`cIG7$ zbT(;PkH#ec9Y_NKPRJtfzfn(J3L=L&Kh|TL*NufV3#-szSTB z{23>><6)$Y8-E(}n1ikd?TK=)WFi!{%lrK77|6pkPyGS5mX-Y2l!C>r{-b_t>QRDr zj>Awm$S*Pi6Fs4UzctD-H2se+%*?1S5&ZIz9&I77J$en|>qG3{$d!4< zr>(t9O3vD@0yRbxI)WxnGpIKY?>o^3>-?l)-xvdaG~)q%8dc&+1e)ADg!ng*`8itl zF$?bGQ`-hq2lK47QGg3KX|0aL+vdHBplxsjTH!rs_cnWA-<_#3^#s9AZ=!iko@WA$ z0(mDHKC)Z`QH@xm!Zr&G?x~L9EvYtoL+QONuf3GE!hF0%#c8PZpE1ul*SqjXkQHCJ zDIiVXrsr0z|bneK3O8|YC#m}hFzTvTXK z5Yd%!Dl)2_Y(Dk3w-qlyQNRVxhUqSCp`OE!raTx6R<+|n=OF+xbda3kCGSb}6k5e+ zjI>9h){!2H@i!pQ8BI6*;fH?#LU87(&OeA^$fn>$Ye2|;8*_)CiVi~>Gr{(rXhhso z!L}WCv7-a5M)AMlH(YfGms-P?pXp01uqCm)z(gNNca+N`5^(tApfvhGA*7+Z;l(9^&q(fX(s^#v2;>T&vClW_hAR z%kFKcOQj~!RJMDm6nzv`LPb5ipJq{lAI^Eult$}myvrir9|Bn8S3iAKNhMlQ0haHy zpzF^2{(RyKVQlhtvsNiM+*bHc>iez5m(68hXp1SdUTp#Xb;t9_HxN6hS6;1?pNwhU zJvluInLMb>ZThaOdPu>Jg!tyh^MYCVSe*+u`DTgZGR8?r%^vvSD24OJRdmkH1J`ASI??ClF(BOA|R{K+zB!s4Y6J=GuZ~y4+ z58z{=Py+FHT+Q5u=HjuFM}MKhCvOjvnTL`e1qQzBpF>~a6>X`|=`+u{{6gk=WCS{~ zP)Hk^N{Qc`Xu(QIU;_9ZumxF6I5dhWL4EsxhyDTxvOh8m7azqNd*u;3H<06fVNKg2 z$V!Ky7#jK+Og-X;=2{Ne{U}QGgb_CIXOL}l&&-Qr9mM4tY9Q_h1fPRKwBf?|@JB0O z2hnSAej3kc;o1W}w2by3R*iA9AAs*!bGY83D-XB9p-*YpnEQWXrUcX#qp@@wL$Afw z`2CVGpE_VUi}jkmB@PHrdp-@;0Iqq*7+Mr{;|nyQ_URxH0(q(r2X2g&@MREps|H2} z7x6?2pV`1Wc6iN&PTZW+`HQE6lq#B0a+~3ya?mn*SCa{(^CEQ`ux$55d!q;T+ihB; ztw`ezg~hZ}8r7}==-PmN?a&FBMu)wmghVFdU0^j{T&QQJ+T;hLY~iSYCz zHQLFy63;}4hY_qh>EQiGa2B9%mmDf#XF2?A09oFn6NlSBA>@8(dmyXqgxT!I(J4&SE@52z_JD=Ai1VS=fe$Af78l6r2CKDos-9KgUSY8p| zSLM-zi)2@Ne1x8(Ctf!M#J_`Cd!mBTVx{i=vyc~5=pzgpZ%de@$6E5REA=2;Up`3=fw*cO#v47@KckK zhX}3K(UHGrogu&+ZDuQkv||e%FtwmlR0F~R<@f(VasN*jWOyfPHjw2eh8ockR_5*s zdU5<^!kd9$-XlDr1{2ukE9GXw)EA5kA$?S+yFMV+oFK&>_Wg?y8;psn!bQ-Wmi3aRQALB+{6!LS_jsx>+-OD}T{#{IZG^i$>ATQ`I28TvNl3%!%p#EH>rL(Si!(C*NPl;!hB+(&txs|3 z73UaV=azgx(y%24*kVzg+fgek%tXMMjRlMkDHTHuLRIR5C#Aqm`XlJtwAGBq<;rMK zk56mEvGS2X2}j5u<3-x~dg9Ws|32FQ1U3gi!)7H9Srm!E&=ld;n8dKiD-eM+`}k2q zUtiuD@<0z*=$~Bh3f&aIe#U7hJ;+G`w_S#xU8;%D826c?si4=8ZUM~ggFr0;;BIHXYE z1=f4v6bQjC!D@GE_^O=u#mpF)eS0q5nyU~BB7Mq#`8r(;vE$TNiQZdywTdUB!IHKL zLoqps%xYPNF2Wrf-Q>Vv2mNJ$OV{7kWlbTO<9q`nBVhMda&mGoGPN04*i(F+8=r#w zhVq;STzI@P8PFu;6DSZUd)7A6Jc#tRBuzm9tBAW8^+id9$7}%JsPzW9mkR^ahx8^! zhb8<{=R^DLpq&?WohBeNbD^MZ*wHXPVGN9!*dYx7IR>}*0B!@wj!{MzkB2fN=}HH( z{h-zIP%tdo5d{Korqfj%Kk-C#5?{viQ;7|n8d)d5h{9yX+h8lx*>IC#K33~ObPS;} zP0;>bR1Nlc%Z|RPdD8(2QV$K)mD7|TtaBdOZEv+6qHvG9kb9n)qeohVd-Nmo^D*`| zwc~qrXAj)SkGjDmo~*zy4h4)UN7B(PK`Yv{+T{qjZYM)=$A2KHJKEE){f=;XgqPf! z|FtMboOqSx>yrGka#;6p5MR0@pI@s2?hd+CRnlb@4>ZuK0_ab_K`T#T&_SZLH8Vzwbj=?&PY-Aqv^1XEWv@g|VlIv=W<(j&NG zXD%DjsH#B%D^8nLs>z$BJO&v_TElS0X)i&HcO+U77_akmyxq_=)&}>u06*Jz4}ixn z;Byvo?r9V-mHlI z4^Uq~aSTjr56<-pZ^0lYq21rtBF}p~D?xMLHS3b3zeV$AK&0q5G4THzMyI^4oex9o zmGgNJ(jBA0i0^z_$>ULUBLUH@rJ3{duhv|ejN@Ao+~$^tOyO`sFA`iN7a~|zGUD-8 z75gSc@BX%EdmL-fFry1M{=g`{vL2eZVgR>6BN~AmM+$?Ze^aj=jncYTdIrGwBOXS% zDPWNp7JkkvL7ht9nrT(OwO*TMGF0+R8W9uLcu9}XQW^a=1)kJ|6|QQL&?uXg3<|P^ zN$k>yVh!x>443Rz&?zY?$A32el_@(W30e9s%>gTW;Kvg*;SA}a3KE=$eE;URB7FtA z@vtB7m}zCYA#Lu#teX-FbF+TpV(r{r!uL-2?MC~z?`@a{6^=6DY)b--iVF&m0QIiakcE~r)$@t&)FZAc=Ih!}KjQJ$V!A=mzNxe0VL>FY_Q;#9- za^Ejt%^AJsCK3kY$Ei;ljcPfdkkGi^h8s)-2YI)F`M$}Rpb|zCzj>(Qr%N5+^OV-0 ziF;bc1PkttBTTd_j~EujsE@&FJ``a}8>Wa1-M|ZlvMN53(4yU1sec${Wb|lJnn1W7 zD4>fro4`=BFxzy0wz}p+uOBKGZt~gWja+?^UiLGPL3)n$M34sMphOd!0$N zcCdG)V2Y5|myAXT6f~`pWDkp*Gxvf6y~?-p!7qA^ggizNNI$;wn71U)he8uinI@X> zK18NFn9+!*t}4IjM?kFS@Q*3JG(*gM;mb^19%K9Mh$~yZyq^46_|7{fxt7>Nt3`w?My85S^;zQ0o)&8PCX%nQE??vIet{rP~lZ)Kg$fB z3P&`Zk>Pn|*y$6U262yMu5}=~hgiyKa6$@?#Zouq`teg)=O5f>9AQMrFZrZXF0TzS zZ|fT^Df6UmqBakOAe=wbD!pVHsoO%NBNjB11Hd}t0oA`hi_rPljInHUu}5%PQdLzo z7K%;o)NPM%5YaKpl8@*e*cx>~qziz!Qyx=>KkpjhkXejkXmJ(KMB;2vY)}&|lplCSjXwA+6l=cb?MgkEX)$#7M#D~Y1wN3F?Ud+9OWJPcad80qc|?e9U5R?( zFcaq2kx{L-*}Gx|D{#~ebbWzbk04Le$%t52CGGH|yCmw@rkgsSM1F6C6oI~jbP-@c zJ9Tsz@6tsdEto9nhLP<6{~m)J!79E)aV&zbwAy$B*{ymiEj8J;=X=^&@=}m`2TdAC z=?8qr0%mEX5mWL%e*EBlL!4%51glzw-OtuI!5TiCV_?t|kobNR_eJ>y`2_^hTuLJ# zVFLl=g)zI(49YyD1Y3PUacrl6rxfYj6P_}H;Sw52<1a5Q{PBj?N)y2!Cs05V4K4?L z!ps?Jbi5W5$d})Y>ClO9QuU*B%Zr5cX&dl(qe8tIaG?hzAJ_CITBr6KWc^FY49K=Z z4^BdYQ!P^Jipm69kK*+1Lra9ojjdvJq*Q2h#qn%=G555gc_B#$g`TD~XOhXg%Bi$i zW{hgX9)AV#u8E{`6X?Mx52;YMI~=|r;4}i~-SQ^J$S?SOxdTnIj%vTFPgjw6K@R=am>DGlZ2q(2Ys}J^8h$2nQ-=VJZi< zzj=(7E3nN+>IHy|;t11juIL$4 zQZzurL9`Oxm;YPO6LMr&v#YF=&O*gkh+aWTlHst)^|9yN?20JMz9c?SmIg>dT?=l>xOrxzKT9 z4#r6;eo4rgL7!tZoDY%i0e~)LO5wmrrk&w3GdVmXEzD~#@~f5%rlNlUqA_7onOBB$;oAe9fUrG(-$A}txIxL{=23~7~DP9)wu6bE00?#=;8occf9m?vdNH!91}3T=YsIIMteojKT4ndc|h_1=)D)DH|i+#2e{W=2u}x98b$c@n;%B?jcX7W=a*%okZ|Ao^gk1 zUxvX5Zi;Et+Y2*(%isZXdimQh!bd0{=j` zCHg&LIQ)it7XTaRt1NZP1NvuC!)`DETOG%Va!vW)ooNu?AolbC zkij1FWL&KXbkE=fmo-WDn{y;DH}-nFkys z=a*8RRupD6Pl2dU-n48H=c5auKGGYmG5)8CKgFB9_$Gp;<>);k0?~dBna2QXy2~kE zeC%EW6CBhqZ7RXIgfR^})1+N-1aHTO^ZPgG^bBjb3;?_7Glpk^C?Favqp}9Pd(spR z6n_-r94V}D0kLzXF%y1w8UPV5#qm2PErNAvHHU|~Xirr&RJ6X6deA+jiNC2yD5TjN zij@GP=Jd4x#)!aF=B0s)dzGL>0HvumJ{*A1cZe{P`u>)5tCbEXACR?*#nBI)5I${^7mMT> zP1>*a)oL;hq#0EeE%AWP?6gWO=$JbKp$H4i&p&w}t?nn6={+W>1S z(8+lv-}nJ+A7V7Jc-j>~s|Sv~Mw2df1n62VMiU>j@C#bQ^8o;PtJp<1)`!F!pU1Qy z&zB+z{H{bpKH@1psquIX1}F9GdAkvBy-K2!A~@YTTmfEb{t#d2xMQ$SIh2+ZI%q&K zNT2)caq>RR4uFo~IE0-IbF{+-@Gt>*!X)tM4HkHTq~;7by2783)7o!nY&ch#E<5F0 zQ-LG#tSIbymHXWa(qkH3X-*r(n&?s?oVB2fYYDJNKWGe$eHxi7zi{iGywZ+_p;TL`0!l*fKH1lxDPnvUd6Z(Ea zCQmz=0G)M2<5?{l*3UP0adYFou)@MJoJYb*jt3~^UDmS`Sal3UUmy&l!vXq>>OD%_ z(K_wcDN~}|Dn9nN!%Qg+s$i${UZ}GO{jHm#4AEwuZKk)33MZP*l%@-J6}oFdx#Sc_ z#`sD*%_7QJ4w!)nfBs`6z$QV8`PT^y~l= zx#a^M>q=;9f;Nt8s^BPSCSAer4*52Z*2DPC;I9O2#ANYy0Wf9{#2XXkxjdMa)W#Ea zrl3&IfKZw+P|^67WXVI&^lDBs2G;?gGxQWp-PPZCM+TO%9aLS)J#nU5fhd36fo1gP zBotTwmrE%-rD*5#lL&OV_*<&~`Ku;1cj+(45$xZnWO0M4ZaUe;A~Ggk7u?b7ntuffMK0En(~E89BKpolFe|* zORz)qIxMAZ2vy??3;}6Ep>Lrb2vB25X^_HtUWg*i!w(PnHJE#USweqEs@FwA`QEQm zU@nw@FnLIYtCT`&9rq)$~is4y+&fz~!m?~0Jj(`6fw;{vaF zM_9u%HqP|w5>=i58{R{>SO!%%;!PSt?eJR@!oi?$CJOW?Ef7;aj^Q{8greLct?B)P z@o%G%Hvyj*;HO+9al+BdVP4Gm@t057Z%j0BvtgPzubrrU8gPYk){wCfsW#1s^-Y z!FImX2@mz)Gu2FMfSNkO`tIAcxVP#!9#o_W9c=KvRe((?ak$Ksk-mDfOatiJK5`oAsrG+Z||PqA`_@lX*ImpJh_hvcPRWXrrV< z4Houp2t91^Y9LRQ@=OfE$O0f~lJC>q^^;*NN3i%XBSc*x9mFwyEPjC>OHC>|@$ZO^H2)37ep$EfV zqAxzHkIR6>)_!3)qdbv%wPDV;x~7$O?y%%x6{RLRl);szy?IDJ+MfpsFwrF(Ry>O5 z#SYEHj-q@ztd{)-)xsnK^u(myU`$s~;sG5O(VHQ*x6dQhd{zgp`Gk&2hb-?vs7A0c zhz?qrjdk?@i_sA}K(~x1t9e-JuMjWzwoH$woOrI2_W|YibZwl*Hx^jz4lX}x3J5wg z3W77uN_$Z6Ut|;~`gIv}@4~CKl6tzZ-^MthceN&ynduI}p3|FbnNl=zv;~^8wh2U# z?e6q6vZ@E17eCprx`W;q>U>~Q;#w~2`$)iaP*v@|5n!vK5>m0 z+^vA-vO65~mc}|`0nr;E3`Z8+pF~GAVq@!$M>?(K!S1>xLAbE?4SC@0e`glD=$Q|* zL~HrgP1#1@B?wsXNvopxB19z=7_mj1cGKX)b{?{aL_dLHW8MT_LzwRu<6bKRkk1+J z1FB7{(hK~`#T&ZN4Gt3;LPwIw|A9c^u=S=N>M!9+RdI z3qG@mcFn+H2}e0ll1WT^^SWjz=>8&}l922R3C*fobmIRHpg4zgl!%CkW5|O+)LWrj zXT>MEc3mL-$69n6XG(kdHD&aPX)wU$D}AA&xQLPt)-*0A8k7bd?jmH&@=7M4@X`@e zO@u>LPqCr_xWteg(tw2=9;+;?k^|GYg|wb{y0{tB6}+DiYz)AIxEUkX!Enk+$Vq4! zqP(Sv?gf&0KIj6P@A5#DUO13y^M@U1))YaUzXE{cgU95Ngb(ngv>`OK zqU#U{Nq*Lb(`>sWKjD!x`sgy$e+v~Z?n(FBkRDp9F`ymKl@Qr7zbY!yr8nP#r?*!@ z;g=ckL&0LEalDr1t-ypQG4PAk_9isNgE|dk-y1k1FbMN`fCrv+3E_A3J3Z3{255W~ zcq@!16V-G)+xgTwvBJ(75P1ny7|hhSLsXonlO&76!a^s&%S8o-WKfnkb|m2t+oTul z#=t*yU}w`bYEDa9_~}{1&fXra zb~?hXao~0tH@z`W^DvWf_2NrMlaf*yJkQM&0d~(q+|t~%9(#Gf9fz^owVX_d=Cc3_ z#&Jo(G=_rcMJ>XH_hj(rHy+^8Mz_XtH&kdz5Q#AH-Cc;R{GRXKG>~QXi_?UW2Oeqz z+T0Un)`e1r4@5N$zhBa5pamseWl^540O(C%=NKOmhSw)sC7|Cy#DOh!pm{Gprz-1v zHOfOyLedQzJ>gU8)($hU=I#7UnDilSadwC#b+T23<{q;JYhBYkO`M~VwH@dXqqi}R@v6Ne_N@e93 z0QEa>IP;}3qUJI{=jA7?<;qut@6u^XjlTZUa?B9gnXH=?JD3ccp?d2aka%H8sW3h$b`R6AP`SA5_}Sf(O)?XC-AFocyoX<`na>SlnQveD#dX` z9P$oM=BFs@Y}g@&R$ozmd2Z(AW}%pLECsD?*x>LoUDaU}9dz&lCU%MyZXj_x0L}WO z_a89om3WMQ#?oA*D{y#~=Y?kRt~d|{Bt`G9auCvP?p1IGJ?;hyd=%#@b}88KTa7XI z=@6bFcL;K^$d3~ITGNC&%sT80;V=s^<+TxoV>?>^WzW}I$fvI|+p*7O+SG(XAJmhv zg*QaT`*6k+2$q4_v#`>6n_zy33IYLx(s}nEzFZfUK;#)H zdv5)UzAV9oCXsOsVQ!C(yYP&eOZdqFWIXWW2hDY1P?XQGy#voW;h`WKIMzYKt-K#n zZ)(K72FiBQN(TJ;2b^%9myPles#j9|U z`#2nY=7v`FJDg}!6`XC@&5B=QOTBQ_4KS<=n#T%p8&6hejYB=s<4w1{KipBy~3wq72XjVNd^QY?eXwFp?H|#Hot+tN4y4L|kwdN7o2Z z;Ia*e6h1LUrOemXN>K1MjB%JIQ|VgG?ynBt zNBKmnE+9=B{RrOqA){h}h=qs$cq5jbrP7QStq0pEaKDqh(l^r|{#mrApxwzIf$4l8 z2b>uBlO|SZS}h}uKv(Sp37mY#(Q;9mD1)#rc{$P}h!*Kt){?g*Pzv$E$?hv02dmbi z*;IG|dIw4Mv{M-g#&{)74?@2g2a}qm_$!+aN@DP+ls|l}5dc%%>ZFgd3>CK@cCvJ) zZh;dJ7}eGbOM;2b!|uNXWZnFYB~2-$DJH;im$?UVRA?I>%c&NL6PrBfZcurcCO zV}1~WfqC#r4qs$RC;ur_$6K%XpioIw<{NBg{^vjLF~z!m{HF5^NvnVGoYOYOlOE1s zeb0y)U`tE$!0u6SI$Y{P zG^d2eo9Qsh9>zgKCDL%k!{VYMk1pPkazzNn*uQ5Zed1Xhx4imWGN8p*yD*|41`||8 z>Z%s7%nSZd)obje?vPR|>PdI{k%1#bSmH+{7Tv8O&Sxfgh=Q3J)_9#_4W~s_1Xms6 z6J1*sD_PJq7Y_i?Y`V8*QH3vG|HMs4HT*l;X#Fqs24JB$(1qa`r}|jTvntC%d{YVv zWkULWM{g!T#4UMxH<1iX$wAWjN{71Tknt<9k#5S;C1l|TNQ8J&+>dtJj72TVas4k| z@G3?C+R3DWOv>vDAHJuSRQM{`Wj_cp!kqqZXX$rL_asn5{Zboh6 zG=9`$v9Hzod}baEo12j5iOiBZx(GAFipN}WQ6aVa08(Jq>yHVYNh%;DZn;sfLKy=6 zI`?!6RibGDO5nXC4z#ULgTc9eG!hTMf8eVG+W+lKAGx$&gXb6=VX#k8N0lesWU?IW zBw^&J*#jPrIyHD4Ub0Vp*ydy);{KV3JeWV8^!iOMPYJ++8J`wUA1DqrSil^fffNP? zfTvgP(L%iussp{dq0mKbeZ<^e22B}b+2(NlWvw`^_$rNs%e<;d6HgN9V%r5FK#z+ zG-^hzk5?QE$}PE|RD#m=_uUQ6S&r0}J0QUPsiJ%A{5$(0E#<;q7wped_7F-BsblGO zKcfR|I$S2=4Lhd&uK>%{3WrLQu9g7D_45Ys$g$DL|6kT`{j@MZjdeII)8(mMzR!9mpcLkOxl#KHav{l|(y!ZDZLLHx@JB5F^xk1gljX@vuV zCuEdlf59U3`Q3z?4C0D(r+8y221^0_O2+MKt#u|Rx-Q>?^p_tZ+oMdLm1@Rg+|tjd zWo4Ifs$srF$sg)ZKg{v!0V`k7dJ^_ZkmBPZZQ8@2H?Cocy^b0VLt=)$r!JmLZ^j+# zh^BghJEDw}OQ>Pf9gn5P%O*CJ4X}UTxEtDUFZB;}0A!naf|CAW=Wyd4XQcXt&c6UJ zr+EICCy3K0=}gnHZPM&&7b0J5cmsRrEIpE{^OV(VlcO}`g*;5v;Sxtgw9nJRgioH3 z{||Szp`C|43F3Z`VYA;Qv&=k?DtJ^bwIq5F;1=xvN3eDrkR$z#WYg{%$A`wOwd<-< zCx0&FQt^co7=^kl{@9p$tim6%k$z6TBvj~6m$%kJic0CS-(O^msp^rH(j+=2nX-yX zr%;yU|Lj0yDKIw!EdR+$%MX+qM-#qOoeaT#yzX#6xDmfOr*`f1ak)$pb6lua|BENe zyn+PzoFan-AW9#{QTwk;G4Qy+@t?EGf`wA8F0`p!*F|4c`+a5{h&D+nsx}+rnm%h= ze2_zIF&FgJ6j5Z$HX&PD?Ps+9j{k>Dk?jQwyQv0tKZ#iO+CI?Xh;!O@JMs+@^o#C` zm0OwFuNl91!Sk(0cq}iOfb5OO2D={A!E-UF(I~gv2ho@eq;uVs-?Rf)HEeh-%ItXY zIX*(!fmb?db%Fgu6wkQqK+@+O6CE!RF|T79)&cC`2pCBgM}{p; ztGw-6mmig4bxjt7o%vr4Qoq+l$4}^ZlIbwZ=@uh*GWrti8G&r~%KvNwrTIT;da1PI ze>-Y@=h!vJH&!f>X)0Y1bRti)@zNQi6A3z0ndh6Klxq$Ar%t1@!#OF^`qYu3Mo)3( z$1{VpH%=C*(xQmd>ygykTzwpNOB>Dwl=045nGBJJOIWob2ZoxvmnEk07UN3SOQ0QTvkuaKN|a(yn*A*vBfNi5m;s~c{XHX6ZrB6c zBmc>#FtgT}cYy@;&vZ5A1}1O(q=)vTzUDBR>1XsYdj*<{{arx_<2ncZD~fIw$-oVn z02!Fp%=3S;^*UKk)Cn_->(q9?Y%-K_u&~eDolx*4h>!G~yljWk8`sbgi8L?0bJI^} zkm5~@%!W>sv5Rl~YNY4vsi!a_oVX*zWB{3Lb7qu@kw+hLrd9lzm#ryRHi8Ot#u;gu z4(8g|gM;N~wpXduZk!_c9lc6KiwWTwWiJ#^M=&Q;MxNfjj{RNdwx$vP{}}~+RT(lN9Vev<(zxbk82~P>!igmS&1yWXU`yx6+zOz6_klYn|hh%b~I+{m-(bDyewyVQn&^U$cC;39H64*WO9v{X$zBW~4RHGa)@d){d5B z`AdVB5Rog>*3HfhjjArs+;>f94jT1`e=G~hBv@wu9c81CaQp0Z3Y7yqO#O-_c6#1G(gLhV++R z=A1vqks~48vw+XayQxjq*5D{@lMQnWcl!CRe6!x2g(os{?RXgx-Y{HLj)NJ%Bu6;- zW(R>00uV++YVXM)okXj?c&Bpk#ti)$U3CgUd}io!3xmPcxwxaVbvIta_jcVlf^v@T zV~2xAw0h*cHoEhakABh`a9w)Ij6CwPOOJH+0u8$O)#jm1Wmhm~Mr(KT{fk*ULUi=m z+x?(E1p_8*A{8@8i&6JLtuQsIyZ@CISK0C_x4P|Xf@LWs1gOdvW71?jc6q8&X3u2H zO#G!I(r~PT+2GQ>-{uUTZj8q-Y}eY0*_Vuwup7H#^jEYs?l!F&D8!)cr9wVmbMy+~ zu}+rMphMnir0OyEO{eimN$_b~gpL%Q-<9hsKksRMd=4pk{aMM|TXSXfz`H2i@Uuqy z7UAi4;Pz)S?O2iyp4YPXwr*aOwHz@Tjj8TDaTLn^8F={Ug}{(+7?Vaf);CXc!g0=H z#v<|fk#Y}Q1ialHQziq-&+RoK&KJlK+N{zMVlRNg(ZyFy!G3*4ev1qyUoeHkp(alzdDyv!EbqJvZN3CZfW z*O9vqv{~9+Ahqy+X@ADkDJDC3OgECG&M9_BE`LvXS0VSy7e<8e#$g0`F2y0o5AmQq zYay~lBVWyH0?8De{ociS{-MjBh!cf=nF#GD;=Vwqa-a^T zWEN`e6YVR6SP}a@{mPT74%x7|lC={JV+a#FnEHn~fvyKjw5KrHBFV!xD(x_;+lcsq zRQH8ZSuHxdFGEIHj5LJf&$>U-_Z1;fkdDVep}sO9-}&z&{CU9RCiN}MkgQCGFc|is z9m?A-W1bE+nRjfJ1zF$p55nhUa*nMd-*t_l9HFSAseIDL4AK4KKcqOJx`g$*>Zw&mub|3@$Hb_7K`M z8lJD;qPg?MOj<;9bck7M*xD*HVUe-m=Q5DbU@X^|lO?!o(KoYYDKU`GZ|>y_3S`TK zDA#P0uGq7|ykdCA{YUVd5v6>@1pQ+tT^oU!|_x39!-mvkwR;;} zWq?EOOpK0sfh$hYKp01{5&N&#i}TuI41`%@G1Iha8XcA6m&>{CYPjEfJE|=AlNu@Z z*puiNE+e;g!#W4FHD2lpUIo5^JS|WsnEV`AsXyf7U3`kdVS=Uab5On}%m6{jA56ow z;lSst>8EBHRn{T*^;cM0fquIv-wi)*#2eY~R{9VoEDT2aP{*KrptUah$NK6A9iYh# zob8gihd5sKSLn73%H$ls9PyW5yWVB`B*sd+lNb6otPKJAGUHT`6)BBY-bYaI!T5CD z@@DYDD$w$k1q}V&?BYBAt^2Z!h1te)bniL1k4&|fo?vbt+WHY5P>`rs0l z7U9F;%zMxqbEiDiU@sVd)_C zh-k1SI5`4nwb3HQrO&2%%GYph`40fC;T9-h3XvZ#j-=bW8eg6bO7RLU0Hsyps@~cb zC|eI+X`e1e9NMK@q3-O1AdI!^zHld#YbJ_f81VWC9H&J2@=7|br8W?Y-E|LPVvGxG z-2fR{@}l!@@w*>aWaj7{)0w=RHrcZ3p;f782}|Y4>Prk@%SrkEC_ow`X>B;}eV+Eg zh|=hNP7V(a+i`^pWm;pW9Z|X*s8hO@w+ro9f-g)Vg-sbUNd@d^!QHTAnbtLv))wpL zQTZKU)`sUhaci)upTIjK8@zrMY;4RIrprEg6Zhu9^^^+q?teKleVuJjYKvWf&OFzN zLs-gcne}=OuJw5&U_%yA)|FTexJkZdpS26*;M;AyFM@deWH)M4Ipx)e93vk0Fc%s) ziR^5c6VTileA#Z9OAeKBCs{b>09ci zn=xEE*w+O8#5#_e*t;Gn~gWGaqFFX!$hwUdkuStrk@L(g<8@Knet*w6SC zyWlXdd|l9*3^u;WIoG`d>kE+Xg*RekUs}O9+vAVuJ?k!0BO6h38G#!+{VD~nIJ8{{ z+*3HvK3cK0!>ILMD~;gi+)chjfG1W{Vj;$ygt-#{=XY)NtMt{c_?HJLG`_%W;3vzqeW*F_Li}_q#n|v&FK< zi}m@=4hDAJcqlb~3?1N=#w26rKbhs%PN}o;Qa%m-KBl?9%}iCdtE0I$M*nW ziKzCLUSD6|d}^$WfdKS|+GANJT)@0ZS-nr1v=x!)%uhPxx9=t!fylJ56*m8jFJZm|7C(1(yLY2IS2F^Pa^T5Avq6f+zx%-rkOSxsHamw=+#BAQ!*;Va7 z=Pv|=>MrS4u1;lp-$j`^3rq<87%IV+(r}}!wp17H-Au9oi#l|xRKD}pr@U?pjp&CM V{Qb$DHpducb6f7mEG#T7{tsAOm~sFB literal 0 HcmV?d00001 diff --git a/pathname b/pathname new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d GIT binary patch literal 27816 zcmd>Gg;pI+v&A8}yE}m(f#B}$1PM;C;O_43?(XisR@ICBd%pV^cM&9T&P;d7u3ge& zL}M~CbXHxTDwUguhAQS@e@sU(6|>p&?A4)0)6pIEpCS2f8g_zuNdE(X^I~_=mqaO zq_fCK+Tu-mZV4*o9$KV#o`|cm;qf@?ZIk5@9x3G!S`j|@IU`$K4O{HX5OWKT*6>X_AgtS@I|Tc%s97|Go7x zI!cmXI=BZf{_@~Y=fotw{8~$J~nE|HLO|#M5(ZHqAT4 z(TpFoyv;MJwR9U#3xDX8M`@0haG^R`K9HmVI>7ICxtG=z_?CwZYx$n$U@RL7!UEBI$eK@ZOtnUP}GU0n*e$Up$7!5iC5+M--^#htF%7~<_pHq-?W~h&+>>|x`HVhkhS$sJf>$%JonhXfc{lZda4}iF zHI}7!Pni(@Xi^lRO+Icb!lqB_JANuU@-+9hSkgwQi4vdlt~E_IC6%XmNa+;QE-dee z?r1ZSw`m$0|4g7qb#+>*gbA$BHZRA=^D~`OFHOUEr#<-CD!-Oyy?t8fT%|}#1>W%F zK~KpEv`lvizj%>`EqKaC))n@8o6F{Rj-})utFy=%$wtJ+}(`23}{NR|s!KKzQ(T z8lzEuYt#4luYxQ;c?|2`5#tdJ+BN4V>}ZxJyA<1a--JKwBzWBc=5gutN0IN_glo*o zchHh~1ijL;IL(^#1av>c``}pmFQZo#@mqwKNF_UhaxhE2T8RtH;9PS2seeo2H z$F=GDQ9rF|(v^)UP3xOT^O@2&npLK5yBPT0sTJTkjUVG(ze61T1b6!np-%Dhg`OMF z_!i@moAmmPMp~+Z&<=1paWgi5d zIo|RpqcK;+0AVMix^&)VAWk!>d~5_nx~BamzO2>+vOe-*d1N3D(7H<^7XA*8_;jT; zSFI}ArYXeEC1BY;ulfV4dQ{8lNFVWi15yWw9)wr`%Em%<=oXs4g#~o;WE>&Lt?)7y z|5n3$H2fnfQmfL&fZhsu)AOMW~utuCY;_+}@UMztZd?w4mNtS7#!dV?y7EY6ZwFMh2dPGO~V#CkQULN>q z214$Ji>aRQI|e#1Napp|_@{WSEZ95jRtALmBa~hqd(}^c%ZwDVz! zYji_{8JYfw)h7tlZw~Ts&HWT;`3l;SoCoktU>+vY= zz2ZSH!GKZ$4-WnU!lvB$na{O(LKYCc10f#RX!B+}jXTliAG-Rk57_tsH0r`9=CGb! z80IV=)zWB69kjg@4KN<$H#3)dZ12V#Bw(Ju^x_lnQqUW|ROTJs9Nw@om5PAkzNCWX z<-vOo6lj3Yl3N6DFM$p8sM+(bBDC`;Toh3WdwH&rN=N{F&hZVc)LLV$^Uk>HAZ^uQ z17F_)rSx2Rt}I=LM`R)*p^7g+<)JvFy#Xm*>R@3fwCY5wikYpTBiFQD|6A6z#@C0Q zHE{Vo#dP|Vjq&9LsCb<3@d4n{iQv9iQ0!)U&ZV<|+@~fd8&8KY)M*`)I5&9a0?mK` z>F~O$Q7!k|(yr)V1zIlVdodqgD}w>;02NkvzN#5f=K!=>jr!C7kS!t)TC|R4-(-sGZEfO6<4PXDUiBt*!jD% zy(UfYWCoOWCJ(CeKxa{!Jf1~JdL(%$o2Oc7uz_xa6!=Lj%}%of?vf)FZ#VL(Ip2w0`4H54ngVpLG7))*$J-DiXL`8ZyF7mO!>%MI-`E=tEP@KoTq6RCG+|3y5?HHowg$ zjpEq%AU?V?fRuy0Py6O2mH#B1e0i$E+wYgJA;RINmmI_(d`tu3Hx&Z`zkNI=kn0Ve zQxFoVCHVSVJKtngxa!ffm^{C0iGp@Q2HYcxIKCiOL?6FP_!wYx1BAN|qW27hm@&Gq zuLpu33v?H(W{Qt15<%Q{0SSVD2Y|uL?zF|-McB`WB`uXz@^pQZE6=;pO_h-+bl>fu z+8`MMK)FwA;8hw6m-Mltbz@ChQ{XQIE~79Rxnh{q1n-Dw!+Wvn>L}hs+y;X3rkS$C zuNF|_DNTC;-0o>0L{^*j^O123S%v%fK%9f&H0?ygu+L4zj0fJU(o6gq#r@#9^yyMU zFBwvxcqcTH?Z&r}O1k#6j)ZrbwtRovmsGXzR(2{ByoEhor0`@O!0a4iU*oSoyyHiM z%7JuK?roQaz`2XPAM#*1P5AS@3-yQ6l_~&xk`JPS%&6N;9jjlV$3JxL&U>x^kx@Iy zY?t~4K^GxhYncL_7HL-+su_@jir2d|dDXX5OM-7p=+Qb4)Nh-mVr(+lKyccuS0*G)x-dE0?tMlNUi-W?-os z$xR?OSQ*dLc>|sQQUYxN5bMyegfB10Xa-ZSPPsL`Wr=HsghTC*xKD3AuSUa51`wIL z&9Inm$oy0+I7vO%4NlsvBEvn1^*cP2hAj>K{^63Glf%m$%~g=p2XeqqUityk8-)v; zmgAE1u%l%#jIBEE&H&}PrXE!qfur=L(Y!HVy777{^(!Mn+|y}WGbqSY$8Riig+5AP z(SRT$DZGBS04o{L&kf>JdMeEd;a-vI;J^|%(}zlRVW%+<{=kYac*ByfgTbC2Y28=K zP}U-Zkd_undhufn9j2Sploa^jGcP-Wc&^fV6(sNCMz66HwzQZO0ZA&>p|pK>C+*fxN6Q)g0cyM{$OK@@O=IpTBw2+ppia z@4O(>G;1qf2XVaRmv){`$(9V_ix`>T6%w?T9S6Ia)>4%M_kOa4T-SM3ULTvChcw=^ zjb#LrS>ir%f!A~?WFSP&Qg=O12Gv&3Km<@=q)lF49~GuMD}@+9$T{SVGJ_A@|Dqua z8ZY!pqX}BDR{z0IL7?OBe^deuVe>=07Zle~!ON0R+GR1V7M2@F%p+W7zXl|0r7pn69S4q5alWydzMfo)l7`AK!7<;LvRcmZ#24QZ%mxeSzTt;aWCcG2I z{eke6B{%A;uC*<@ie8k(A(_x@r^`+;kK973Gt|Y;)RGbf#q!YkCq9g9p#b z(rX#7#Tzy7t|ae!)10QZFa9%M00dl%uqbno?gHYU^NA%aND$#79lHBcUk7gmB{b5M zN`4q!Y14)yxY(i)=7c!*)!+>TT7c`nc+)fW7P@Kku{m$Z<V(y=UG6+4yCL7qFv-2r`c!LzrJ$@5Gr-J&GcM#r%5 zQ5qKoZ#gNbgmSJVY{X1qGMf$}b-341E}xVHl<}k-FN?+HYZdU8E=*##?mG?Vn9_L+ zB=L^eL+hRRen2lZx-?W+hqA;64VqDZnj+kA*VyU5VD##V^=~0tz2nW;Sj4nNX$z!* zB>|<7{4|*P?$2;O$mChnRi=SS{NVG=P+#4d?~SqSw`|2O1c(t_d0w2?{P;zrUDLtJ zwA8=KU7QcXJE5laTA&Gvq@roq*Or$*_Z#z+pFZ~U#QSEn)GlklZ=G^k(p@x#waf$d zr$9U&m1~k!oB|yL<&PtL&(`ARSBNxy{E!8=oIqk>h~WNONBfSn+D6;Cl47DTsTY*< zx?tf)@X3z~p0J_yANR@4!w&*4Ix@56ZUiZW zu4x)E&_Fy~Kt#L-?k-C>!MM}4fAUTVBK>qcy&8fyO|~oYrW`H$<9$ouXS;s92X~y} zUO8Fnp-r_ge|oG{;N`4FR|EZ0XI<(x(xpK^AksEg0ifjL(j*>h;OiXzkfU);K5kX1 z3Wfi5i-9{lOY(YAI^V}BXl2KyLV#~6;nm=xCB0O5>W$3De@U;f5z3bF>@TZLrK;fPMR@1f6vIIY9L;Y`23Iy)i z=L>Wh;GPKF@`^{I#Ik-Gx${P+IIa5er)>o;KUzeWO?)F~tO(de+kvj5`7pr)ZZMc1 z<>Ddg`HxOT?V7MpMA`l_m2WhmAkMqdkkSZE6&u0vr)d5UKl?HWB+VgmKZMbjI{cp3V&wShCtpH7y`~2eOsYs3App-~lH)o)58;hl!jiWY9H| zx(#t?_X*_H$h9j@^yYP$u}{w)H<$0q#*ID4_u*K8l5$2OZ#LJ&5A(F#9*2Mn;Gd z)GEX?M=K(l(VFxC?S5%W_|k$Kbo7FFcB2f$dgb*}KK7+|BRIpMT`&(hYy8XMcNNn* z9fjW+Z2-<~faP14NB|%I%l+0Ij9X07s5;DOKoJ0Q*M(oe`%Kg5y`3M_cp_Ab?|+$L z`7cJTMJjxg=gNIn^af$Q(|QhFThL&T?Z#Q8Zf#O-ejtgGjToS1l8 zK#)6b`vfv`!Ou!o2-%-5u+MXQ6L9WsMHm<|RQ@p0(c{Nl<5)f2xa{msnywN6YDfvP z0Z!3Tmxv#qcq(BFr)W*_wzxmgf5wFG_3{&Vy~O`dr;fKO&6e7gX)Du42+(8^A!REV z7C^)tRB2qBsYt$OzEh!I-!F;#9}Ifc@=g$5bQy75k~334UKr+g&(YgmrEE0 zj)MyBR>pFceZg7b9(&v!1Q%PNH5Jc!%!dMokaW+4{r7iN{zcr)LcoxDUKjQU z&fo`QKmh$h)AZ8=b=t0|D1?8!C-9pOJY~Xxx?B0k5V_V9 zWc-D7y;gq1mR~HWN6HH6t22;lQyP6(UbQpkom_}_k2WF2ex7ll9yuCxrC~J$x0DJw zM3ZI&p=*HE6zw>-S%yQ|v<>&4_O0jFR`9w$K2iQ<*KUL`w$;khEqw0VsN8OtrfA4F zN${stD`8cZbQ%Rzp5r5VM4m5R;ql)*ZzZRKHYd%<(GsLQVgy>w6ZvtxqWO<=tt9E`R}&2uzEbGCXN(?t}yZK=g^& zI)=cpi?CjpNh^Rvc(T7bcboa@XajQI;4Mo$FBYfi?V2cr&t(-DML#r!8-My^D>uU2 zKo9bS88;{ezHz~{4> z?YBVcbL9RCXL{2RyjCNfp93p@>8WtPzF{U@^Z~z}wKGl=^X4=Km83r`>uYvDl z>B2)QiC+DFVp-dK?na;DVP2K~z_zPwSVDI(WHL&x`DQYFkdW*kFD7^{D*t74Ur0+> z>PfT;_|kd3E}g)}Fg*d+-RDU=8nZ%}U3dI$EDFGy2`iP!f>oXdGGH5V=gcs&Ii{)} zk#-50>Oh8Bsv`R4Sj0mFO+@612e}BcEJ*sL;JX%#dIv(8R8K&w z6`Nb-aXWtZ72|s=?)8S-9{Tf8v7dNSk_Deywqifav>Rm?2c=@>r5&04qnlfEO=vuW zoA&T~m{ccCsL&Zy@}9PdCsewo5x2YNOK zZJMqG9axD9<|P9@2&HR-5FY-+6I#~%pe0eLO1s)g4vdMC9Y?T-^(NUAe)NX+m%K`U z@+qu!Mx79e?o0|{=+8!Gd9H52b4Oss z4&5uzwqlMtFlH*NE6poQg=DXnU1~7+7I;=4Ums|+6;zeI5?iMhy4SN^{ zU;l(DAH%zfc!qmY5X4Uv&EoM zOLSNW%$f=gZ3pq{F;SzT78=io4V^*TOaB>Do&-YXC@gLicKk}Ge$das4_*_`cIG7$ zbT(;PkH#ec9Y_NKPRJtfzfn(J3L=L&Kh|TL*NufV3#-szSTB z{23>><6)$Y8-E(}n1ikd?TK=)WFi!{%lrK77|6pkPyGS5mX-Y2l!C>r{-b_t>QRDr zj>Awm$S*Pi6Fs4UzctD-H2se+%*?1S5&ZIz9&I77J$en|>qG3{$d!4< zr>(t9O3vD@0yRbxI)WxnGpIKY?>o^3>-?l)-xvdaG~)q%8dc&+1e)ADg!ng*`8itl zF$?bGQ`-hq2lK47QGg3KX|0aL+vdHBplxsjTH!rs_cnWA-<_#3^#s9AZ=!iko@WA$ z0(mDHKC)Z`QH@xm!Zr&G?x~L9EvYtoL+QONuf3GE!hF0%#c8PZpE1ul*SqjXkQHCJ zDIiVXrsr0z|bneK3O8|YC#m}hFzTvTXK z5Yd%!Dl)2_Y(Dk3w-qlyQNRVxhUqSCp`OE!raTx6R<+|n=OF+xbda3kCGSb}6k5e+ zjI>9h){!2H@i!pQ8BI6*;fH?#LU87(&OeA^$fn>$Ye2|;8*_)CiVi~>Gr{(rXhhso z!L}WCv7-a5M)AMlH(YfGms-P?pXp01uqCm)z(gNNca+N`5^(tApfvhGA*7+Z;l(9^&q(fX(s^#v2;>T&vClW_hAR z%kFKcOQj~!RJMDm6nzv`LPb5ipJq{lAI^Eult$}myvrir9|Bn8S3iAKNhMlQ0haHy zpzF^2{(RyKVQlhtvsNiM+*bHc>iez5m(68hXp1SdUTp#Xb;t9_HxN6hS6;1?pNwhU zJvluInLMb>ZThaOdPu>Jg!tyh^MYCVSe*+u`DTgZGR8?r%^vvSD24OJRdmkH1J`ASI??ClF(BOA|R{K+zB!s4Y6J=GuZ~y4+ z58z{=Py+FHT+Q5u=HjuFM}MKhCvOjvnTL`e1qQzBpF>~a6>X`|=`+u{{6gk=WCS{~ zP)Hk^N{Qc`Xu(QIU;_9ZumxF6I5dhWL4EsxhyDTxvOh8m7azqNd*u;3H<06fVNKg2 z$V!Ky7#jK+Og-X;=2{Ne{U}QGgb_CIXOL}l&&-Qr9mM4tY9Q_h1fPRKwBf?|@JB0O z2hnSAej3kc;o1W}w2by3R*iA9AAs*!bGY83D-XB9p-*YpnEQWXrUcX#qp@@wL$Afw z`2CVGpE_VUi}jkmB@PHrdp-@;0Iqq*7+Mr{;|nyQ_URxH0(q(r2X2g&@MREps|H2} z7x6?2pV`1Wc6iN&PTZW+`HQE6lq#B0a+~3ya?mn*SCa{(^CEQ`ux$55d!q;T+ihB; ztw`ezg~hZ}8r7}==-PmN?a&FBMu)wmghVFdU0^j{T&QQJ+T;hLY~iSYCz zHQLFy63;}4hY_qh>EQiGa2B9%mmDf#XF2?A09oFn6NlSBA>@8(dmyXqgxT!I(J4&SE@52z_JD=Ai1VS=fe$Af78l6r2CKDos-9KgUSY8p| zSLM-zi)2@Ne1x8(Ctf!M#J_`Cd!mBTVx{i=vyc~5=pzgpZ%de@$6E5REA=2;Up`3=fw*cO#v47@KckK zhX}3K(UHGrogu&+ZDuQkv||e%FtwmlR0F~R<@f(VasN*jWOyfPHjw2eh8ockR_5*s zdU5<^!kd9$-XlDr1{2ukE9GXw)EA5kA$?S+yFMV+oFK&>_Wg?y8;psn!bQ-Wmi3aRQALB+{6!LS_jsx>+-OD}T{#{IZG^i$>ATQ`I28TvNl3%!%p#EH>rL(Si!(C*NPl;!hB+(&txs|3 z73UaV=azgx(y%24*kVzg+fgek%tXMMjRlMkDHTHuLRIR5C#Aqm`XlJtwAGBq<;rMK zk56mEvGS2X2}j5u<3-x~dg9Ws|32FQ1U3gi!)7H9Srm!E&=ld;n8dKiD-eM+`}k2q zUtiuD@<0z*=$~Bh3f&aIe#U7hJ;+G`w_S#xU8;%D826c?si4=8ZUM~ggFr0;;BIHXYE z1=f4v6bQjC!D@GE_^O=u#mpF)eS0q5nyU~BB7Mq#`8r(;vE$TNiQZdywTdUB!IHKL zLoqps%xYPNF2Wrf-Q>Vv2mNJ$OV{7kWlbTO<9q`nBVhMda&mGoGPN04*i(F+8=r#w zhVq;STzI@P8PFu;6DSZUd)7A6Jc#tRBuzm9tBAW8^+id9$7}%JsPzW9mkR^ahx8^! zhb8<{=R^DLpq&?WohBeNbD^MZ*wHXPVGN9!*dYx7IR>}*0B!@wj!{MzkB2fN=}HH( z{h-zIP%tdo5d{Korqfj%Kk-C#5?{viQ;7|n8d)d5h{9yX+h8lx*>IC#K33~ObPS;} zP0;>bR1Nlc%Z|RPdD8(2QV$K)mD7|TtaBdOZEv+6qHvG9kb9n)qeohVd-Nmo^D*`| zwc~qrXAj)SkGjDmo~*zy4h4)UN7B(PK`Yv{+T{qjZYM)=$A2KHJKEE){f=;XgqPf! z|FtMboOqSx>yrGka#;6p5MR0@pI@s2?hd+CRnlb@4>ZuK0_ab_K`T#T&_SZLH8Vzwbj=?&PY-Aqv^1XEWv@g|VlIv=W<(j&NG zXD%DjsH#B%D^8nLs>z$BJO&v_TElS0X)i&HcO+U77_akmyxq_=)&}>u06*Jz4}ixn z;Byvo?r9V-mHlI z4^Uq~aSTjr56<-pZ^0lYq21rtBF}p~D?xMLHS3b3zeV$AK&0q5G4THzMyI^4oex9o zmGgNJ(jBA0i0^z_$>ULUBLUH@rJ3{duhv|ejN@Ao+~$^tOyO`sFA`iN7a~|zGUD-8 z75gSc@BX%EdmL-fFry1M{=g`{vL2eZVgR>6BN~AmM+$?Ze^aj=jncYTdIrGwBOXS% zDPWNp7JkkvL7ht9nrT(OwO*TMGF0+R8W9uLcu9}XQW^a=1)kJ|6|QQL&?uXg3<|P^ zN$k>yVh!x>443Rz&?zY?$A32el_@(W30e9s%>gTW;Kvg*;SA}a3KE=$eE;URB7FtA z@vtB7m}zCYA#Lu#teX-FbF+TpV(r{r!uL-2?MC~z?`@a{6^=6DY)b--iVF&m0QIiakcE~r)$@t&)FZAc=Ih!}KjQJ$V!A=mzNxe0VL>FY_Q;#9- za^Ejt%^AJsCK3kY$Ei;ljcPfdkkGi^h8s)-2YI)F`M$}Rpb|zCzj>(Qr%N5+^OV-0 ziF;bc1PkttBTTd_j~EujsE@&FJ``a}8>Wa1-M|ZlvMN53(4yU1sec${Wb|lJnn1W7 zD4>fro4`=BFxzy0wz}p+uOBKGZt~gWja+?^UiLGPL3)n$M34sMphOd!0$N zcCdG)V2Y5|myAXT6f~`pWDkp*Gxvf6y~?-p!7qA^ggizNNI$;wn71U)he8uinI@X> zK18NFn9+!*t}4IjM?kFS@Q*3JG(*gM;mb^19%K9Mh$~yZyq^46_|7{fxt7>Nt3`w?My85S^;zQ0o)&8PCX%nQE??vIet{rP~lZ)Kg$fB z3P&`Zk>Pn|*y$6U262yMu5}=~hgiyKa6$@?#Zouq`teg)=O5f>9AQMrFZrZXF0TzS zZ|fT^Df6UmqBakOAe=wbD!pVHsoO%NBNjB11Hd}t0oA`hi_rPljInHUu}5%PQdLzo z7K%;o)NPM%5YaKpl8@*e*cx>~qziz!Qyx=>KkpjhkXejkXmJ(KMB;2vY)}&|lplCSjXwA+6l=cb?MgkEX)$#7M#D~Y1wN3F?Ud+9OWJPcad80qc|?e9U5R?( zFcaq2kx{L-*}Gx|D{#~ebbWzbk04Le$%t52CGGH|yCmw@rkgsSM1F6C6oI~jbP-@c zJ9Tsz@6tsdEto9nhLP<6{~m)J!79E)aV&zbwAy$B*{ymiEj8J;=X=^&@=}m`2TdAC z=?8qr0%mEX5mWL%e*EBlL!4%51glzw-OtuI!5TiCV_?t|kobNR_eJ>y`2_^hTuLJ# zVFLl=g)zI(49YyD1Y3PUacrl6rxfYj6P_}H;Sw52<1a5Q{PBj?N)y2!Cs05V4K4?L z!ps?Jbi5W5$d})Y>ClO9QuU*B%Zr5cX&dl(qe8tIaG?hzAJ_CITBr6KWc^FY49K=Z z4^BdYQ!P^Jipm69kK*+1Lra9ojjdvJq*Q2h#qn%=G555gc_B#$g`TD~XOhXg%Bi$i zW{hgX9)AV#u8E{`6X?Mx52;YMI~=|r;4}i~-SQ^J$S?SOxdTnIj%vTFPgjw6K@R=am>DGlZ2q(2Ys}J^8h$2nQ-=VJZi< zzj=(7E3nN+>IHy|;t11juIL$4 zQZzurL9`Oxm;YPO6LMr&v#YF=&O*gkh+aWTlHst)^|9yN?20JMz9c?SmIg>dT?=l>xOrxzKT9 z4#r6;eo4rgL7!tZoDY%i0e~)LO5wmrrk&w3GdVmXEzD~#@~f5%rlNlUqA_7onOBB$;oAe9fUrG(-$A}txIxL{=23~7~DP9)wu6bE00?#=;8occf9m?vdNH!91}3T=YsIIMteojKT4ndc|h_1=)D)DH|i+#2e{W=2u}x98b$c@n;%B?jcX7W=a*%okZ|Ao^gk1 zUxvX5Zi;Et+Y2*(%isZXdimQh!bd0{=j` zCHg&LIQ)it7XTaRt1NZP1NvuC!)`DETOG%Va!vW)ooNu?AolbC zkij1FWL&KXbkE=fmo-WDn{y;DH}-nFkys z=a*8RRupD6Pl2dU-n48H=c5auKGGYmG5)8CKgFB9_$Gp;<>);k0?~dBna2QXy2~kE zeC%EW6CBhqZ7RXIgfR^})1+N-1aHTO^ZPgG^bBjb3;?_7Glpk^C?Favqp}9Pd(spR z6n_-r94V}D0kLzXF%y1w8UPV5#qm2PErNAvHHU|~Xirr&RJ6X6deA+jiNC2yD5TjN zij@GP=Jd4x#)!aF=B0s)dzGL>0HvumJ{*A1cZe{P`u>)5tCbEXACR?*#nBI)5I${^7mMT> zP1>*a)oL;hq#0EeE%AWP?6gWO=$JbKp$H4i&p&w}t?nn6={+W>1S z(8+lv-}nJ+A7V7Jc-j>~s|Sv~Mw2df1n62VMiU>j@C#bQ^8o;PtJp<1)`!F!pU1Qy z&zB+z{H{bpKH@1psquIX1}F9GdAkvBy-K2!A~@YTTmfEb{t#d2xMQ$SIh2+ZI%q&K zNT2)caq>RR4uFo~IE0-IbF{+-@Gt>*!X)tM4HkHTq~;7by2783)7o!nY&ch#E<5F0 zQ-LG#tSIbymHXWa(qkH3X-*r(n&?s?oVB2fYYDJNKWGe$eHxi7zi{iGywZ+_p;TL`0!l*fKH1lxDPnvUd6Z(Ea zCQmz=0G)M2<5?{l*3UP0adYFou)@MJoJYb*jt3~^UDmS`Sal3UUmy&l!vXq>>OD%_ z(K_wcDN~}|Dn9nN!%Qg+s$i${UZ}GO{jHm#4AEwuZKk)33MZP*l%@-J6}oFdx#Sc_ z#`sD*%_7QJ4w!)nfBs`6z$QV8`PT^y~l= zx#a^M>q=;9f;Nt8s^BPSCSAer4*52Z*2DPC;I9O2#ANYy0Wf9{#2XXkxjdMa)W#Ea zrl3&IfKZw+P|^67WXVI&^lDBs2G;?gGxQWp-PPZCM+TO%9aLS)J#nU5fhd36fo1gP zBotTwmrE%-rD*5#lL&OV_*<&~`Ku;1cj+(45$xZnWO0M4ZaUe;A~Ggk7u?b7ntuffMK0En(~E89BKpolFe|* zORz)qIxMAZ2vy??3;}6Ep>Lrb2vB25X^_HtUWg*i!w(PnHJE#USweqEs@FwA`QEQm zU@nw@FnLIYtCT`&9rq)$~is4y+&fz~!m?~0Jj(`6fw;{vaF zM_9u%HqP|w5>=i58{R{>SO!%%;!PSt?eJR@!oi?$CJOW?Ef7;aj^Q{8greLct?B)P z@o%G%Hvyj*;HO+9al+BdVP4Gm@t057Z%j0BvtgPzubrrU8gPYk){wCfsW#1s^-Y z!FImX2@mz)Gu2FMfSNkO`tIAcxVP#!9#o_W9c=KvRe((?ak$Ksk-mDfOatiJK5`oAsrG+Z||PqA`_@lX*ImpJh_hvcPRWXrrV< z4Houp2t91^Y9LRQ@=OfE$O0f~lJC>q^^;*NN3i%XBSc*x9mFwyEPjC>OHC>|@$ZO^H2)37ep$EfV zqAxzHkIR6>)_!3)qdbv%wPDV;x~7$O?y%%x6{RLRl);szy?IDJ+MfpsFwrF(Ry>O5 z#SYEHj-q@ztd{)-)xsnK^u(myU`$s~;sG5O(VHQ*x6dQhd{zgp`Gk&2hb-?vs7A0c zhz?qrjdk?@i_sA}K(~x1t9e-JuMjWzwoH$woOrI2_W|YibZwl*Hx^jz4lX}x3J5wg z3W77uN_$Z6Ut|;~`gIv}@4~CKl6tzZ-^MthceN&ynduI}p3|FbnNl=zv;~^8wh2U# z?e6q6vZ@E17eCprx`W;q>U>~Q;#w~2`$)iaP*v@|5n!vK5>m0 z+^vA-vO65~mc}|`0nr;E3`Z8+pF~GAVq@!$M>?(K!S1>xLAbE?4SC@0e`glD=$Q|* zL~HrgP1#1@B?wsXNvopxB19z=7_mj1cGKX)b{?{aL_dLHW8MT_LzwRu<6bKRkk1+J z1FB7{(hK~`#T&ZN4Gt3;LPwIw|A9c^u=S=N>M!9+RdI z3qG@mcFn+H2}e0ll1WT^^SWjz=>8&}l922R3C*fobmIRHpg4zgl!%CkW5|O+)LWrj zXT>MEc3mL-$69n6XG(kdHD&aPX)wU$D}AA&xQLPt)-*0A8k7bd?jmH&@=7M4@X`@e zO@u>LPqCr_xWteg(tw2=9;+;?k^|GYg|wb{y0{tB6}+DiYz)AIxEUkX!Enk+$Vq4! zqP(Sv?gf&0KIj6P@A5#DUO13y^M@U1))YaUzXE{cgU95Ngb(ngv>`OK zqU#U{Nq*Lb(`>sWKjD!x`sgy$e+v~Z?n(FBkRDp9F`ymKl@Qr7zbY!yr8nP#r?*!@ z;g=ckL&0LEalDr1t-ypQG4PAk_9isNgE|dk-y1k1FbMN`fCrv+3E_A3J3Z3{255W~ zcq@!16V-G)+xgTwvBJ(75P1ny7|hhSLsXonlO&76!a^s&%S8o-WKfnkb|m2t+oTul z#=t*yU}w`bYEDa9_~}{1&fXra zb~?hXao~0tH@z`W^DvWf_2NrMlaf*yJkQM&0d~(q+|t~%9(#Gf9fz^owVX_d=Cc3_ z#&Jo(G=_rcMJ>XH_hj(rHy+^8Mz_XtH&kdz5Q#AH-Cc;R{GRXKG>~QXi_?UW2Oeqz z+T0Un)`e1r4@5N$zhBa5pamseWl^540O(C%=NKOmhSw)sC7|Cy#DOh!pm{Gprz-1v zHOfOyLedQzJ>gU8)($hU=I#7UnDilSadwC#b+T23<{q;JYhBYkO`M~VwH@dXqqi}R@v6Ne_N@e93 z0QEa>IP;}3qUJI{=jA7?<;qut@6u^XjlTZUa?B9gnXH=?JD3ccp?d2aka%H8sW3h$b`R6AP`SA5_}Sf(O)?XC-AFocyoX<`na>SlnQveD#dX` z9P$oM=BFs@Y}g@&R$ozmd2Z(AW}%pLECsD?*x>LoUDaU}9dz&lCU%MyZXj_x0L}WO z_a89om3WMQ#?oA*D{y#~=Y?kRt~d|{Bt`G9auCvP?p1IGJ?;hyd=%#@b}88KTa7XI z=@6bFcL;K^$d3~ITGNC&%sT80;V=s^<+TxoV>?>^WzW}I$fvI|+p*7O+SG(XAJmhv zg*QaT`*6k+2$q4_v#`>6n_zy33IYLx(s}nEzFZfUK;#)H zdv5)UzAV9oCXsOsVQ!C(yYP&eOZdqFWIXWW2hDY1P?XQGy#voW;h`WKIMzYKt-K#n zZ)(K72FiBQN(TJ;2b^%9myPles#j9|U z`#2nY=7v`FJDg}!6`XC@&5B=QOTBQ_4KS<=n#T%p8&6hejYB=s<4w1{KipBy~3wq72XjVNd^QY?eXwFp?H|#Hot+tN4y4L|kwdN7o2Z z;Ia*e6h1LUrOemXN>K1MjB%JIQ|VgG?ynBt zNBKmnE+9=B{RrOqA){h}h=qs$cq5jbrP7QStq0pEaKDqh(l^r|{#mrApxwzIf$4l8 z2b>uBlO|SZS}h}uKv(Sp37mY#(Q;9mD1)#rc{$P}h!*Kt){?g*Pzv$E$?hv02dmbi z*;IG|dIw4Mv{M-g#&{)74?@2g2a}qm_$!+aN@DP+ls|l}5dc%%>ZFgd3>CK@cCvJ) zZh;dJ7}eGbOM;2b!|uNXWZnFYB~2-$DJH;im$?UVRA?I>%c&NL6PrBfZcurcCO zV}1~WfqC#r4qs$RC;ur_$6K%XpioIw<{NBg{^vjLF~z!m{HF5^NvnVGoYOYOlOE1s zeb0y)U`tE$!0u6SI$Y{P zG^d2eo9Qsh9>zgKCDL%k!{VYMk1pPkazzNn*uQ5Zed1Xhx4imWGN8p*yD*|41`||8 z>Z%s7%nSZd)obje?vPR|>PdI{k%1#bSmH+{7Tv8O&Sxfgh=Q3J)_9#_4W~s_1Xms6 z6J1*sD_PJq7Y_i?Y`V8*QH3vG|HMs4HT*l;X#Fqs24JB$(1qa`r}|jTvntC%d{YVv zWkULWM{g!T#4UMxH<1iX$wAWjN{71Tknt<9k#5S;C1l|TNQ8J&+>dtJj72TVas4k| z@G3?C+R3DWOv>vDAHJuSRQM{`Wj_cp!kqqZXX$rL_asn5{Zboh6 zG=9`$v9Hzod}baEo12j5iOiBZx(GAFipN}WQ6aVa08(Jq>yHVYNh%;DZn;sfLKy=6 zI`?!6RibGDO5nXC4z#ULgTc9eG!hTMf8eVG+W+lKAGx$&gXb6=VX#k8N0lesWU?IW zBw^&J*#jPrIyHD4Ub0Vp*ydy);{KV3JeWV8^!iOMPYJ++8J`wUA1DqrSil^fffNP? zfTvgP(L%iussp{dq0mKbeZ<^e22B}b+2(NlWvw`^_$rNs%e<;d6HgN9V%r5FK#z+ zG-^hzk5?QE$}PE|RD#m=_uUQ6S&r0}J0QUPsiJ%A{5$(0E#<;q7wped_7F-BsblGO zKcfR|I$S2=4Lhd&uK>%{3WrLQu9g7D_45Ys$g$DL|6kT`{j@MZjdeII)8(mMzR!9mpcLkOxl#KHav{l|(y!ZDZLLHx@JB5F^xk1gljX@vuV zCuEdlf59U3`Q3z?4C0D(r+8y221^0_O2+MKt#u|Rx-Q>?^p_tZ+oMdLm1@Rg+|tjd zWo4Ifs$srF$sg)ZKg{v!0V`k7dJ^_ZkmBPZZQ8@2H?Cocy^b0VLt=)$r!JmLZ^j+# zh^BghJEDw}OQ>Pf9gn5P%O*CJ4X}UTxEtDUFZB;}0A!naf|CAW=Wyd4XQcXt&c6UJ zr+EICCy3K0=}gnHZPM&&7b0J5cmsRrEIpE{^OV(VlcO}`g*;5v;Sxtgw9nJRgioH3 z{||Szp`C|43F3Z`VYA;Qv&=k?DtJ^bwIq5F;1=xvN3eDrkR$z#WYg{%$A`wOwd<-< zCx0&FQt^co7=^kl{@9p$tim6%k$z6TBvj~6m$%kJic0CS-(O^msp^rH(j+=2nX-yX zr%;yU|Lj0yDKIw!EdR+$%MX+qM-#qOoeaT#yzX#6xDmfOr*`f1ak)$pb6lua|BENe zyn+PzoFan-AW9#{QTwk;G4Qy+@t?EGf`wA8F0`p!*F|4c`+a5{h&D+nsx}+rnm%h= ze2_zIF&FgJ6j5Z$HX&PD?Ps+9j{k>Dk?jQwyQv0tKZ#iO+CI?Xh;!O@JMs+@^o#C` zm0OwFuNl91!Sk(0cq}iOfb5OO2D={A!E-UF(I~gv2ho@eq;uVs-?Rf)HEeh-%ItXY zIX*(!fmb?db%Fgu6wkQqK+@+O6CE!RF|T79)&cC`2pCBgM}{p; ztGw-6mmig4bxjt7o%vr4Qoq+l$4}^ZlIbwZ=@uh*GWrti8G&r~%KvNwrTIT;da1PI ze>-Y@=h!vJH&!f>X)0Y1bRti)@zNQi6A3z0ndh6Klxq$Ar%t1@!#OF^`qYu3Mo)3( z$1{VpH%=C*(xQmd>ygykTzwpNOB>Dwl=045nGBJJOIWob2ZoxvmnEk07UN3SOQ0QTvkuaKN|a(yn*A*vBfNi5m;s~c{XHX6ZrB6c zBmc>#FtgT}cYy@;&vZ5A1}1O(q=)vTzUDBR>1XsYdj*<{{arx_<2ncZD~fIw$-oVn z02!Fp%=3S;^*UKk)Cn_->(q9?Y%-K_u&~eDolx*4h>!G~yljWk8`sbgi8L?0bJI^} zkm5~@%!W>sv5Rl~YNY4vsi!a_oVX*zWB{3Lb7qu@kw+hLrd9lzm#ryRHi8Ot#u;gu z4(8g|gM;N~wpXduZk!_c9lc6KiwWTwWiJ#^M=&Q;MxNfjj{RNdwx$vP{}}~+RT(lN9Vev<(zxbk82~P>!igmS&1yWXU`yx6+zOz6_klYn|hh%b~I+{m-(bDyewyVQn&^U$cC;39H64*WO9v{X$zBW~4RHGa)@d){d5B z`AdVB5Rog>*3HfhjjArs+;>f94jT1`e=G~hBv@wu9c81CaQp0Z3Y7yqO#O-_c6#1G(gLhV++R z=A1vqks~48vw+XayQxjq*5D{@lMQnWcl!CRe6!x2g(os{?RXgx-Y{HLj)NJ%Bu6;- zW(R>00uV++YVXM)okXj?c&Bpk#ti)$U3CgUd}io!3xmPcxwxaVbvIta_jcVlf^v@T zV~2xAw0h*cHoEhakABh`a9w)Ij6CwPOOJH+0u8$O)#jm1Wmhm~Mr(KT{fk*ULUi=m z+x?(E1p_8*A{8@8i&6JLtuQsIyZ@CISK0C_x4P|Xf@LWs1gOdvW71?jc6q8&X3u2H zO#G!I(r~PT+2GQ>-{uUTZj8q-Y}eY0*_Vuwup7H#^jEYs?l!F&D8!)cr9wVmbMy+~ zu}+rMphMnir0OyEO{eimN$_b~gpL%Q-<9hsKksRMd=4pk{aMM|TXSXfz`H2i@Uuqy z7UAi4;Pz)S?O2iyp4YPXwr*aOwHz@Tjj8TDaTLn^8F={Ug}{(+7?Vaf);CXc!g0=H z#v<|fk#Y}Q1ialHQziq-&+RoK&KJlK+N{zMVlRNg(ZyFy!G3*4ev1qyUoeHkp(alzdDyv!EbqJvZN3CZfW z*O9vqv{~9+Ahqy+X@ADkDJDC3OgECG&M9_BE`LvXS0VSy7e<8e#$g0`F2y0o5AmQq zYay~lBVWyH0?8De{ociS{-MjBh!cf=nF#GD;=Vwqa-a^T zWEN`e6YVR6SP}a@{mPT74%x7|lC={JV+a#FnEHn~fvyKjw5KrHBFV!xD(x_;+lcsq zRQH8ZSuHxdFGEIHj5LJf&$>U-_Z1;fkdDVep}sO9-}&z&{CU9RCiN}MkgQCGFc|is z9m?A-W1bE+nRjfJ1zF$p55nhUa*nMd-*t_l9HFSAseIDL4AK4KKcqOJx`g$*>Zw&mub|3@$Hb_7K`M z8lJD;qPg?MOj<;9bck7M*xD*HVUe-m=Q5DbU@X^|lO?!o(KoYYDKU`GZ|>y_3S`TK zDA#P0uGq7|ykdCA{YUVd5v6>@1pQ+tT^oU!|_x39!-mvkwR;;} zWq?EOOpK0sfh$hYKp01{5&N&#i}TuI41`%@G1Iha8XcA6m&>{CYPjEfJE|=AlNu@Z z*puiNE+e;g!#W4FHD2lpUIo5^JS|WsnEV`AsXyf7U3`kdVS=Uab5On}%m6{jA56ow z;lSst>8EBHRn{T*^;cM0fquIv-wi)*#2eY~R{9VoEDT2aP{*KrptUah$NK6A9iYh# zob8gihd5sKSLn73%H$ls9PyW5yWVB`B*sd+lNb6otPKJAGUHT`6)BBY-bYaI!T5CD z@@DYDD$w$k1q}V&?BYBAt^2Z!h1te)bniL1k4&|fo?vbt+WHY5P>`rs0l z7U9F;%zMxqbEiDiU@sVd)_C zh-k1SI5`4nwb3HQrO&2%%GYph`40fC;T9-h3XvZ#j-=bW8eg6bO7RLU0Hsyps@~cb zC|eI+X`e1e9NMK@q3-O1AdI!^zHld#YbJ_f81VWC9H&J2@=7|br8W?Y-E|LPVvGxG z-2fR{@}l!@@w*>aWaj7{)0w=RHrcZ3p;f782}|Y4>Prk@%SrkEC_ow`X>B;}eV+Eg zh|=hNP7V(a+i`^pWm;pW9Z|X*s8hO@w+ro9f-g)Vg-sbUNd@d^!QHTAnbtLv))wpL zQTZKU)`sUhaci)upTIjK8@zrMY;4RIrprEg6Zhu9^^^+q?teKleVuJjYKvWf&OFzN zLs-gcne}=OuJw5&U_%yA)|FTexJkZdpS26*;M;AyFM@deWH)M4Ipx)e93vk0Fc%s) ziR^5c6VTileA#Z9OAeKBCs{b>09ci zn=xEE*w+O8#5#_e*t;Gn~gWGaqFFX!$hwUdkuStrk@L(g<8@Knet*w6SC zyWlXdd|l9*3^u;WIoG`d>kE+Xg*RekUs}O9+vAVuJ?k!0BO6h38G#!+{VD~nIJ8{{ z+*3HvK3cK0!>ILMD~;gi+)chjfG1W{Vj;$ygt-#{=XY)NtMt{c_?HJLG`_%W;3vzqeW*F_Li}_q#n|v&FK< zi}m@=4hDAJcqlb~3?1N=#w26rKbhs%PN}o;Qa%m-KBl?9%}iCdtE0I$M*nW ziKzCLUSD6|d}^$WfdKS|+GANJT)@0ZS-nr1v=x!)%uhPxx9=t!fylJ56*m8jFJZm|7C(1(yLY2IS2F^Pa^T5Avq6f+zx%-rkOSxsHamw=+#BAQ!*;Va7 z=Pv|=>MrS4u1;lp-$j`^3rq<87%IV+(r}}!wp17H-Au9oi#l|xRKD}pr@U?pjp&CM V{Qb$DHpducb6f7mEG#T7{tsAOm~sFB literal 0 HcmV?d00001 diff --git a/pathname.tar b/pathname.tar new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d GIT binary patch literal 27816 zcmd>Gg;pI+v&A8}yE}m(f#B}$1PM;C;O_43?(XisR@ICBd%pV^cM&9T&P;d7u3ge& zL}M~CbXHxTDwUguhAQS@e@sU(6|>p&?A4)0)6pIEpCS2f8g_zuNdE(X^I~_=mqaO zq_fCK+Tu-mZV4*o9$KV#o`|cm;qf@?ZIk5@9x3G!S`j|@IU`$K4O{HX5OWKT*6>X_AgtS@I|Tc%s97|Go7x zI!cmXI=BZf{_@~Y=fotw{8~$J~nE|HLO|#M5(ZHqAT4 z(TpFoyv;MJwR9U#3xDX8M`@0haG^R`K9HmVI>7ICxtG=z_?CwZYx$n$U@RL7!UEBI$eK@ZOtnUP}GU0n*e$Up$7!5iC5+M--^#htF%7~<_pHq-?W~h&+>>|x`HVhkhS$sJf>$%JonhXfc{lZda4}iF zHI}7!Pni(@Xi^lRO+Icb!lqB_JANuU@-+9hSkgwQi4vdlt~E_IC6%XmNa+;QE-dee z?r1ZSw`m$0|4g7qb#+>*gbA$BHZRA=^D~`OFHOUEr#<-CD!-Oyy?t8fT%|}#1>W%F zK~KpEv`lvizj%>`EqKaC))n@8o6F{Rj-})utFy=%$wtJ+}(`23}{NR|s!KKzQ(T z8lzEuYt#4luYxQ;c?|2`5#tdJ+BN4V>}ZxJyA<1a--JKwBzWBc=5gutN0IN_glo*o zchHh~1ijL;IL(^#1av>c``}pmFQZo#@mqwKNF_UhaxhE2T8RtH;9PS2seeo2H z$F=GDQ9rF|(v^)UP3xOT^O@2&npLK5yBPT0sTJTkjUVG(ze61T1b6!np-%Dhg`OMF z_!i@moAmmPMp~+Z&<=1paWgi5d zIo|RpqcK;+0AVMix^&)VAWk!>d~5_nx~BamzO2>+vOe-*d1N3D(7H<^7XA*8_;jT; zSFI}ArYXeEC1BY;ulfV4dQ{8lNFVWi15yWw9)wr`%Em%<=oXs4g#~o;WE>&Lt?)7y z|5n3$H2fnfQmfL&fZhsu)AOMW~utuCY;_+}@UMztZd?w4mNtS7#!dV?y7EY6ZwFMh2dPGO~V#CkQULN>q z214$Ji>aRQI|e#1Napp|_@{WSEZ95jRtALmBa~hqd(}^c%ZwDVz! zYji_{8JYfw)h7tlZw~Ts&HWT;`3l;SoCoktU>+vY= zz2ZSH!GKZ$4-WnU!lvB$na{O(LKYCc10f#RX!B+}jXTliAG-Rk57_tsH0r`9=CGb! z80IV=)zWB69kjg@4KN<$H#3)dZ12V#Bw(Ju^x_lnQqUW|ROTJs9Nw@om5PAkzNCWX z<-vOo6lj3Yl3N6DFM$p8sM+(bBDC`;Toh3WdwH&rN=N{F&hZVc)LLV$^Uk>HAZ^uQ z17F_)rSx2Rt}I=LM`R)*p^7g+<)JvFy#Xm*>R@3fwCY5wikYpTBiFQD|6A6z#@C0Q zHE{Vo#dP|Vjq&9LsCb<3@d4n{iQv9iQ0!)U&ZV<|+@~fd8&8KY)M*`)I5&9a0?mK` z>F~O$Q7!k|(yr)V1zIlVdodqgD}w>;02NkvzN#5f=K!=>jr!C7kS!t)TC|R4-(-sGZEfO6<4PXDUiBt*!jD% zy(UfYWCoOWCJ(CeKxa{!Jf1~JdL(%$o2Oc7uz_xa6!=Lj%}%of?vf)FZ#VL(Ip2w0`4H54ngVpLG7))*$J-DiXL`8ZyF7mO!>%MI-`E=tEP@KoTq6RCG+|3y5?HHowg$ zjpEq%AU?V?fRuy0Py6O2mH#B1e0i$E+wYgJA;RINmmI_(d`tu3Hx&Z`zkNI=kn0Ve zQxFoVCHVSVJKtngxa!ffm^{C0iGp@Q2HYcxIKCiOL?6FP_!wYx1BAN|qW27hm@&Gq zuLpu33v?H(W{Qt15<%Q{0SSVD2Y|uL?zF|-McB`WB`uXz@^pQZE6=;pO_h-+bl>fu z+8`MMK)FwA;8hw6m-Mltbz@ChQ{XQIE~79Rxnh{q1n-Dw!+Wvn>L}hs+y;X3rkS$C zuNF|_DNTC;-0o>0L{^*j^O123S%v%fK%9f&H0?ygu+L4zj0fJU(o6gq#r@#9^yyMU zFBwvxcqcTH?Z&r}O1k#6j)ZrbwtRovmsGXzR(2{ByoEhor0`@O!0a4iU*oSoyyHiM z%7JuK?roQaz`2XPAM#*1P5AS@3-yQ6l_~&xk`JPS%&6N;9jjlV$3JxL&U>x^kx@Iy zY?t~4K^GxhYncL_7HL-+su_@jir2d|dDXX5OM-7p=+Qb4)Nh-mVr(+lKyccuS0*G)x-dE0?tMlNUi-W?-os z$xR?OSQ*dLc>|sQQUYxN5bMyegfB10Xa-ZSPPsL`Wr=HsghTC*xKD3AuSUa51`wIL z&9Inm$oy0+I7vO%4NlsvBEvn1^*cP2hAj>K{^63Glf%m$%~g=p2XeqqUityk8-)v; zmgAE1u%l%#jIBEE&H&}PrXE!qfur=L(Y!HVy777{^(!Mn+|y}WGbqSY$8Riig+5AP z(SRT$DZGBS04o{L&kf>JdMeEd;a-vI;J^|%(}zlRVW%+<{=kYac*ByfgTbC2Y28=K zP}U-Zkd_undhufn9j2Sploa^jGcP-Wc&^fV6(sNCMz66HwzQZO0ZA&>p|pK>C+*fxN6Q)g0cyM{$OK@@O=IpTBw2+ppia z@4O(>G;1qf2XVaRmv){`$(9V_ix`>T6%w?T9S6Ia)>4%M_kOa4T-SM3ULTvChcw=^ zjb#LrS>ir%f!A~?WFSP&Qg=O12Gv&3Km<@=q)lF49~GuMD}@+9$T{SVGJ_A@|Dqua z8ZY!pqX}BDR{z0IL7?OBe^deuVe>=07Zle~!ON0R+GR1V7M2@F%p+W7zXl|0r7pn69S4q5alWydzMfo)l7`AK!7<;LvRcmZ#24QZ%mxeSzTt;aWCcG2I z{eke6B{%A;uC*<@ie8k(A(_x@r^`+;kK973Gt|Y;)RGbf#q!YkCq9g9p#b z(rX#7#Tzy7t|ae!)10QZFa9%M00dl%uqbno?gHYU^NA%aND$#79lHBcUk7gmB{b5M zN`4q!Y14)yxY(i)=7c!*)!+>TT7c`nc+)fW7P@Kku{m$Z<V(y=UG6+4yCL7qFv-2r`c!LzrJ$@5Gr-J&GcM#r%5 zQ5qKoZ#gNbgmSJVY{X1qGMf$}b-341E}xVHl<}k-FN?+HYZdU8E=*##?mG?Vn9_L+ zB=L^eL+hRRen2lZx-?W+hqA;64VqDZnj+kA*VyU5VD##V^=~0tz2nW;Sj4nNX$z!* zB>|<7{4|*P?$2;O$mChnRi=SS{NVG=P+#4d?~SqSw`|2O1c(t_d0w2?{P;zrUDLtJ zwA8=KU7QcXJE5laTA&Gvq@roq*Or$*_Z#z+pFZ~U#QSEn)GlklZ=G^k(p@x#waf$d zr$9U&m1~k!oB|yL<&PtL&(`ARSBNxy{E!8=oIqk>h~WNONBfSn+D6;Cl47DTsTY*< zx?tf)@X3z~p0J_yANR@4!w&*4Ix@56ZUiZW zu4x)E&_Fy~Kt#L-?k-C>!MM}4fAUTVBK>qcy&8fyO|~oYrW`H$<9$ouXS;s92X~y} zUO8Fnp-r_ge|oG{;N`4FR|EZ0XI<(x(xpK^AksEg0ifjL(j*>h;OiXzkfU);K5kX1 z3Wfi5i-9{lOY(YAI^V}BXl2KyLV#~6;nm=xCB0O5>W$3De@U;f5z3bF>@TZLrK;fPMR@1f6vIIY9L;Y`23Iy)i z=L>Wh;GPKF@`^{I#Ik-Gx${P+IIa5er)>o;KUzeWO?)F~tO(de+kvj5`7pr)ZZMc1 z<>Ddg`HxOT?V7MpMA`l_m2WhmAkMqdkkSZE6&u0vr)d5UKl?HWB+VgmKZMbjI{cp3V&wShCtpH7y`~2eOsYs3App-~lH)o)58;hl!jiWY9H| zx(#t?_X*_H$h9j@^yYP$u}{w)H<$0q#*ID4_u*K8l5$2OZ#LJ&5A(F#9*2Mn;Gd z)GEX?M=K(l(VFxC?S5%W_|k$Kbo7FFcB2f$dgb*}KK7+|BRIpMT`&(hYy8XMcNNn* z9fjW+Z2-<~faP14NB|%I%l+0Ij9X07s5;DOKoJ0Q*M(oe`%Kg5y`3M_cp_Ab?|+$L z`7cJTMJjxg=gNIn^af$Q(|QhFThL&T?Z#Q8Zf#O-ejtgGjToS1l8 zK#)6b`vfv`!Ou!o2-%-5u+MXQ6L9WsMHm<|RQ@p0(c{Nl<5)f2xa{msnywN6YDfvP z0Z!3Tmxv#qcq(BFr)W*_wzxmgf5wFG_3{&Vy~O`dr;fKO&6e7gX)Du42+(8^A!REV z7C^)tRB2qBsYt$OzEh!I-!F;#9}Ifc@=g$5bQy75k~334UKr+g&(YgmrEE0 zj)MyBR>pFceZg7b9(&v!1Q%PNH5Jc!%!dMokaW+4{r7iN{zcr)LcoxDUKjQU z&fo`QKmh$h)AZ8=b=t0|D1?8!C-9pOJY~Xxx?B0k5V_V9 zWc-D7y;gq1mR~HWN6HH6t22;lQyP6(UbQpkom_}_k2WF2ex7ll9yuCxrC~J$x0DJw zM3ZI&p=*HE6zw>-S%yQ|v<>&4_O0jFR`9w$K2iQ<*KUL`w$;khEqw0VsN8OtrfA4F zN${stD`8cZbQ%Rzp5r5VM4m5R;ql)*ZzZRKHYd%<(GsLQVgy>w6ZvtxqWO<=tt9E`R}&2uzEbGCXN(?t}yZK=g^& zI)=cpi?CjpNh^Rvc(T7bcboa@XajQI;4Mo$FBYfi?V2cr&t(-DML#r!8-My^D>uU2 zKo9bS88;{ezHz~{4> z?YBVcbL9RCXL{2RyjCNfp93p@>8WtPzF{U@^Z~z}wKGl=^X4=Km83r`>uYvDl z>B2)QiC+DFVp-dK?na;DVP2K~z_zPwSVDI(WHL&x`DQYFkdW*kFD7^{D*t74Ur0+> z>PfT;_|kd3E}g)}Fg*d+-RDU=8nZ%}U3dI$EDFGy2`iP!f>oXdGGH5V=gcs&Ii{)} zk#-50>Oh8Bsv`R4Sj0mFO+@612e}BcEJ*sL;JX%#dIv(8R8K&w z6`Nb-aXWtZ72|s=?)8S-9{Tf8v7dNSk_Deywqifav>Rm?2c=@>r5&04qnlfEO=vuW zoA&T~m{ccCsL&Zy@}9PdCsewo5x2YNOK zZJMqG9axD9<|P9@2&HR-5FY-+6I#~%pe0eLO1s)g4vdMC9Y?T-^(NUAe)NX+m%K`U z@+qu!Mx79e?o0|{=+8!Gd9H52b4Oss z4&5uzwqlMtFlH*NE6poQg=DXnU1~7+7I;=4Ums|+6;zeI5?iMhy4SN^{ zU;l(DAH%zfc!qmY5X4Uv&EoM zOLSNW%$f=gZ3pq{F;SzT78=io4V^*TOaB>Do&-YXC@gLicKk}Ge$das4_*_`cIG7$ zbT(;PkH#ec9Y_NKPRJtfzfn(J3L=L&Kh|TL*NufV3#-szSTB z{23>><6)$Y8-E(}n1ikd?TK=)WFi!{%lrK77|6pkPyGS5mX-Y2l!C>r{-b_t>QRDr zj>Awm$S*Pi6Fs4UzctD-H2se+%*?1S5&ZIz9&I77J$en|>qG3{$d!4< zr>(t9O3vD@0yRbxI)WxnGpIKY?>o^3>-?l)-xvdaG~)q%8dc&+1e)ADg!ng*`8itl zF$?bGQ`-hq2lK47QGg3KX|0aL+vdHBplxsjTH!rs_cnWA-<_#3^#s9AZ=!iko@WA$ z0(mDHKC)Z`QH@xm!Zr&G?x~L9EvYtoL+QONuf3GE!hF0%#c8PZpE1ul*SqjXkQHCJ zDIiVXrsr0z|bneK3O8|YC#m}hFzTvTXK z5Yd%!Dl)2_Y(Dk3w-qlyQNRVxhUqSCp`OE!raTx6R<+|n=OF+xbda3kCGSb}6k5e+ zjI>9h){!2H@i!pQ8BI6*;fH?#LU87(&OeA^$fn>$Ye2|;8*_)CiVi~>Gr{(rXhhso z!L}WCv7-a5M)AMlH(YfGms-P?pXp01uqCm)z(gNNca+N`5^(tApfvhGA*7+Z;l(9^&q(fX(s^#v2;>T&vClW_hAR z%kFKcOQj~!RJMDm6nzv`LPb5ipJq{lAI^Eult$}myvrir9|Bn8S3iAKNhMlQ0haHy zpzF^2{(RyKVQlhtvsNiM+*bHc>iez5m(68hXp1SdUTp#Xb;t9_HxN6hS6;1?pNwhU zJvluInLMb>ZThaOdPu>Jg!tyh^MYCVSe*+u`DTgZGR8?r%^vvSD24OJRdmkH1J`ASI??ClF(BOA|R{K+zB!s4Y6J=GuZ~y4+ z58z{=Py+FHT+Q5u=HjuFM}MKhCvOjvnTL`e1qQzBpF>~a6>X`|=`+u{{6gk=WCS{~ zP)Hk^N{Qc`Xu(QIU;_9ZumxF6I5dhWL4EsxhyDTxvOh8m7azqNd*u;3H<06fVNKg2 z$V!Ky7#jK+Og-X;=2{Ne{U}QGgb_CIXOL}l&&-Qr9mM4tY9Q_h1fPRKwBf?|@JB0O z2hnSAej3kc;o1W}w2by3R*iA9AAs*!bGY83D-XB9p-*YpnEQWXrUcX#qp@@wL$Afw z`2CVGpE_VUi}jkmB@PHrdp-@;0Iqq*7+Mr{;|nyQ_URxH0(q(r2X2g&@MREps|H2} z7x6?2pV`1Wc6iN&PTZW+`HQE6lq#B0a+~3ya?mn*SCa{(^CEQ`ux$55d!q;T+ihB; ztw`ezg~hZ}8r7}==-PmN?a&FBMu)wmghVFdU0^j{T&QQJ+T;hLY~iSYCz zHQLFy63;}4hY_qh>EQiGa2B9%mmDf#XF2?A09oFn6NlSBA>@8(dmyXqgxT!I(J4&SE@52z_JD=Ai1VS=fe$Af78l6r2CKDos-9KgUSY8p| zSLM-zi)2@Ne1x8(Ctf!M#J_`Cd!mBTVx{i=vyc~5=pzgpZ%de@$6E5REA=2;Up`3=fw*cO#v47@KckK zhX}3K(UHGrogu&+ZDuQkv||e%FtwmlR0F~R<@f(VasN*jWOyfPHjw2eh8ockR_5*s zdU5<^!kd9$-XlDr1{2ukE9GXw)EA5kA$?S+yFMV+oFK&>_Wg?y8;psn!bQ-Wmi3aRQALB+{6!LS_jsx>+-OD}T{#{IZG^i$>ATQ`I28TvNl3%!%p#EH>rL(Si!(C*NPl;!hB+(&txs|3 z73UaV=azgx(y%24*kVzg+fgek%tXMMjRlMkDHTHuLRIR5C#Aqm`XlJtwAGBq<;rMK zk56mEvGS2X2}j5u<3-x~dg9Ws|32FQ1U3gi!)7H9Srm!E&=ld;n8dKiD-eM+`}k2q zUtiuD@<0z*=$~Bh3f&aIe#U7hJ;+G`w_S#xU8;%D826c?si4=8ZUM~ggFr0;;BIHXYE z1=f4v6bQjC!D@GE_^O=u#mpF)eS0q5nyU~BB7Mq#`8r(;vE$TNiQZdywTdUB!IHKL zLoqps%xYPNF2Wrf-Q>Vv2mNJ$OV{7kWlbTO<9q`nBVhMda&mGoGPN04*i(F+8=r#w zhVq;STzI@P8PFu;6DSZUd)7A6Jc#tRBuzm9tBAW8^+id9$7}%JsPzW9mkR^ahx8^! zhb8<{=R^DLpq&?WohBeNbD^MZ*wHXPVGN9!*dYx7IR>}*0B!@wj!{MzkB2fN=}HH( z{h-zIP%tdo5d{Korqfj%Kk-C#5?{viQ;7|n8d)d5h{9yX+h8lx*>IC#K33~ObPS;} zP0;>bR1Nlc%Z|RPdD8(2QV$K)mD7|TtaBdOZEv+6qHvG9kb9n)qeohVd-Nmo^D*`| zwc~qrXAj)SkGjDmo~*zy4h4)UN7B(PK`Yv{+T{qjZYM)=$A2KHJKEE){f=;XgqPf! z|FtMboOqSx>yrGka#;6p5MR0@pI@s2?hd+CRnlb@4>ZuK0_ab_K`T#T&_SZLH8Vzwbj=?&PY-Aqv^1XEWv@g|VlIv=W<(j&NG zXD%DjsH#B%D^8nLs>z$BJO&v_TElS0X)i&HcO+U77_akmyxq_=)&}>u06*Jz4}ixn z;Byvo?r9V-mHlI z4^Uq~aSTjr56<-pZ^0lYq21rtBF}p~D?xMLHS3b3zeV$AK&0q5G4THzMyI^4oex9o zmGgNJ(jBA0i0^z_$>ULUBLUH@rJ3{duhv|ejN@Ao+~$^tOyO`sFA`iN7a~|zGUD-8 z75gSc@BX%EdmL-fFry1M{=g`{vL2eZVgR>6BN~AmM+$?Ze^aj=jncYTdIrGwBOXS% zDPWNp7JkkvL7ht9nrT(OwO*TMGF0+R8W9uLcu9}XQW^a=1)kJ|6|QQL&?uXg3<|P^ zN$k>yVh!x>443Rz&?zY?$A32el_@(W30e9s%>gTW;Kvg*;SA}a3KE=$eE;URB7FtA z@vtB7m}zCYA#Lu#teX-FbF+TpV(r{r!uL-2?MC~z?`@a{6^=6DY)b--iVF&m0QIiakcE~r)$@t&)FZAc=Ih!}KjQJ$V!A=mzNxe0VL>FY_Q;#9- za^Ejt%^AJsCK3kY$Ei;ljcPfdkkGi^h8s)-2YI)F`M$}Rpb|zCzj>(Qr%N5+^OV-0 ziF;bc1PkttBTTd_j~EujsE@&FJ``a}8>Wa1-M|ZlvMN53(4yU1sec${Wb|lJnn1W7 zD4>fro4`=BFxzy0wz}p+uOBKGZt~gWja+?^UiLGPL3)n$M34sMphOd!0$N zcCdG)V2Y5|myAXT6f~`pWDkp*Gxvf6y~?-p!7qA^ggizNNI$;wn71U)he8uinI@X> zK18NFn9+!*t}4IjM?kFS@Q*3JG(*gM;mb^19%K9Mh$~yZyq^46_|7{fxt7>Nt3`w?My85S^;zQ0o)&8PCX%nQE??vIet{rP~lZ)Kg$fB z3P&`Zk>Pn|*y$6U262yMu5}=~hgiyKa6$@?#Zouq`teg)=O5f>9AQMrFZrZXF0TzS zZ|fT^Df6UmqBakOAe=wbD!pVHsoO%NBNjB11Hd}t0oA`hi_rPljInHUu}5%PQdLzo z7K%;o)NPM%5YaKpl8@*e*cx>~qziz!Qyx=>KkpjhkXejkXmJ(KMB;2vY)}&|lplCSjXwA+6l=cb?MgkEX)$#7M#D~Y1wN3F?Ud+9OWJPcad80qc|?e9U5R?( zFcaq2kx{L-*}Gx|D{#~ebbWzbk04Le$%t52CGGH|yCmw@rkgsSM1F6C6oI~jbP-@c zJ9Tsz@6tsdEto9nhLP<6{~m)J!79E)aV&zbwAy$B*{ymiEj8J;=X=^&@=}m`2TdAC z=?8qr0%mEX5mWL%e*EBlL!4%51glzw-OtuI!5TiCV_?t|kobNR_eJ>y`2_^hTuLJ# zVFLl=g)zI(49YyD1Y3PUacrl6rxfYj6P_}H;Sw52<1a5Q{PBj?N)y2!Cs05V4K4?L z!ps?Jbi5W5$d})Y>ClO9QuU*B%Zr5cX&dl(qe8tIaG?hzAJ_CITBr6KWc^FY49K=Z z4^BdYQ!P^Jipm69kK*+1Lra9ojjdvJq*Q2h#qn%=G555gc_B#$g`TD~XOhXg%Bi$i zW{hgX9)AV#u8E{`6X?Mx52;YMI~=|r;4}i~-SQ^J$S?SOxdTnIj%vTFPgjw6K@R=am>DGlZ2q(2Ys}J^8h$2nQ-=VJZi< zzj=(7E3nN+>IHy|;t11juIL$4 zQZzurL9`Oxm;YPO6LMr&v#YF=&O*gkh+aWTlHst)^|9yN?20JMz9c?SmIg>dT?=l>xOrxzKT9 z4#r6;eo4rgL7!tZoDY%i0e~)LO5wmrrk&w3GdVmXEzD~#@~f5%rlNlUqA_7onOBB$;oAe9fUrG(-$A}txIxL{=23~7~DP9)wu6bE00?#=;8occf9m?vdNH!91}3T=YsIIMteojKT4ndc|h_1=)D)DH|i+#2e{W=2u}x98b$c@n;%B?jcX7W=a*%okZ|Ao^gk1 zUxvX5Zi;Et+Y2*(%isZXdimQh!bd0{=j` zCHg&LIQ)it7XTaRt1NZP1NvuC!)`DETOG%Va!vW)ooNu?AolbC zkij1FWL&KXbkE=fmo-WDn{y;DH}-nFkys z=a*8RRupD6Pl2dU-n48H=c5auKGGYmG5)8CKgFB9_$Gp;<>);k0?~dBna2QXy2~kE zeC%EW6CBhqZ7RXIgfR^})1+N-1aHTO^ZPgG^bBjb3;?_7Glpk^C?Favqp}9Pd(spR z6n_-r94V}D0kLzXF%y1w8UPV5#qm2PErNAvHHU|~Xirr&RJ6X6deA+jiNC2yD5TjN zij@GP=Jd4x#)!aF=B0s)dzGL>0HvumJ{*A1cZe{P`u>)5tCbEXACR?*#nBI)5I${^7mMT> zP1>*a)oL;hq#0EeE%AWP?6gWO=$JbKp$H4i&p&w}t?nn6={+W>1S z(8+lv-}nJ+A7V7Jc-j>~s|Sv~Mw2df1n62VMiU>j@C#bQ^8o;PtJp<1)`!F!pU1Qy z&zB+z{H{bpKH@1psquIX1}F9GdAkvBy-K2!A~@YTTmfEb{t#d2xMQ$SIh2+ZI%q&K zNT2)caq>RR4uFo~IE0-IbF{+-@Gt>*!X)tM4HkHTq~;7by2783)7o!nY&ch#E<5F0 zQ-LG#tSIbymHXWa(qkH3X-*r(n&?s?oVB2fYYDJNKWGe$eHxi7zi{iGywZ+_p;TL`0!l*fKH1lxDPnvUd6Z(Ea zCQmz=0G)M2<5?{l*3UP0adYFou)@MJoJYb*jt3~^UDmS`Sal3UUmy&l!vXq>>OD%_ z(K_wcDN~}|Dn9nN!%Qg+s$i${UZ}GO{jHm#4AEwuZKk)33MZP*l%@-J6}oFdx#Sc_ z#`sD*%_7QJ4w!)nfBs`6z$QV8`PT^y~l= zx#a^M>q=;9f;Nt8s^BPSCSAer4*52Z*2DPC;I9O2#ANYy0Wf9{#2XXkxjdMa)W#Ea zrl3&IfKZw+P|^67WXVI&^lDBs2G;?gGxQWp-PPZCM+TO%9aLS)J#nU5fhd36fo1gP zBotTwmrE%-rD*5#lL&OV_*<&~`Ku;1cj+(45$xZnWO0M4ZaUe;A~Ggk7u?b7ntuffMK0En(~E89BKpolFe|* zORz)qIxMAZ2vy??3;}6Ep>Lrb2vB25X^_HtUWg*i!w(PnHJE#USweqEs@FwA`QEQm zU@nw@FnLIYtCT`&9rq)$~is4y+&fz~!m?~0Jj(`6fw;{vaF zM_9u%HqP|w5>=i58{R{>SO!%%;!PSt?eJR@!oi?$CJOW?Ef7;aj^Q{8greLct?B)P z@o%G%Hvyj*;HO+9al+BdVP4Gm@t057Z%j0BvtgPzubrrU8gPYk){wCfsW#1s^-Y z!FImX2@mz)Gu2FMfSNkO`tIAcxVP#!9#o_W9c=KvRe((?ak$Ksk-mDfOatiJK5`oAsrG+Z||PqA`_@lX*ImpJh_hvcPRWXrrV< z4Houp2t91^Y9LRQ@=OfE$O0f~lJC>q^^;*NN3i%XBSc*x9mFwyEPjC>OHC>|@$ZO^H2)37ep$EfV zqAxzHkIR6>)_!3)qdbv%wPDV;x~7$O?y%%x6{RLRl);szy?IDJ+MfpsFwrF(Ry>O5 z#SYEHj-q@ztd{)-)xsnK^u(myU`$s~;sG5O(VHQ*x6dQhd{zgp`Gk&2hb-?vs7A0c zhz?qrjdk?@i_sA}K(~x1t9e-JuMjWzwoH$woOrI2_W|YibZwl*Hx^jz4lX}x3J5wg z3W77uN_$Z6Ut|;~`gIv}@4~CKl6tzZ-^MthceN&ynduI}p3|FbnNl=zv;~^8wh2U# z?e6q6vZ@E17eCprx`W;q>U>~Q;#w~2`$)iaP*v@|5n!vK5>m0 z+^vA-vO65~mc}|`0nr;E3`Z8+pF~GAVq@!$M>?(K!S1>xLAbE?4SC@0e`glD=$Q|* zL~HrgP1#1@B?wsXNvopxB19z=7_mj1cGKX)b{?{aL_dLHW8MT_LzwRu<6bKRkk1+J z1FB7{(hK~`#T&ZN4Gt3;LPwIw|A9c^u=S=N>M!9+RdI z3qG@mcFn+H2}e0ll1WT^^SWjz=>8&}l922R3C*fobmIRHpg4zgl!%CkW5|O+)LWrj zXT>MEc3mL-$69n6XG(kdHD&aPX)wU$D}AA&xQLPt)-*0A8k7bd?jmH&@=7M4@X`@e zO@u>LPqCr_xWteg(tw2=9;+;?k^|GYg|wb{y0{tB6}+DiYz)AIxEUkX!Enk+$Vq4! zqP(Sv?gf&0KIj6P@A5#DUO13y^M@U1))YaUzXE{cgU95Ngb(ngv>`OK zqU#U{Nq*Lb(`>sWKjD!x`sgy$e+v~Z?n(FBkRDp9F`ymKl@Qr7zbY!yr8nP#r?*!@ z;g=ckL&0LEalDr1t-ypQG4PAk_9isNgE|dk-y1k1FbMN`fCrv+3E_A3J3Z3{255W~ zcq@!16V-G)+xgTwvBJ(75P1ny7|hhSLsXonlO&76!a^s&%S8o-WKfnkb|m2t+oTul z#=t*yU}w`bYEDa9_~}{1&fXra zb~?hXao~0tH@z`W^DvWf_2NrMlaf*yJkQM&0d~(q+|t~%9(#Gf9fz^owVX_d=Cc3_ z#&Jo(G=_rcMJ>XH_hj(rHy+^8Mz_XtH&kdz5Q#AH-Cc;R{GRXKG>~QXi_?UW2Oeqz z+T0Un)`e1r4@5N$zhBa5pamseWl^540O(C%=NKOmhSw)sC7|Cy#DOh!pm{Gprz-1v zHOfOyLedQzJ>gU8)($hU=I#7UnDilSadwC#b+T23<{q;JYhBYkO`M~VwH@dXqqi}R@v6Ne_N@e93 z0QEa>IP;}3qUJI{=jA7?<;qut@6u^XjlTZUa?B9gnXH=?JD3ccp?d2aka%H8sW3h$b`R6AP`SA5_}Sf(O)?XC-AFocyoX<`na>SlnQveD#dX` z9P$oM=BFs@Y}g@&R$ozmd2Z(AW}%pLECsD?*x>LoUDaU}9dz&lCU%MyZXj_x0L}WO z_a89om3WMQ#?oA*D{y#~=Y?kRt~d|{Bt`G9auCvP?p1IGJ?;hyd=%#@b}88KTa7XI z=@6bFcL;K^$d3~ITGNC&%sT80;V=s^<+TxoV>?>^WzW}I$fvI|+p*7O+SG(XAJmhv zg*QaT`*6k+2$q4_v#`>6n_zy33IYLx(s}nEzFZfUK;#)H zdv5)UzAV9oCXsOsVQ!C(yYP&eOZdqFWIXWW2hDY1P?XQGy#voW;h`WKIMzYKt-K#n zZ)(K72FiBQN(TJ;2b^%9myPles#j9|U z`#2nY=7v`FJDg}!6`XC@&5B=QOTBQ_4KS<=n#T%p8&6hejYB=s<4w1{KipBy~3wq72XjVNd^QY?eXwFp?H|#Hot+tN4y4L|kwdN7o2Z z;Ia*e6h1LUrOemXN>K1MjB%JIQ|VgG?ynBt zNBKmnE+9=B{RrOqA){h}h=qs$cq5jbrP7QStq0pEaKDqh(l^r|{#mrApxwzIf$4l8 z2b>uBlO|SZS}h}uKv(Sp37mY#(Q;9mD1)#rc{$P}h!*Kt){?g*Pzv$E$?hv02dmbi z*;IG|dIw4Mv{M-g#&{)74?@2g2a}qm_$!+aN@DP+ls|l}5dc%%>ZFgd3>CK@cCvJ) zZh;dJ7}eGbOM;2b!|uNXWZnFYB~2-$DJH;im$?UVRA?I>%c&NL6PrBfZcurcCO zV}1~WfqC#r4qs$RC;ur_$6K%XpioIw<{NBg{^vjLF~z!m{HF5^NvnVGoYOYOlOE1s zeb0y)U`tE$!0u6SI$Y{P zG^d2eo9Qsh9>zgKCDL%k!{VYMk1pPkazzNn*uQ5Zed1Xhx4imWGN8p*yD*|41`||8 z>Z%s7%nSZd)obje?vPR|>PdI{k%1#bSmH+{7Tv8O&Sxfgh=Q3J)_9#_4W~s_1Xms6 z6J1*sD_PJq7Y_i?Y`V8*QH3vG|HMs4HT*l;X#Fqs24JB$(1qa`r}|jTvntC%d{YVv zWkULWM{g!T#4UMxH<1iX$wAWjN{71Tknt<9k#5S;C1l|TNQ8J&+>dtJj72TVas4k| z@G3?C+R3DWOv>vDAHJuSRQM{`Wj_cp!kqqZXX$rL_asn5{Zboh6 zG=9`$v9Hzod}baEo12j5iOiBZx(GAFipN}WQ6aVa08(Jq>yHVYNh%;DZn;sfLKy=6 zI`?!6RibGDO5nXC4z#ULgTc9eG!hTMf8eVG+W+lKAGx$&gXb6=VX#k8N0lesWU?IW zBw^&J*#jPrIyHD4Ub0Vp*ydy);{KV3JeWV8^!iOMPYJ++8J`wUA1DqrSil^fffNP? zfTvgP(L%iussp{dq0mKbeZ<^e22B}b+2(NlWvw`^_$rNs%e<;d6HgN9V%r5FK#z+ zG-^hzk5?QE$}PE|RD#m=_uUQ6S&r0}J0QUPsiJ%A{5$(0E#<;q7wped_7F-BsblGO zKcfR|I$S2=4Lhd&uK>%{3WrLQu9g7D_45Ys$g$DL|6kT`{j@MZjdeII)8(mMzR!9mpcLkOxl#KHav{l|(y!ZDZLLHx@JB5F^xk1gljX@vuV zCuEdlf59U3`Q3z?4C0D(r+8y221^0_O2+MKt#u|Rx-Q>?^p_tZ+oMdLm1@Rg+|tjd zWo4Ifs$srF$sg)ZKg{v!0V`k7dJ^_ZkmBPZZQ8@2H?Cocy^b0VLt=)$r!JmLZ^j+# zh^BghJEDw}OQ>Pf9gn5P%O*CJ4X}UTxEtDUFZB;}0A!naf|CAW=Wyd4XQcXt&c6UJ zr+EICCy3K0=}gnHZPM&&7b0J5cmsRrEIpE{^OV(VlcO}`g*;5v;Sxtgw9nJRgioH3 z{||Szp`C|43F3Z`VYA;Qv&=k?DtJ^bwIq5F;1=xvN3eDrkR$z#WYg{%$A`wOwd<-< zCx0&FQt^co7=^kl{@9p$tim6%k$z6TBvj~6m$%kJic0CS-(O^msp^rH(j+=2nX-yX zr%;yU|Lj0yDKIw!EdR+$%MX+qM-#qOoeaT#yzX#6xDmfOr*`f1ak)$pb6lua|BENe zyn+PzoFan-AW9#{QTwk;G4Qy+@t?EGf`wA8F0`p!*F|4c`+a5{h&D+nsx}+rnm%h= ze2_zIF&FgJ6j5Z$HX&PD?Ps+9j{k>Dk?jQwyQv0tKZ#iO+CI?Xh;!O@JMs+@^o#C` zm0OwFuNl91!Sk(0cq}iOfb5OO2D={A!E-UF(I~gv2ho@eq;uVs-?Rf)HEeh-%ItXY zIX*(!fmb?db%Fgu6wkQqK+@+O6CE!RF|T79)&cC`2pCBgM}{p; ztGw-6mmig4bxjt7o%vr4Qoq+l$4}^ZlIbwZ=@uh*GWrti8G&r~%KvNwrTIT;da1PI ze>-Y@=h!vJH&!f>X)0Y1bRti)@zNQi6A3z0ndh6Klxq$Ar%t1@!#OF^`qYu3Mo)3( z$1{VpH%=C*(xQmd>ygykTzwpNOB>Dwl=045nGBJJOIWob2ZoxvmnEk07UN3SOQ0QTvkuaKN|a(yn*A*vBfNi5m;s~c{XHX6ZrB6c zBmc>#FtgT}cYy@;&vZ5A1}1O(q=)vTzUDBR>1XsYdj*<{{arx_<2ncZD~fIw$-oVn z02!Fp%=3S;^*UKk)Cn_->(q9?Y%-K_u&~eDolx*4h>!G~yljWk8`sbgi8L?0bJI^} zkm5~@%!W>sv5Rl~YNY4vsi!a_oVX*zWB{3Lb7qu@kw+hLrd9lzm#ryRHi8Ot#u;gu z4(8g|gM;N~wpXduZk!_c9lc6KiwWTwWiJ#^M=&Q;MxNfjj{RNdwx$vP{}}~+RT(lN9Vev<(zxbk82~P>!igmS&1yWXU`yx6+zOz6_klYn|hh%b~I+{m-(bDyewyVQn&^U$cC;39H64*WO9v{X$zBW~4RHGa)@d){d5B z`AdVB5Rog>*3HfhjjArs+;>f94jT1`e=G~hBv@wu9c81CaQp0Z3Y7yqO#O-_c6#1G(gLhV++R z=A1vqks~48vw+XayQxjq*5D{@lMQnWcl!CRe6!x2g(os{?RXgx-Y{HLj)NJ%Bu6;- zW(R>00uV++YVXM)okXj?c&Bpk#ti)$U3CgUd}io!3xmPcxwxaVbvIta_jcVlf^v@T zV~2xAw0h*cHoEhakABh`a9w)Ij6CwPOOJH+0u8$O)#jm1Wmhm~Mr(KT{fk*ULUi=m z+x?(E1p_8*A{8@8i&6JLtuQsIyZ@CISK0C_x4P|Xf@LWs1gOdvW71?jc6q8&X3u2H zO#G!I(r~PT+2GQ>-{uUTZj8q-Y}eY0*_Vuwup7H#^jEYs?l!F&D8!)cr9wVmbMy+~ zu}+rMphMnir0OyEO{eimN$_b~gpL%Q-<9hsKksRMd=4pk{aMM|TXSXfz`H2i@Uuqy z7UAi4;Pz)S?O2iyp4YPXwr*aOwHz@Tjj8TDaTLn^8F={Ug}{(+7?Vaf);CXc!g0=H z#v<|fk#Y}Q1ialHQziq-&+RoK&KJlK+N{zMVlRNg(ZyFy!G3*4ev1qyUoeHkp(alzdDyv!EbqJvZN3CZfW z*O9vqv{~9+Ahqy+X@ADkDJDC3OgECG&M9_BE`LvXS0VSy7e<8e#$g0`F2y0o5AmQq zYay~lBVWyH0?8De{ociS{-MjBh!cf=nF#GD;=Vwqa-a^T zWEN`e6YVR6SP}a@{mPT74%x7|lC={JV+a#FnEHn~fvyKjw5KrHBFV!xD(x_;+lcsq zRQH8ZSuHxdFGEIHj5LJf&$>U-_Z1;fkdDVep}sO9-}&z&{CU9RCiN}MkgQCGFc|is z9m?A-W1bE+nRjfJ1zF$p55nhUa*nMd-*t_l9HFSAseIDL4AK4KKcqOJx`g$*>Zw&mub|3@$Hb_7K`M z8lJD;qPg?MOj<;9bck7M*xD*HVUe-m=Q5DbU@X^|lO?!o(KoYYDKU`GZ|>y_3S`TK zDA#P0uGq7|ykdCA{YUVd5v6>@1pQ+tT^oU!|_x39!-mvkwR;;} zWq?EOOpK0sfh$hYKp01{5&N&#i}TuI41`%@G1Iha8XcA6m&>{CYPjEfJE|=AlNu@Z z*puiNE+e;g!#W4FHD2lpUIo5^JS|WsnEV`AsXyf7U3`kdVS=Uab5On}%m6{jA56ow z;lSst>8EBHRn{T*^;cM0fquIv-wi)*#2eY~R{9VoEDT2aP{*KrptUah$NK6A9iYh# zob8gihd5sKSLn73%H$ls9PyW5yWVB`B*sd+lNb6otPKJAGUHT`6)BBY-bYaI!T5CD z@@DYDD$w$k1q}V&?BYBAt^2Z!h1te)bniL1k4&|fo?vbt+WHY5P>`rs0l z7U9F;%zMxqbEiDiU@sVd)_C zh-k1SI5`4nwb3HQrO&2%%GYph`40fC;T9-h3XvZ#j-=bW8eg6bO7RLU0Hsyps@~cb zC|eI+X`e1e9NMK@q3-O1AdI!^zHld#YbJ_f81VWC9H&J2@=7|br8W?Y-E|LPVvGxG z-2fR{@}l!@@w*>aWaj7{)0w=RHrcZ3p;f782}|Y4>Prk@%SrkEC_ow`X>B;}eV+Eg zh|=hNP7V(a+i`^pWm;pW9Z|X*s8hO@w+ro9f-g)Vg-sbUNd@d^!QHTAnbtLv))wpL zQTZKU)`sUhaci)upTIjK8@zrMY;4RIrprEg6Zhu9^^^+q?teKleVuJjYKvWf&OFzN zLs-gcne}=OuJw5&U_%yA)|FTexJkZdpS26*;M;AyFM@deWH)M4Ipx)e93vk0Fc%s) ziR^5c6VTileA#Z9OAeKBCs{b>09ci zn=xEE*w+O8#5#_e*t;Gn~gWGaqFFX!$hwUdkuStrk@L(g<8@Knet*w6SC zyWlXdd|l9*3^u;WIoG`d>kE+Xg*RekUs}O9+vAVuJ?k!0BO6h38G#!+{VD~nIJ8{{ z+*3HvK3cK0!>ILMD~;gi+)chjfG1W{Vj;$ygt-#{=XY)NtMt{c_?HJLG`_%W;3vzqeW*F_Li}_q#n|v&FK< zi}m@=4hDAJcqlb~3?1N=#w26rKbhs%PN}o;Qa%m-KBl?9%}iCdtE0I$M*nW ziKzCLUSD6|d}^$WfdKS|+GANJT)@0ZS-nr1v=x!)%uhPxx9=t!fylJ56*m8jFJZm|7C(1(yLY2IS2F^Pa^T5Avq6f+zx%-rkOSxsHamw=+#BAQ!*;Va7 z=Pv|=>MrS4u1;lp-$j`^3rq<87%IV+(r}}!wp17H-Au9oi#l|xRKD}pr@U?pjp&CM V{Qb$DHpducb6f7mEG#T7{tsAOm~sFB literal 0 HcmV?d00001 diff --git a/pathname.tar.gz b/pathname.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..671f765eef81a4dc7b7a8b1a6ad2c141027ae6a3 GIT binary patch literal 22260 zcmV(xK z`jW=~8gd#d3+?OkYDM@=UpkBCc#+>bn|L#pCcJrou6a?^M8=>xhP!=f*Qu0t3VDh4 zVwDtVKasAe3)k$m(INgt(yB!XukZl(+3~E_&zcY#Z*!0cQI`0RCwY}#`I8@M;vbE9 z(>*=#JI&K4Ki6U~{QVtYAAHI9znLca-jkkj*8!bIMbRd2&{Ior33t;1z43T_l{JsW zQ%~D>9_HZ^9;RjC#ZQrWJXFM+O$C{?rLDDvwNW;>^AK~FGK!}`eifnB=%_jx5yd07 z_)|5E2RiwJUucbYXxtoA7?I23p3c(JRytAPYuXIsE83(Lnxc$FQMQN9}b7-Dl z%Q5-^Zlht^{~gWSmBtyk%7Q=e=CL;Se%*Qz6D`Tl|F|0$e|qwVOHwl5@=P+_@=a|D zEnD*l&(T{6Eo+zYHGh`ya|=C}@oX*Mq?Xk3GYzTH3@!3gJ5TU{Jng`E&)PgobFk2{ zX9+#iF$wqZaE9=Wm%=-uvZJC((>hACX(TI~rhccS(@aVV-8j`G^R}0A40m;E(-@EO z=U?8^<24$r;U|Azb5FYe#h*q071G{+0kz*t<#=BLYu;2eYUXhb9#-a?6mtyHFG;IW zvNZA?tJtsOeVY7{V`fQjzY~%&6X+=}o8}ziY1*G2VCHF+TDnP~`QLQHBQ#5kcu?JU z-j}3)+Q;8^xQEu{`GyA#YWa?40fM7=>JAUgcH;+Hg$;XCXpe_@lm~fMjjq1MwdR!s zDrm>hbs*h`(mjkjjVU*p@)}n4s34NWhdgC3MK9L)%Ucbd(@Aihuk#s>PX20=$ zj~?aulDcV(o@#gogv)0!g%KL%8(B9xq5*((*UGfg&MJk* zym%*oPw9iEd994jc_ouhFwb?Gb5{$D5c|$IM&IepOD2@xn-oN7gOAz@vFMZff6fYy zJjFdN7PKB_tjK4)V?`59$>ph@Qrbnd1LPgjEo~(67EQt9ABps!rbdgEfWR_s@lrwp zKhYWW&=kNs<;h2u`L#6TaLV3Z00>0<}>=N(kthC9*?ALEboq@;*X{n>aL|R>j(gEFxj!WycM$_ z2C!bNi(rK=dJfffudr|6H3oZy@@6C*3UN-OG{UcKdI14dbPKnQV&2o77f!zw_^wTO#*ExQS~QEK7kUz>88aTI0r+`OBemw+KVD2P zfWgmrs3oF^mwoKRd9RXJeCjh3c-BTLhvsZ)oma|JD(q}JI*Kv;4E1PM(+eo!SxVlI zF9bGhlQJwQls3S`mU&&8UIJA?Ess7h&NM$)WR**)elbWdhJE+v9pHQu@pgsp>)eO1 zoJn@J;GIr>6c6Km{tVzbDZbDEj_>$Wpdh?P0QzlyijR-O{FnF&cU?;J8}H$-`-;sp z0tgK&@k18fG;?h5q(tN7;jb@an%Ptmi zcVY>8PUnXNHyfCvj}UHO40VE^&vo5-+OG(Y+@P0lJRFs3lS8MOzY;uL=%fx9IZUJ@ z^};Y;+Mo}+79jh8pK<5CB#q`+rO|n79zXL5uW2H5#_<|~OILiOUH_K3HPTgLDy^8p z7%w%!d6E18kS{0F9dDNNTU?xFD46j02kj$?Od!HnqV0L;Yo>J7-jPVxQ5bXs;jzs_ zsW!0I4Uf@TNCCp>4tzWZoFDUzni;}m4{>m2RzNo<8HlU%7@mlW1Wh~!@thsjI#sCl zmyYs**`82(huya65;Nh`=xFx>OLJd9ZLN-mVa$CC4RyMVPAV)YFgK?|GqB&D6<;X` zQ@s_)(DS!C^_%lFO~mmFzhpQn`O-89anrMmM%`%fYb7H(bk?RXPSd~m$dHbZgZG;F zqFRGy!L|qGQ9;~KYpzL{_!}bP!;MzmG^=QfCTRhDwu}hNu(9thOsva=~jwY;L@%p0COV;*cl1r z-TxXAvHF1w1)DZ{s-g+t^p+2k>4ZSdKac>1e^?>U9P(I%4lfiV3O-U~`3i3AuW(TV zmqpM7Xl>palOEO()gTCGx1>H{97vW3cK69MB6;pV6*u zJ0`IskIVQeolY|7*aZZz7O&XJ69owO8@Tc=3|VQxPMEr-iY!mjT8cH#@=bEBGta2; zGv3%tpuGaPYWx@P<O)?QFr2^7bIW^dDIJEgGDnr`6gnItt&I`+&!s=G;Y;TtD&o^j`? zfFhm{r*kX&03HT%ZZZ5N0&$~>hhfF;B%ZBv<{LVUO}6HlYO~PH%xpZ}*4IB(P)lE$ zX@h3)+Qe%WzfJR@Rz7Xv=W80s%nCrRK1QN`b&x}7?xn)Zm+<~=oTi&vf;Qb-gT|ji zLOrSrQw(Ljcqy-0mq#%6GNfS$y?pV({(qpbNe_PFGc6wf4vOA}5%;aNc%z-hoM_`W zUE1h@Hr_#vI*5r`%x4F{oZ-V-8cD5#x3^>H6{PuU>RONGU7PVB%=M|8kcdkmZ}>uq zw{>!O-P%Md5{~P5w zLSL@6!d&No1k7@?4h#7F79^$X#1|5jQ+Uu~=g*GO3Oe;>bqL9@} zcL?>Z`n2zEHGaPIq>jh$DrC^d_gFukr!yGy4lfXwb|m-4L1H)4Q!bsBa<8iF_XIis zP^Ywwp&_|`KE9Q%x9 z^u8#sR#Gn}uw~@P$mO}*1!_D?v(-ZI-=HA|S%lbn5s?TorgsfheM!u8L%}hF z&uI&99pn3Pqd3+*fLB*0m~sF~c+af3vQ)y!k0&d9{D1lxARTUa%kuWuYYGg%p%BDp zu+gX>uGe{1UMQp%5$mt*eEp}wO_!d;Li z=`E8ELDP5j^MB)-6J`(Fm`2L~^Cppfh;#CqN>XtAu4r|O&Bc+Q=! zs|>y1`z{BS2FXwm%3XQ`uh3|Oq^}*V8EMd}Jbxl_8HUTq7SS9gvn`^{) zdm8b#VXEZtvjx(4Qo|nPhUfK%e%GSCd{i8RmJz6d0-T-Cyx*}vf6O|0oWl_&B*W@m!j zIF{E=0Q4Gyyv;(2g`*(=Q7buXSqhieHDO1m6_XgH;}+-xzfI!B;iE zKo=Nr`40{HfrU4HTAB^%lU@*klRn6aFG}G?e3YADSIgHJU>n~z#rRR(xDl~(LEFx} z0NFAPq^_qlLD*nskacGbboNt``vhIAO+ylXycDYuLOt5$R`mKuTq86BZhycyJ@vd2 z!-A8Cury4j3pPIy3rSYXbw`kPDa%0nUSin6bS!Bw?T2ehP7W{qYp#N&-cbX7@Zt|Z zZv-K5QjSN?0Y^)`1mfqeOdbc7cdO7a0;M;d=8X8lo!5R*pAwD0%O`EkkRXr$(s%^( zelG^1K|zL6xPIp^X40>h8_Xy4Sn?;7dqk>3f{GDL@5_l<9Wj7 zFRhf7N~H0)ak4-pfwTay&S7F(aex1!TzR#I^)FqBomxARnLwq!7$$I7HtNYH9_Ja99msUijK{b&ojuJMYT9u_+X zYrJI}$q0~H*L2EfvY;xu>Uko#wu1U2!2-i=a&mg;Fx^_p$MQK4{2;U$eCh5d z4Vu$ffpzJCF^am7lW84dOn@&er@WFHNgq(qOrL ztfUGdxf@^*k<*|KD?k3DzAPPa#}>$+%T&L%IOv;$e{tbOJT41#p7JZ51|T+`Ea(yZ z^KNR-qnU`W1IU$EJ9_BM;mKmD8lfS;C-#5RVc0X>dW6gaLS?T8B5S!W(Fw78B*E)H z=&IR==X6nv^!^8X3gxmSZrq@2xoS~<2?B>LS%b!&t7*jw%b7-+>-VEUb$W((M*!jN zaPA92tSq`yZ*{G0aU8vi+JR_Zn)3~L3t_hJ43D5o7cYnuD4cggUJUnbz@L_4c|FG~ zlU7vd*-n2+Wg+gm^NfTtA(WmgloBd=TT+6z>#EUQaMwvfrF6yz*=Dq(;6h8rR`e($h6tYd zPA_G=nqb(#JCeNTL$exMe)whXFBot&(!9(;x|5G_>#+q-e3@{84m|v*_aAQtCpOZg za(*~nYSFqQwAcdD+*cm^Z14dC%_H=medvjL3f#5$$c)!zb7@z`71KQm;q^o*`iM3Z zrPDZnXK~sRH3mPANg;0fT~a`<&k~K^ysv@5?^=}7_)UV3sw%|mifo0{ya7zzg>hfC zr`=awb3;QV(bg@rTuNArnE)~y4kC3zA1;@Viv!DeLY9}r;`25C@}>?Tu~TP5LpdgN7Av&f zkb7vY1OM;SbBzuS7S!=4a?OA#^`$Ey40nv2zLL?47v{f7Zx9q4adASASK1t9U~ymx zEI$QhzT+Ih`&m4LzRFZQmT~X<%|K7hh3||o?bmFDP9%t7Jb6x>SN-`}q+P?o(xfDy z%0ry@BRb%wwOSe$nxvxX0t0&oaGw!R`s-mmkGy9}i|ya_`L#p#k8~$ZVlH!_{YeOq z2c?=6Wv3tq!TDoI-!rv5fw!;WqWeDx%W)JI21xENb+qS5D{ZuuD=8)lNIj#S*9n9l zA|~G}c-)%SexN~d9oSM{O*1!2Ud(*D}#~;?dAcZ>uSxwc#%MyIA1^2&3%M-L`uOHZ@ zpSvS5b!G)RqxnEcd82l;O6R_E0!)&Izrp#y;aT2S)5pz)U;lA=qL5<+=QUWU*$!R$XX zsK3>iMof58y_$yN&~RyNm!OT3jNA|c<$<+d5*HVn@eO*G~e6Bp14cwt7a|?@p(|OsKIf#H%>HgPJCV<~q>&M3-TOXiY`Ym^v(S zAHv7rYhx&wdmRxuz`TT_d z?W&^d!~%$D5Gwqlm&Mcn_{~v;Ml{+r{6NSrdF?P{KPIt6i;}T0!~&mp2J@_!T1ZU| za^z=?_S zd35Y@mQ^Xb0C#8;6jQ$-l=4I?s)JE$LN| zZnTy|SLQSjZ1J0V9MCa2wvTAzTXB9$3U&Xl1?cMjAuA@H9vJL_VIS!kR(w*lM9Thf z1wPO0jiI@_6acU-y#H>jt;-L&Msd12@!8oOG*u-K)Sx14(?#I#P7!}T_EN+WPHIt} zZHWhf{ilujPB%Z1*NOvvcWC>l&`gP4nU)f*hko@~A9*u`FM#(RJnAroyWrYuN$$n6 zcq`8=KutFuAvB6E!3esa8B!4ZA59`CqG>WW$27@Lz8I^TcI5>NKD313z_T8CH7Usk z&+ZH1er<*~5jq26^k4}GZS#eJGhIu&X3+-{%8_?jB~653MYtAQ-Q=rV|p-T703 zJ}cqXK0XfQ>s;Qe3oN2XC79?^54yZdQ4~vlmiF_OwBei9gx{zRc?Od357k$cYB(iA->XxMeHyTn!a!aj{MK)=s9+>PFtJrpFvxtDRX$#>$ zLT71K{cNk!Y>HlkME8=3TSLu&`>q)gG$S2 zL1>h7mr)`V$hGirH<)@C2E8fc6HIifQ0Uh?z&70|VkXjf2|;?HWYfW~$-EUFPQ3u} zxi-OSP99k2lbi=SyyxHmNjgA6lHmzkGbd*R!5C`cDfj}N6QuQmER?ioLL>*MahIu| zwiaI_vX5YbIk9*RAGahSeJ&{j6n*d%2L1@ZQm%z_1Kp?-rrqHbp_2?QyZw(Z%IT{3 zC+`{v1$rpDu=n3R>cA3DLi`DAU53#Ic~aPc|D)Ti0f2EL1d;Iq-M^J!_hR(02Vzv5ho=a^(Tf8H!LhcIJl$gjLrcpkuS$(@0xrPjx8#Clm_V z;+j03@U_daDO6do^z&aEO@MkEMww7cw7|t95Y}UM{N^Xdcb44agRnga;K3q)@#JK4 zKCx)UdX{J>+79OzgflPgsN^5q-J5H|68I_xVe%F()j{LRbPAWerSkw_eu3`Cp`AvlYctXz5gilb2Q(jqE6bc zMg-sgjT7N+#P~(HB5nQ?%DG=Qpy9j!Ak;RsvHvh4Mn}zb)WZSaI{b<&@BWmPm9 zZbNMJ0fz}Xs4;?;oDZ_(1wT0Mh93d5D_pTiAAs@^qN@;vQ4g>FphY7M&wLQUqZ#T8 zo`O9wF+(~u385?FVjUm*WD#ln{j1TuF6^ir6o9iPL&Dl2yt<85X|RRH@`0gKczf{+ zOnDMWnIkM<_yfQ_@n@{<2d|1}yYQm%FEIC%E{#ciN!Lr76spL(Z`56vip*ig5A|5{ zuC5ZE(UmIHqU#+f{cs{g5G{&2D)8Y(FEyQ179nFNRJpkMdo z7zBMbM}2{|7M1+al#0o%lv1A+bt}R-5 zgDvc}OE1BERmrCXL5Q}wrWR?W92}_r!ebq52d*D<^*$J0TELA;%U7+I=;sfMl47?}YFcUQ;qrc@ifqV-;u z*Iq)K;l4hi;xyP=YQ(cH^{)ILY{}>D@;nHFd1}>6$*0X!Edc8U&wke{m7{g!_jBlr zXQdzbX`co}ze5Rcp#F5AZ9~4P$f7-^L``9TKsJyTZF8IGNrw88RRFF-M^zznxAHEw z#QkW`5Bd`)QX;V1Ko5E$JYAFSs!Ridi7t(Pp`zN(=92(>Tk*eW3b@jyaJoxN=;!c* z2@k|URc(9HSty7MJ4h~wlDA}f46EW(q3n^Ub)@?uyfAvyD8$8TgY zR8xqeRWM|qwV6Y3#XkcYHOBHDX;|D#-nJdM*v6?eq50pC#zHc^KrMcS34e+OwIr4Q zHP!>u9p>_|1OomjIGx_nh%@ly^RFGB+c=)A594)_pQs}pu|1TFXFQ}Kv+wg~Mhoph zl#SqPyV)ls%a4ZZc)HH5*3iHW`FDx;+_gbKFENVE@ig!UQqe^(Hb&^}@TC#0$nb1# zb12PtihIxoilJ*9Z)oH*%{ouO@>rXeJlfEg`jt$R*&ZcQ^j=u`Rjll#n-}AUGafLZ zk$M{IG|vy_xeN+z zA(hsu&7r?;c@FgkatHOusdn(A5v_ToWF(_f2#x05NdEj!Iu)coA1o3tM?#f74dN{N zsmjyAVyL2?0)WwkG8kpj1cWvLTwNgSPf)v!f>O41Vxjt13yb(vP*D9@IhB~rt>N>XF&F(k+&km`5N~O zgYK`%K)-@E9zB$pnrBJ{G@*8LiwitJ46jOxz_CODPe__bJ zsBk=d1UL4`A$P8$#{0yawnR{s4#6=r=o~`b;s$1#4p{w25NHrb*cLH|9%1*)tT4_& zT(+Tx=f93&?H6DhE}Rd3wDMIjy@cea^Ry~QFbB?jJAnMNN9Y$En zeh>`uSRVo27%k?DVD3^0iV7*@@l-ywMs#fRsw*A4yJVnNnF>~{Xy!MhlfiPxGI~>$ z38J$?HR`u$_v0~40KIpULM;Uvb0{dH?ULwrbx_y(*H+arl*T`MNePK82cH%Jn zBU0|CmM5yp9)#rpHn=4Kzd^s8)SsQWdbx@EBTS5V%~2u)?+@_`CU;ho7$nF~|7I^E z^^PWfl?j!?>K`+CG_R2Fs`BXGRkAZ9AyU`T3)c;T@oxcZFLW?kEY*CR3wU0c-s2GV zTM=epfRjZ2Fs8GVDxNEL&26CmT50MQj=W-zE0NdHV3BZhYmWTKr@yIJJiCM+l;GGK zUdHRzo9Eq-PG&%}k4=W2BD7LRhXG!71|V~6Gg~619hq~#i8-C18xSF!I{c#IK4(`{ zc*m;Nu;m60HDX6tiMuN3+3}|_Zv^oXtT(Poqj2h_QZwPy7r=#-K7zh09(<0fXa+*! zKOC{aF;NwS2sWp`|3^I@%1H@$^2axOT6RM1(5H;)-6qmTjgl!%goV&iA`SmdqEQ|B ztYThpg#q@F-QGL1=q;b84gL#{O-jOgun+tdu#Zmg-E47<6Tf@O(V7gD-<_!$-Di5K zqRv|NrhQWq7WL{Sv~U7EWMQ~_NN9T$6#Ze1!V~mdXb;-2PF+z-~d}3x^vsAWd&KnS@1aF9IRpy%pi27&Ur#g z=x|2Tl}W29kI9zNfG(fZMhLyrAPGla5{?&X>FJ6~1OL6Yfk0cZ;J zES$tJ&-*I^YxeSkx}Kh#754~xz{38?IVz6pzrfEJZD#~K$z#|h#My`{&b)A;#Sj1G$Vxz3mN+95m7>pF}fW@f`6+pwY`d;ttRqlDd45cw(yWnZZE zcq>-P4tjhrD~c|)h4a<4QXU3{McbmnA;=86jE52(k4ff>1b!^GMo>QsFHt~dtPNP1 z%BC$$_eix9*)fzxHRu>@ybF@rw4={z-f$2OSI}TxIZgTlopY#ed#ZJjg}Xh3+Vj*5 zd!&UJqYsszuaS?59p9VlGZw1mPq5ICkBMMsweEo;$Arz7mTl>)~d{pL5= zZC9_>2I=w;m)w~BXI_px@$#Loiu23Lf$pJTzVJXjzgh*}9dNCxq>C!lsjHd< zW7utt4^&L(0ot%5mls-~-IpDqsD|qs8oZUbANI`rgO1RSOdc=68QorO4w~3kSr->h zAK?B^h|_n3m+=1~LSrsiKY-p{oC)0$R6c#e#}4iw@MoI}lIT*F(cnIjj@J;XOMV2Z zzxFIss8?vH;MGfek>Ig41lOH3PiFi4<52^;l#$j{4kAQZqYJG#_$czDr-X3G`MY^F z^70Mh;Z8W)QieKbE{EQu^a+P^d&4w%ql8CcBS|Z|Kp5^Oit)BYD-z>Xp09Y{(kBWEQ%Gj{}5a+h?X%d1>60-EpjNsW+Z6VMx!oS`dbWd1V)K|6BAnf z!cKWzJ0FDFE9IjuzCwHrMB4C4C67hZwFFGFnr_BVKU;HYBA#zVFbqD?VZwXDUZkK! za$$lcMMEBIRkm*uPO!Jd*yCdj>ZWw=j@osiQ%M(_w_-wP+mMEZbLj;kF=^Ce2Q|6o zoskJLeop`>Hv}#cqfJa`Ik-ddTQjZ5wbpCVbf$8iaidTH@uDuD{$lL6$@7E;P`IM` zwNW-B860d&Ls;*yLJe?tDzuU1wTp|(@ykYOnUZ6&P^Ir+1EvR=eHCFa?gHzf3lfrt zdjC32fj)!WdB~r)O*OOJQ8stuteYYlb2I+pV(r{j%y&-s>w5b)n>Ksg`PhtgtR>Qz zh_Ud=3J(!lYr&w4N$|=9aBxTOH7Rrgm2};lg5S1&N}%9*%I5VyMtq#?U?-U4xZa9} zWBz95Q?~(5aP1uu&}w77{kDw-5&7A;CUvbPM@lj7}Jhr}1Eg zvuhpb^8`#kk71T@f(4_`Lx=9jA%_JE{V|~CT>(&9H$i6T0$<3NRq>&OChgQpmEtHP zPt^*o38d@(zjWSa9TX;>kGtkubNJcB&gQ?SXq*g4*9%2CkM8}LaCA?Kmi#;Y1V_iw|l?ZKU3}Pnw84j z(~J*x)DWsqT99ZL>MM-B3Ls9=yMJp;YbC0OX#p~Nyn}azj~qx^TxLVPL(D8gEwGU}niXK0j@?SZ&iGj9aYi(D)3|D=~FL8%~-zT5Dqk0j59 z!4r>J#u~gWWTsodXxK|fgSa8)mSKKwZbKFPQ5A;%O=c8SApR9dUG#vM+XV6o%G&z|6Iv;%zKI|&6&wMdB@UkF=|;`HW=?kG-fY!<2Ups>*u&ok{s+}(!F3rX59@G_xU z<1F4$`b7(6Ml=pXe+Ki8v7}3raLSVhm8r`E0pAC58bl z(UJo%1s9|6&!R&x_Zi+eDYOf(;J$b>8L|a zQIN7o?QbdH+H@g=2E)0hE`TOeP4(2$X%UaBbZv5jDw@)Re_lel8xmp8I1z*N^1B-M zpbSLo36&Uy zqFu!d9qIk!ZyIBmi*0PO7tBAE`hhQFD%@x@kCy-OTs1=Ru#i`6OMb$R^CrBn8KD{a zS{;dU9ZJ){Z(0K)ZP(%RZotffuU2de$li>$Pz6hVaKAB9@)GHCgL(@q0b#acVAE-^ zi)xU#&0hi=N@-h}2GxJx>}3n5-4T{}_FC{-BZn=zRdJ zH~gMvgkW&gj$5B)^1VEp0oKz88_#9oKd0ygtLaq5s~{tRhgClEV;W7P&JU+%D&^6c zLWC-h_#(6qqYwlqMbsM@0FB?YXhO|$^?47EeS(sfXIPAF_H2|Qa96krMnlSdQlo(+ z#lN6#$Bv~+jfkB|4}5(CYR5vpeG|$LVpx5oO51tHuAn@UniBX6;dlhait~Gafd0K1 zILL*%A#Tox*g2?|(H%1HwAh7USzbd6q12+E{0>#BA4i2PJZdkb>Wk+n`=8G?O z?g=el6lt-LE-NbV=H3dzd=i>RKvqW>U1!tgACml}M|gkdEh^k?qL%}&*TO=FXfyP9 z8%Mo-iqLr{%m)IMG%pu%xHXw3#}yoA?ZK zo7dR)$WgyPJqVF9EOZ=GkNV=(;>mY{zN%5{3qqt|hW*bPY_*@;TMS=(ZBB#vx^brq zJ{2Ezh_$OS0wyE@xjG63Wur;M3T-WO-w=5k)(WK7LeL#v!Aq8)!=t7DC;wbpH9T`z zofZh(4DsgPrWl^}E+NPiM!lpvJfr_x4L{1)2JlG?4Xe|AObl%UuDb9sOw(Tic-yx^ zq@#gNO)=yWRwR8#gDyoeyqp-#_p0#e9?ozW3UFR!vt!kz=Y!7K5KQ$SHG`E*>#e9q0 zG0u;ZL8y!?!!&DuK#2shrcy`CZ?ot+^$-!5KN5HdvENnTL`T^)R{;;8db~2_PJlq) zKd`owY9~Y8AUSTeiX9=#fbnTHF{XTf+kwV`}Mbs6EMIzP>VnoIVCcY5%X@8(8jV9{S3^(TvH=Zv^a{-_a zBjOKe!IofZ4S;bsPWym_S^@H{0pOPL@JHBb?yG2aaxnY^%AVQ?j>My~GzQ;x`sAg@ zReRHzF@`mteu{Edhb``FY7_gQKHA3^(BLBh4R{1e@DRsRzlH!HYzG2iSCdEN0Ly2* zTNYvpknN1s1rlDBXnlxntSx=d_h3I?Qn)=g1&$euMn8*z2>^P{Gp9VPHXi5M7Ly(M z?;z-2x)HV&&R9WVGGR^qpFH`-oR^G&l?$~jEq+U5?mlAgCpvjr$pq-kqZ*GIk<>ib z*3-v_JE95-N=p9l#BaKQQ|{ILo2dtZ+Yd`gVFhr*!YaRFU#w1BO-i(AwT!nzTvP}Q zS%>=2!eP!L_FE@~8M3uJT1$5szddL;Q<)BYb?B^)1kXQ~ z%b*#?PY-!0A=tWjN9h$^zTxd?^VnS4p%L7;KZdT~@D=R1!F?@BH8qS`RYjT5@LM2r z+Ywx+KWILR?=12aXdy0(m-A=>adrcr4(D)pR&oOmRN8<-T?0aCz(U7BHTgA5;OW`y zS_szxpd)k@L9OMgyrP0gSq?A%$!!TXMqwC#oY4)6K~hoqb1$Xs@x?fouVmoM$*+1P z;6|NqxedemG@hxC=H>S=7#|ebf2W6(<_{!Q6ML+M2zwrm`B_?8*wYDrvSrVC}iv@PSSOZ&9aWEmHCj>=3(-*Gi6rsqq0sK!$MW-G?S2 znoCZD73P0LYSK7uz>>ES-0t-n{-b`Lm-)cw!G8pcLC`~ZERQuLuPJc9R)*~NOiNGd zih}9dkq;n!x>#(}u$&)O+q4b8pqZz`1|Y`)zULlgZNrcD%qlMZ$LYV9Vkmt;PA^4ZQE%3E%IR7e#@o?n0lqWM>^J!F+ zss$Gw6;xcEuVBZveADbta1lmVI-z_WOt-2Y{MB%KMxZ!ndE7?NEdz z2!Ks{TJ*y!c6jL*Xh0A5!cbVzyhN?1EAjE_FL!G(hNNIbK)Ac|1n$FjZ^6%Gyd=7}gZ_D`lCJ3VrUe=M$ zm}ncmM59UDDLkCX*D9%LS+ogyu~6KkhX}iW$=h)1Y#0yy17Vw>m{y9yJ@ad?fRgrc{ zQ6qIVX<_coXNCGf8JT(xFxYii9na9lr#uAhY`Pqu$-1XlRKe0aNZhn$=N4*D;iJ$d zEkm07sFz?)qv(9-1d4b)mi)-~rBxhY-2%wc$xpP8knIyHr?X$ck0F$u=_r;!(;NXd zbYlfAd^sH}B5~(R-S`l8IWR-uPJ#IERV8G=Vsl;)XOw=Xc4LI|sj1B$7hgoOR7b0Z zHdXMX;XszW_!Pojc~EpkGomPwCz}jEHx=g6X1SUwT#JwhHIq~JK`Fy=2 zx6VD~yjKaXd4-KilNztUsFsK^m=0bUjdu^phjfHCa*-~BZ$5v^4Vu!=7;PJgSfS^6ga3s^HvLChQ(<$wkS7y+;C(r&>G&4o~Rwszv)tpLZ zrY{V;Pj_l1TA%0v2{-287=|L>k;m()#%|!ZQ!rvHs0v0DMKn}FyTGc=j0(Oo#uJ9A zO`EU83bqs+Jv&^S4)^LsARKY42A0ddJdgMHHOKQA0zkrBcHEgvTh!y|?E9;pW_}>< zS`|UKaQ1~4z}x4)v(Q43gz?+RMaf3x4 zfnj}tg4YoA{c_xHZ$UROS_e>VSeI^)SDu0Jg=s{TSO{$?awh?Sq7m1(s6bsYxC-o* z&2w5j=4NL7j`#gMX+AE^91*-{_sKhhE==9k8H@{RZ=N^&Kx?SSEKPaOQy6C0HRJy; zKyfx{>obi&9s@x6WQGNr=(1syI@%Ke>_}N3v~srCq-D% zsxUXViW1R-vhwh}GQ@bx5Zenh^Ssf*Tli1cN3&=k)uO8lje&^6$3U?y8hiT^vwscV z1}gTwKoj1@hsrPEp&8RRVX)-m-)I_bROBmV-ZRIRp-T0Gc(^~E8w=>>nK;mn>pw8r zG~a4!(qSNqG<55o{4`W?>c<`?eY!~c?eYK&NO#HRUD_CWV?cb0uNC>e?uh0 z-MsDo{Fm4U0}wA;z?M;lwk!#@Zwn5tH>E=iB03NyV@64-&rp7=3^oS-X+n>PvR+%7 zGQwxqGA?dzShdp@UOj~22VQz&o96dQ#XEox-K~p%s!*SbKML%co&0NCn=0Jp0&kS! zwsYB;FwJ8g96UgaA~Yo7bfXvJ$ZIP2@*PTLZ?#W#sShT!Buugf54IMNSbv@S81NEx z%F}?QA3^?o0LAmG7K}22V5(u{{glB!n$R-UmgV8!0KEa+9P$x$_;avcfkbP&N=y2@ z3tL~OYMTdCzu?X1rW-N3!@JaK9A)9a%ek4)ax#?oepHNIyKK6F+4gunxVVmn;EH)6 zzbl~Sa)o?t(Q?>f)`$$f|KrAcNvPggUMV)HPe)TKppuPs`57Fdlh zm#ZiQsF`KPge2)8H@dxT!g&f2u#Q`4x1zDVr5SXLf3&sZ zcoIpl@Qx3y7;Q5^=jJV<<>RbWc79#2Gl20dy)!D{R)Tv6l zNSy`y5N_4^5y@-jc-mw#^sp?!6~m-$CBYjUdEbnVD&27!WDp*A7S9&FvcRNYo6VNKuYvi-sfLRakL{ z32i5Upsc`%mkNAaQN!ark2pg)%tB4Mt;XQkh3387_}BQw$cZkl?EppSja7ryxxXsVtF@ACNy2AX!(<2=DD^+DG8e znm2jSqAoa_)W@E0;(rF59nJ4p8yKnm1DzWD-2#}C0KE?^Tutafy@90P`Q|;2AT{J`>WaV}_VFHR ztTkg(`vNi6r>8;>a!HA1F^G+$KeW|SoJqYxo~%)5E~fLk@VpPVVp6Y+D{Q+Ogwcix z-hOWJ8$KSS)_(=Gk5gfm{H?lH1=GV=n&cjjGF~qO=NORjWT}y@G*i>N`t9%tml$%!e>ADrj+k1b&F+qzm%_)5vdnW)>+9r!qRy|9XQeRElsY#rd&lC zg|0jZ7T9s3V`EtwC?P?!r(^xXX_BthUh|RyMj=6RHhh%B>*Yo?nu;vI?jX5}R{q3- zF&-(?1@_Iz>w#J&e)`TE#c{<#7jkS6icnl?riYRY9UoU0HQLh`e**$iZL_FkgxEOz z_9T#X@hgrrq>-kX#H$FrHlb-1AL{yOuQP2UooUyE4je6c*NQLX5MX}1lg$TN$|>Ip z^zoxdkT7cLs;DAn#^3(pHXEGF^(*aXDBAx*=Il1`R1obU`mSjRNqdbr*@eF7`5zQr z{)M7`sR?Yk43X7wXb9)a`WT?VlLqaXTH!30gz-B;q+y}PJ!Z(GqZa&_G{%Ga>gY6y z77|-nYT#930)y@NexYsyx_0M#MC2-UU}Yu%2`}#F))ep<5HdY6$mdJM!k#u*;-NCs z%9R@CzI;{(54O@6VtXPU2O6Sj{qmgm5e2`SN)g5Lj2)(Ib}{$Y(&k4u1P4iqm8lEi zURdbY!YfMNe2$dc@vo*w>tqm_*{_PBb?=P}V)EjkpeoeYwWEE+<%6zSbu+a_{t%*j62jzolrNK(pu9VLaB@+QfC_pQj)RmGK1*Y7m?{7h) z&l?F^EC6D42jlo?rG}!*_!_)wQS5cZYS5Yc!t2s4Qo@DY0PN;e9-RC@Q6E0i2Hp;T zt4gF>!*{5g7~WM--%CD!D^L5DX&Qg6)dd&DZF-#(3|y;l*xPb*-n0FLm>YP(1DVB@ zbP)9lC+_pcL($qHq*jF1>zg(0DQci3F8NTqMhQzmA=;Y7lxSE$39`564K15fcSKGw z^&|rDFZd{l*1x`|ha6h3P|Bt)2>Ucmba}u>CF_lgA|K&n3GlepY{30OE>9h}=3p4= z{+{0pFn`|hQ&s<=1z>^3r_MhJjvGeAT?1wpqrd>>-@sfGRhF>R70(p%{y#bo;oVRT zP)$+7kFoUntWi%7=;E|7M}uZm-o56Hb5=zZl%VMGc;AH4Jo<6(43;i{wfb`?u7`J6^OAA?g@U*8wbVYc%Qu_%1XDD0gbg0`5A*h}D4? zyW4^#MRlYw(S4PX0|4g;yj1AK9s%09-gw+wUU-)R0B-Ua*^|ct-e$r4(qh83f z-%2DcROf4$<@z6wE0xnhlPd26NtTopOdOsmXP0(4dP6aQmBDXU)W+@5%Y~&Xv-I0H zZiP}n4$(V|@LS+M9#EvdA1`Yo%(&m<<;NC27sElM@t7-8a{-3E@pvJ}OEtkCTR{A) z74T={fi{YKjd>Ot5L#kLvJserG->}$Xb1TbI!In z&B2XTgQ)EvAO8bhZsGY$zY$JzG@Qh1%G6`5;mjt+gJa=_yW%pWF~1{T_fA6w<4FMMi;)b39W z2cm7#G#Iuv_2Nzg5zZPR<#5n;fOm-^t_iZmZT38C&+E;IDQtUzg`?%bSWkrIgkmu- zdWZ2qj$b1p=)wi0_(8 zdQEh2uE`+KtDe7g*(%(b>mM(dLZ>c<)QyiWJtJO!$Lp~Hwm8n{^X_D&mS^ygCz_yD zMJMWMCTT6tXVb2m{Es&&T8(lz;`%EZ0YRrDI*g#|$m- z_5IO$fvykD{CcW0PlVGcR9fdCmA|M<;dANR@7x{cScP|X(55SOe?(PV(1@c!)2iqs zyhXV5K7d;zvCQQyL$N4=Q7?6AiT2cWdE=dx&yQfb$2qY6V@xS#smDR46v2Cggqabd z_x=xjm!SsOUT&tjx1rn~stF|MD&yPu43xZePjenmY=AL(?0M2A)XFKe+`$+KA>29Z zP*d`)gk~~8(-&dZD?I;6}&e(&N!XX#dza@uH$cm%0ChiNfJcxJdJ1k~Psh^OU0IbV1hwz)=1 zVuB1f3i&(|28XN}gKivqM@((-)qUi`eaVXq zh;%VSr&hGEG+-JUB|5wzGhAVVhCHbir18!~){)MzdgZlnPaaCOj>!q|!MG|IQw_Xs zj0Uvj=)gRaQK4fH11lw^XzdLNvwy>Ek~;qS`3n_#OJ1YwYq;~*5+v_9Ph?f_Y`Q%? zeNXn*`bP=YPtE zd$b4>b;b;*$`o)lLUVo%bX+I~^6G+pU-4oTB7DPw4y#Cli0re7^tF?LklK&e6D??> z*);HTO#n~Ik|e3hAepA~Q-GcllBif0)T5me@bi@hGif87&wM}!K++@;q43zMTRl$# zxoG|?O;>$_ou|UFBjH^-LC=bJLz~QfF8(|~523;E>3kmT%4?_51uv(#S7E~Y7A-2w zu?R`@^IE7!Loh-B#3E8}!qXWQVHS5yBvI3PQ08uRU1<@aB++{d2G?n1N*G&ZG=T4E zX1qpnt{C8kv*0ML^*Mf_32a7wSt%v^8CtnpACl>NTb(`)auyy8y5(?!=MjkR3NAz_vl! zs;9%CblQvf_?o)k)bLCojhZP0aX0LRzHpE`V$we*5h7JHm@fk5c><8KfrOY<{8)sa zZ+A=J0VIDveqzBo39EXPd#NvaQd`2v%A1!4jc)NA zXywa5fsf=Y8-CMaYE|+Z8&f%2i}SJ8u>e_h;E@8uK-$#dHk81z=f8dDE?AIq2eeF7W&@9Tq7f2e)XB zM!>qTaW3W_8Z-i_1^=hPGCUn(vX^i8A(lFILsYZy=a6?5!M~3*;mROS2;`%9jZAxl z#{@6d@-7~H=^ttnV1|uP2|)4=(jC`&Zg1cYAv(L%ggtMZz(qt2bxcLjuFxd>x})yI zv+=1#-0_m6(&{Hf(V@XtTE=0h+Y9}y=`ZfDaTSWlQfCi4B=kPMeHs5hWBv{L78TyDj{{*q zeZb?#0pn|y8ku!`#6uVr&`31TR`6YPA|vc1FA_tccMq!8LFwsZ%x!=T?$~mF6_Xa> z0{oB!8GVw?ivlst!(Z`HIB5T!X{0ep6uwwjf!{0(`A7ihA8x|8Fx6Zljn|2lpJ=}Z&3Pb=S5O{msOu+f zC1|6{Z6czlKIbCPr+5n1nKY>9>mQB^eEc4SDw~$E@DcO_fV8P47$>jACCBn;EOhPG zf~(BH$ivZr!T->TLp1Ofrg#X^xBB;idugtO?r@l$VmM)^iPk?=GddM;zkVgCEX}YQ zDL2=Nw)djt@7h8|%zY8mnP2DB2=a6SonYKwz)IIE8|!kPBE}be zJHXiyI{L{^)Rn+{+0Lo3(r;{XfKmpyI4*G50l+FQj4n64j&n<_xcj+e`kln$dI=gCvTHpG#Ku(ElZ zU&B$Ub*v|Rx;cZ#L*RMtZ>Qm5H0GBjN(>c%@)kj^+BhI z9$aLBlgj|D0Xi&$(+?9ZY1@l?n*pHh@B#!(u5|G4b+VeVhS)!2CgI=&(Z68&ykq$) zT7f%kJ{eKxPozB%f98uNJ~`z+ngPuC0Ryi8`)3ijLj%#e=q=hWRoar%kyX>fsajn! z)lsWfgivq|S}>U~HGdl5v6KLrEE;i2w}BV#%N%e}-ZJovMwFr}lmRH+VyitTSpFB))4-8@CjSakX1B_FVD58LOd82WPrlmR>hVHb29%HF&x~)Y4?DeGmUyda4<2FTi>kk2R?_C*a zpsP`As{|LGRB^i!5Bc+z6L0ZdwkERU9DHF5Q7HXNn^3^6bq;tZw!!zGfsK+}ngUQZhBp>}iLYUF2AQ<;1=rr>UL{A~`-}Yy&%@t` zR)2wOljf1!j}(G-AOr@6JUIQmk`oL+s9+t#<4AY(9Eq^$-FjW}{(}6RGT>C`(X8KI(|^S|qo=;#;+9x_n7eF=y1Gt$=#xKubg# zvWzxUW9gugPXg&8sDi+piWqGu?uvqhO4F{x>z@^cHW-Ps3?;RfpIxO1KL*nP{E4}F z#OEXz8c2z*57*R<(%{8kv=xp=UuEfGwG)RLa*sV9FO>0m}zqj&TGgp=6U+wnH~OA82%qiERZ_g^}Ihi5FRc@oLn zj;a`wOWO#*sY(sR{TYN4POi2M=x-|d2KY1$hi%qdzXWKkDNtK*Tq<(0E7wp%U{}UZ zYPaW^9K3QIrdy|pP`Xg3P6bOBn*PS;B|MO4Mw10d%Q^V@)xCn@Bgt7Xc5}tuC<~+O-Yx213PcRQ; z^Ciy$&+cS+71e4q{3ARt3#=G7`w_s8$-aDtP{Ou6ppth`WYN4favNN_m0b-#pT2Vo zMiW3?MSS>|2NmIwMI_ick7niIj97@~#D^v&>F}d1EU;rQOZz~Vu1a+}h*X3D2l1?{ zboJ-IfdKFIg9aXJl;eTVZ=%~5YKXhJWWM01&?>&Q{0?GvEN=Fhr^6fw1EJ23{FKF8 z>DGBjrs4bm1pOLP;t94I6VIsRlY(!tGTaIDe5#~ + + 4.0.0 + + org.opendaylight.mdsal + binding-parent + 6.0.5 + + + org.etsi.osl.sol005nbi + org.etsi.osl.sol005nbi.osm10 jar + Descriptive Name Goes Here + 0.0.1-SNAPSHOT + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f9f92e8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,406 @@ + + 4.0.0 + + org.etsi.osl.sol005nbi + org.etsi.osl.sol005nbi.osm10 + 1.2.0-SNAPSHOT + jar + + org.etsi.osl.sol005nbi.osm10 + + + openslice.io + http://openslice.io + + + 2021 + + + + + + Apache 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + A business-friendly OSS license + + + + + + opendaylight-release + opendaylight-release + https://nexus.opendaylight.org/content/repositories/opendaylight.release/ + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + + + + + + + opendaylight-release + opendaylight-release + https://nexus.opendaylight.org/content/repositories/opendaylight.release/ + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + + + + + UTF-8 + ${project.build.directory}/generated-sources/mdsal-binding + UTF-8 + 2.0.0 + apache_v2 + 3.1.2 + 4.0.0-RC2 + + + + + + org.opendaylight.yangtools + yangtools-artifacts + 6.0.5 + pom + + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot-version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + com.google.code.findbugs + annotations + 3.0.1 + + + org.opendaylight.yangtools + yang-common + 6.0.5 + + + + org.opendaylight.mdsal + yang-binding + 7.0.6 + + + + org.opendaylight.yangtools + yang-binding + 0.7.4-Lithium-SR4 + + + + + + + org.apache.httpcomponents.client5 + httpclient5 + 5.2.1 + + + + org.apache.httpcomponents.client5 + httpclient5-fluent + 5.2.1 + + + + + + org.etsi.osl.sol005nbi + org.etsi.osl.sol005nbi.osm + ${project.version} + + + org.springframework.boot + spring-boot-starter + + + org.springframework + spring-web + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + org.apache.commons + commons-lang3 + + + org.json + json + 20210307 + jar + + + org.apache.geronimo.specs + geronimo-jpa_2.0_spec + 1.1 + + + log4j + log4j + 1.2.17 + + + + + + + org.apache.commons + commons-compress + 1.20 + + + + + commons-io + commons-io + 2.8.0 + + + + + org.eclipse.jdt + org.eclipse.jdt.annotation + 2.2.600 + + + + + + + + + + + + src/main/resources + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 17 + 17 + + + + org.codehaus.mojo + license-maven-plugin + ${maven-license-plugin.version} + + false + ========================LICENSE_START================================= + =========================LICENSE_END================================== + src/main/java/io,src/main/java/OSMNBIClient,src/main/java/OSMUtil + + + + generate-license-headers + + update-file-header + + process-sources + + ${license.licenseName} + + + + + download-licenses + + download-licenses + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/OSM10NBIClient/NSActionRequestPayload.java b/src/main/java/OSM10NBIClient/NSActionRequestPayload.java new file mode 100644 index 0000000..e9eb323 --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSActionRequestPayload.java @@ -0,0 +1,158 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol007nbi.osm + * %% + * Copyright (C) 2019 openslice.io + * %% + * 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================================== + */ + + +package OSM10NBIClient; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + + +/** + * @author ichatzis + * + */ +public class NSActionRequestPayload +{ + + private String nsInstanceId; + private String member_vnf_index; // Needed for VNFD mapping NSD.constituent-vnfd.member-vnf-index. If missing a NSD is targeting. Example: "member_vnf_index": "1", + private String vdu_id; // Needed if target is a VDU. Maps VNFD.vdu-id + private String vdu_count_index; // Needed if the VDU has several replicas (count>1) + private String primitive; // Mandatory. Maps [NSD.ns-configuration or VNFD.vnf-configuration or VNFD.vdu.vdu-configuration].config-primitive.name. Example: "primitive": "touch" + private String param; + private String lcmOperationType; //"lcmOperationType": "action" + private String vnf_member_index; // TODO for backward compatibility. To remove in future + private String kdu_name; + private Integer timeout_ns_action; + private Map primitive_params = new LinkedHashMap<>(); + + public Map getPrimitive_params() { + return primitive_params; + } + + @JsonAnySetter + public void setPrimitive_params(Map primitive_params) { + this.primitive_params = primitive_params; + } + + public String getMember_vnf_index() { + return member_vnf_index; + } + + public void setMember_vnf_index(String member_vnf_index) { + this.member_vnf_index = member_vnf_index; + } + + public String getVdu_id() { + return vdu_id; + } + + public void setVdu_id(String vdu_id) { + this.vdu_id = vdu_id; + } + + public String getVdu_count_index() { + return vdu_count_index; + } + + public void setVdu_count_index(String vdu_count_index) { + this.vdu_count_index = vdu_count_index; + } + + public String getPrimitive() { + return primitive; + } + + public void setPrimitive(String primitive) { + this.primitive = primitive; + } + + public void setPrimitiveParams(String primitive_name, String primitive_value) { + } + + public String getParam() { + return param; + } + + public void setParam(String param) { + this.param = param; + } + + public String getLcmOperationType() { + return lcmOperationType; + } + + public void setLcmOperationType(String lcmOperationType) { + this.lcmOperationType = lcmOperationType; + } + + public String getNsInstanceId() { + return nsInstanceId; + } + + public void setNsInstanceId(String nsInstanceId) { + this.nsInstanceId = nsInstanceId; + } + + public String getVnf_member_index() { + return vnf_member_index; + } + + public void setVnf_member_index(String vnf_member_index) { + this.vnf_member_index = vnf_member_index; + } + + public String getKdu_name() { + return kdu_name; + } + + public void setKdu_name(String kdu_name) { + this.kdu_name = kdu_name; + } + + public Integer getTimeout_ns_action() { + return timeout_ns_action; + } + + public void setTimeout_ns_action(Integer timeout_ns_action) { + this.timeout_ns_action = timeout_ns_action; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } +} + diff --git a/src/main/java/OSM10NBIClient/NSCreateInstanceRequestPayload.java b/src/main/java/OSM10NBIClient/NSCreateInstanceRequestPayload.java new file mode 100644 index 0000000..e0154d0 --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSCreateInstanceRequestPayload.java @@ -0,0 +1,37 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol007nbi.osm + * %% + * Copyright (C) 2019 openslice.io + * %% + * 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================================== + */ + + +package OSM10NBIClient; + +/** + * @author ctranoris + * + */ +public class NSCreateInstanceRequestPayload extends NSInstantiateInstanceRequestPayload +{ + private final String notificationType = "NsIdentifierCreationNotification"; + + public NSCreateInstanceRequestPayload() + { + super(); + } +} + diff --git a/src/main/java/OSM10NBIClient/NSInstantiateInstanceRequestPayload.java b/src/main/java/OSM10NBIClient/NSInstantiateInstanceRequestPayload.java new file mode 100644 index 0000000..c6530b6 --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSInstantiateInstanceRequestPayload.java @@ -0,0 +1,209 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * Copyright (C) 2019 openslice.io + * %% + * 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================================== + */ + +package OSM10NBIClient; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class NSInstantiateInstanceRequestPayload +{ + private String nsName; + public String getNsName() { + return nsName; + } + + public void setNsName(String nsName) { + this.nsName = nsName; + } + + private String vimAccountId; + public String getVimAccountId() { + return vimAccountId; + } + + public void setVimAccountId(String vimAccountId) { + this.vimAccountId = vimAccountId; + } + + private Boolean wimAccountId; + public Boolean getWimAccountId() { + return wimAccountId; + } + + public void setWimAccountId(Boolean wimAccountId) { + this.wimAccountId = wimAccountId; + } + + + private String nsdId; + public String getNsdId() { + return nsdId; + } + + public void setNsdId(String nsdId) { + this.nsdId = nsdId; + } + + public class VnF + { + @JsonProperty("member-vnf-index") + private String memberVnFIndex; + public String getMemberVnFIndex() { + return memberVnFIndex; + } + public void setMemberVnFIndex(String memberVnFIndex) { + this.memberVnFIndex = memberVnFIndex; + } + @JsonProperty("vdu") + private List vdu = null; + + public List getVdu() { + return vdu; + } + public void setVdu(List vdu) { + this.vdu = vdu; + } + + @JsonProperty("vimAccountId") + private String vimAccount; + public String getVimAccount() { + return vimAccount; + } + public void setVimAccount(String vimAccount) { + this.vimAccount = vimAccount; + } + + public VnF() + { + + }; + } + + + public class Vdu + { + @JsonProperty("id") + private String id; + @JsonProperty("interface") + private ArrayList interfaceObj = null; + + public ArrayList getInterfaceObj() { + return interfaceObj; + } + public void setInterfaceObj(ArrayList interfaceObj) { + this.interfaceObj = interfaceObj; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + } + + public class NInterface + { + @JsonProperty("name") + private String name; + @JsonProperty("floating-ip-required") + private Boolean floating_ip_required; + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public Boolean getFloating_ip_required() { + return floating_ip_required; + } + public void setFloating_ip_required(Boolean floating_ip_required) { + this.floating_ip_required = floating_ip_required; + } + } + + class Vld + { + @JsonProperty("name") + private String name; + @JsonProperty("vim-network-name") + private LinkedHashMap vimNetworkName = new LinkedHashMap<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public LinkedHashMap getVimNetworkName() { + return vimNetworkName; + } + public void setVimNetworkName(LinkedHashMap vimNetworkName) { + this.vimNetworkName = vimNetworkName; + } +// private String vimNetworkName; +// public String getVimNetworkName() { +// return vimNetworkName; +// } +// public void setVimNetworkName(String vimNetworkName) { +// this.vimNetworkName = vimNetworkName; +// } + } + private List vnf = new ArrayList<>(); + public List getVnf() { + return vnf; + } + + public void setVnf(List vnf) { + this.vnf = vnf; + } + + private List vld = new ArrayList<>(); + + public List getVld() { + return vld; + } + + public void setVld(List vld) { + this.vld = vld; + } + + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + +} diff --git a/src/main/java/OSM10NBIClient/NSScaleRequestPayload.java b/src/main/java/OSM10NBIClient/NSScaleRequestPayload.java new file mode 100644 index 0000000..ae3ce45 --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSScaleRequestPayload.java @@ -0,0 +1,158 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol007nbi.osm + * %% + * Copyright (C) 2019 openslice.io + * %% + * 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================================== + */ + +package OSM10NBIClient; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * @author Ioannis Chatzis + * + */ +enum ScaleVnfType {SCALE_OUT, SCALE_IN}; + +public class NSScaleRequestPayload +{ + + private class ScaleVnfData + { + private class ScaleByStepData + { + private String scaling_group_descriptor; + private String member_vnf_index; + private String scaling_policy; + + public String getScaling_group_descriptor() { + return scaling_group_descriptor; + } + public void setScaling_group_descriptor(String scaling_group_descriptor) { + this.scaling_group_descriptor = scaling_group_descriptor; + } + public String getMember_vnf_index() { + return member_vnf_index; + } + public void setMember_vnf_index(String member_vnf_index) { + this.member_vnf_index = member_vnf_index; + } + public String getScaling_policy() { + return scaling_policy; + } + public void setScaling_policy(String scaling_policy) { + this.scaling_policy = scaling_policy; + } + } + + private ScaleVnfType scaleVnfType; + private String vnfInstanceId; + private ScaleByStepData scaleByStepData; + + public String getVnfInstanceId() { + return vnfInstanceId; + } + public ScaleByStepData getScaleByStepData() { + return scaleByStepData; + } + public void setScaleByStepData(ScaleByStepData scaleByStepData) { + this.scaleByStepData = scaleByStepData; + } + public void setVnfInstanceId(String vnfInstanceId) { + this.vnfInstanceId = vnfInstanceId; + } + public ScaleVnfType getScaleVnfType() { + return scaleVnfType; + } + public void setScaleVnfType(ScaleVnfType scaleVnfType) { + this.scaleVnfType = scaleVnfType; + } + + } + + private String lcmOperationType; //"lcmOperationType": "scale" + private String nsInstanceId; + private String scaleType; + private String timeout_ns_scale; + private ScaleVnfData scaleVnfData; + private String scaleTime; + + public String getLcmOperationType() { + return lcmOperationType; + } + + public void setLcmOperationType(String lcmOperationType) { + this.lcmOperationType = lcmOperationType; + } + + public String getNsInstanceId() { + return nsInstanceId; + } + + public void setNsInstanceId(String nsInstanceId) { + this.nsInstanceId = nsInstanceId; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + + public String getScaleType() { + return scaleType; + } + + public void setScaleType(String scaleType) { + this.scaleType = scaleType; + } + + public String getTimeout_ns_scale() { + return timeout_ns_scale; + } + + public void setTimeout_ns_scale(String timeout_ns_scale) { + this.timeout_ns_scale = timeout_ns_scale; + } + + public ScaleVnfData getScaleVnfData() { + return scaleVnfData; + } + + public void setScaleVnfData(ScaleVnfData scaleVnfData) { + this.scaleVnfData = scaleVnfData; + } + + public String getScaleTime() { + return scaleTime; + } + + public void setScaleTime(String scaleTime) { + this.scaleTime = scaleTime; + } +} + diff --git a/src/main/java/OSM10NBIClient/OSM10Client.java b/src/main/java/OSM10NBIClient/OSM10Client.java new file mode 100644 index 0000000..cbc532b --- /dev/null +++ b/src/main/java/OSM10NBIClient/OSM10Client.java @@ -0,0 +1,1503 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * Copyright (C) 2019 openslice.io + * %% + * 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================================== + */ + +/** + * @author Ioannis Chatzis + * + * Describes a MANO provider that can be accessed via an API + * + */ + +package OSM10NBIClient; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; + +import org.apache.commons.io.FileUtils; +import org.apache.hc.client5.http.classic.HttpClient; +import org.apache.hc.client5.http.config.RequestConfig; +import org.apache.hc.client5.http.cookie.Cookie; +import org.apache.hc.client5.http.cookie.StandardCookieSpec; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager; +import org.apache.hc.client5.http.io.HttpClientConnectionManager; +import org.apache.hc.client5.http.socket.ConnectionSocketFactory; +import org.apache.hc.client5.http.socket.PlainConnectionSocketFactory; +import org.apache.hc.client5.http.ssl.NoopHostnameVerifier; +import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory; +import org.apache.hc.client5.http.ssl.TrustSelfSignedStrategy; +import org.apache.hc.core5.http.config.Registry; +import org.apache.hc.core5.http.config.RegistryBuilder; +import org.apache.hc.core5.ssl.SSLContextBuilder; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.etsi.osl.sol005nbi.OSMClient; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.vnfd.rev170228.project.vnfd.catalog.Vnfd; +//import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpStatusCodeException; +import org.springframework.web.client.RestTemplate; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; + +public class OSM10Client implements OSMClient { + + private static final Logger logger = LogManager.getLogger(OSM10Client.class); + + private HttpClient httpClient; + private String manoProjectId; + private String manoUsername; + private String manoPassword; + private HttpComponentsClientHttpRequestFactory requestFactory; + private String manoApiEndpoint = null; + private String manoAuthorizationBasicHeader = null; + private static Double manoAuthorizationTokenTimeout = 1.0; + private static String manoAuthorizationTokenID = null; + + public static void main(String args[]) { + logger.info("Make your calls here"); + } + + public OSM10Client(String apiEndpoint, String username, String password, String project_id) + throws HttpStatusCodeException { + this.setMANOPassword(password); + this.setMANOUsername(username); + this.setMANOProjectId(project_id); + this.setMANOApiEndpoint(apiEndpoint); + OSM10ClientInit(); + } + + public void closeConn() { +// try { +// this.httpClient.close(); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + try { + this.requestFactory.destroy(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private void OSM10ClientInit() throws HttpStatusCodeException { + this.authenticateMANO(); + + // use the TrustSelfSignedStrategy to allow Self Signed Certificates + SSLContext sslContext; + try { + sslContext = SSLContextBuilder.create().loadTrustMaterial(new TrustSelfSignedStrategy()).build(); + // we can optionally disable hostname verification. + // if you don't want to further weaken the security, you don't have to include + // this. + HostnameVerifier allowAllHosts = new NoopHostnameVerifier(); + + // create an SSL Socket Factory to use the SSLContext with the trust self signed + // certificate strategy + // and allow all hosts verifier. + SSLConnectionSocketFactory sslConnectionFactory = new SSLConnectionSocketFactory(sslContext, allowAllHosts); + RegistryBuilder registryBuilder = RegistryBuilder.create(); + registryBuilder.register("https", sslConnectionFactory); + registryBuilder.register("http", PlainConnectionSocketFactory.INSTANCE); + Registry rgb = registryBuilder.build(); + + HttpClientConnectionManager ccm = new PoolingHttpClientConnectionManager( rgb ); + + httpClient = HttpClients + .custom() + .setConnectionManager(ccm) + .setDefaultRequestConfig(RequestConfig.custom().setCookieSpec(StandardCookieSpec.STRICT).build()) + .build(); + requestFactory = new HttpComponentsClientHttpRequestFactory(); + + requestFactory.setHttpClient(httpClient); + requestFactory.setConnectTimeout(2000); + } catch (KeyManagementException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (KeyStoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void getUsers() { + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + ResponseEntity entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/users/", + HttpMethod.GET, request, String.class); + logger.debug(entity.getHeaders().toString()); + logger.debug(entity.getBody()); + logger.debug(entity.toString()); + } + + public ResponseEntity getOSMResponse(String reqURL) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = null; + try { + entity = restTemplate.exchange(this.getMANOApiEndpoint() + reqURL, HttpMethod.GET, request, String.class); + } catch (final HttpClientErrorException e) { + entity = ResponseEntity.status(e.getStatusCode()).body(e.getResponseBodyAsString()); + logger.debug(e.getStatusCode()); + logger.debug(e.getResponseBodyAsString()); + } + return entity; + } + + public ResponseEntity getOSMDeleteResponse(String reqURL) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange(this.getMANOApiEndpoint() + reqURL, HttpMethod.DELETE, + request, String.class); + return entity; + } + + public void getVNFPackages() { + ResponseEntity response = this.getOSMResponse("/osm/vnfpkgm/v1/vnf_packages/"); + logger.debug(response.getHeaders().toString()); + String body_tmp = response.getBody(); + logger.debug(body_tmp); + JSONArray jsonArray = new JSONArray(body_tmp); + logger.debug(jsonArray); + } + + public Vnfd[] getVNFDs() { + ResponseEntity response = this.getOSMResponse("/osm/vnfpkgm/v1/vnf_packages/"); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + + try { + Vnfd[] vnfd_array = (Vnfd[]) mapper.readValue(new YAMLFactory().createParser(response.getBody()), + Vnfd[].class); + return vnfd_array; + } catch (IllegalStateException | IOException e) { + logger.debug(response.getBody()); + logger.error(e.getMessage()); + e.printStackTrace(); + } + return null; + } + + public ResponseEntity getVNFDescriptorsList() { + logger.debug("Get VIMs Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_vnfd_entities = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_vnfd_entities = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_vnfd_entities != null) { + if (get_vnfd_entities.getStatusCode().is5xxServerError() ) { + // handle SERVER_ERROR + + logger.error("Server ERROR:" + get_vnfd_entities.getStatusCode().toString()); + } else if (get_vnfd_entities.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_vnfd_entities.getStatusCode().toString()); + if (get_vnfd_entities.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_vnfd_entities.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_vnfd_entities.getHeaders().toString()); + logger.debug(get_vnfd_entities.getBody()); + logger.debug(get_vnfd_entities.toString()); + return get_vnfd_entities; + } + + public Nsd[] getNSDs() { + ResponseEntity response = this.getOSMResponse("/osm/nsd/v1/ns_descriptors"); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Nsd[] nsd_array = (Nsd[]) mapper.readValue(new YAMLFactory().createParser(response.getBody()), Nsd[].class); + return nsd_array; + + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + return null; + } + + public ResponseEntity createVNFDPackage() { + // Create an instance of VNFD Package to fill. + // This is accomplished by posting to "/osm/vnfpkgm/v1/vnf_packages" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + try { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages", HttpMethod.POST, + request, String.class); + + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity createNSDPackage() { + // Create an instance of VNFD Package to fill. + // This is accomplished by posting to "/osm/vnfpkgm/v1/vnf_packages" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + try { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors", HttpMethod.POST, + request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + private byte[] getByteArrayFromPackagePath(String package_path) throws Exception { + byte[] allBytes; + logger.info("Package path = " + package_path); + if (package_path.contains("http") || package_path.contains("localhost")) { + logger.info("Taking the http/localhost logic path"); + URL url = new URL(package_path); + URLConnection conn = url.openConnection(); + logger.info("Trying to open connection to URL"); + logger.info("URL Connection " + conn.toString()); + int contentLength = conn.getContentLength(); + logger.info("Content-Length:" + contentLength); + InputStream inputStream = url.openStream(); + + ByteArrayOutputStream tmpOut; + if (contentLength != -1) { + tmpOut = new ByteArrayOutputStream(contentLength); + } else { + tmpOut = new ByteArrayOutputStream(16384); // Pick some appropriate size + } + + byte[] buf = new byte[512]; + while (true) { + int len = inputStream.read(buf); + if (len == -1) { + break; + } + tmpOut.write(buf, 0, len); + } + tmpOut.close(); // No effect, but good to do anyway to keep the metaphor alive + allBytes = tmpOut.toByteArray(); + logger.info("Package allBytes size = " + allBytes.length); + logger.info("Package Filesize: " + contentLength + " bytes."); + inputStream.close(); + } else { + logger.info("Taking the local file path"); + InputStream inputStream = new FileInputStream(package_path); + long fileSize = new File(package_path).length(); + allBytes = new byte[(int) fileSize]; + inputStream.read(allBytes); + logger.info("Package Filesize: " + fileSize + " bytes."); + inputStream.close(); + } + return allBytes; + } + + public ResponseEntity uploadVNFDPackageContent(String vnfd_id, String package_path) throws IOException { + + byte[] allBytes; + try { + allBytes = this.getByteArrayFromPackagePath(package_path); + } catch (Exception e) { + logger.error("Error during VNFD Package file uploading! " + e.getStackTrace().toString()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body("Error during VNFD Package file uploading! " + e.getMessage().toString()); + } + + return this.uploadVNFDPackageContent(vnfd_id, allBytes); + } + + @Override + public ResponseEntity uploadNSDPackageContent(String nsd_id, String package_path) throws IOException { + byte[] allBytes; + try { + allBytes = this.getByteArrayFromPackagePath(package_path); + } catch (Exception e) { + logger.error("Error during NSD Package file uploading! " + e.getStackTrace().toString()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body("Error during NSD Package file uploading! " + e.getMessage().toString()); + } + return this.uploadNSDPackageContent(nsd_id, allBytes); + } + + public ResponseEntity uploadVNFDPackageContent(String vnfd_id, byte[] allBytes) throws IOException { + + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/gzip"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity send_zip_request = new HttpEntity<>(allBytes, headers); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/" + vnfd_id + "/package_content", + HttpMethod.PUT, send_zip_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity getVNFDPackageContent(String vnfd_id) throws IOException { + + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/zip"); + headers.add("Accept", "application/zip,application/yaml"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity send_zip_request = new HttpEntity(headers); + ResponseEntity get_vnfd_package_content = null; + try { + get_vnfd_package_content = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/" + vnfd_id + "/vnfd", + HttpMethod.GET, send_zip_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + FileUtils.writeStringToFile(new File("pathname"), get_vnfd_package_content.getBody()); + //.writeByteArrayToFile(new File("pathname"), get_vnfd_package_content.getBody().getBytes(Charset.defaultCharset())); + logger.debug(get_vnfd_package_content); + return get_vnfd_package_content; + } + + public ResponseEntity uploadNSDPackageContent(String nsd_id, byte[] allBytes) throws IOException { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/gzip"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity send_zip_request = new HttpEntity<>(allBytes, headers); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/" + nsd_id + "/nsd_content", HttpMethod.PUT, + send_zip_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + // Creates an NS Instance based on vim_id and nsd_id. + public String createNSInstance(String ns_name, String vim_id, String nsd_id) { + // Response example + // {"notificationType": + // "NsIdentifierCreationNotification","nsName":"mynsi","vimAccountId":"8e0929c5-4cc2-4a78-887f-d3642336e18c","nsdId":"07191481-0213-4b24-a7dd-a2e98e76803c"} + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + // String body="{\"notificationType\": + // \"NsIdentifierCreationNotification\",\"nsName\":\"mynsi\",\"vimAccountId\":\""+vim_id+"\",\"nsdId\":\""+nsd_id+"\"}"; + String body = "{\"notificationType\": \"NsIdentifierCreationNotification\",\"nsName\":\"" + ns_name + + "\",\"vimAccountId\":\"" + vim_id + "\",\"nsdId\":\"" + nsd_id + "\"}"; + + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity create_ns_instance_entity = null; + logger.debug(create_ns_instance_request); + try { + create_ns_instance_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (create_ns_instance_entity != null) { + if (create_ns_instance_entity.getStatusCode().is5xxServerError() ) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + } else if (create_ns_instance_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + if (create_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + return null; + } + + if (create_ns_instance_entity.getStatusCode() == HttpStatus.NO_CONTENT) { + logger.error("No Content Replied!"); + } + if (create_ns_instance_entity.getStatusCode() == HttpStatus.CREATED) { + logger.info("NS Instance Creation Succeded!"); + } + logger.debug(create_ns_instance_entity.getBody()); + JSONObject obj = new JSONObject(create_ns_instance_entity.getBody()); + String ns_instance_id = obj.getString("id"); + logger.info("The new NS Instance id is :" + ns_instance_id); + return ns_instance_id; + } + + public ResponseEntity createNSInstance2(String payload) { + // Response example + // {"notificationType": + // "NsIdentifierCreationNotification","nsName":"mynsi","vimAccountId":"8e0929c5-4cc2-4a78-887f-d3642336e18c","nsdId":"07191481-0213-4b24-a7dd-a2e98e76803c"} + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + // String body="{\"notificationType\": + // \"NsIdentifierCreationNotification\",\"nsName\":\"mynsi\",\"vimAccountId\":\""+vim_id+"\",\"nsdId\":\""+nsd_id+"\"}"; + String body = payload; + + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity create_ns_instance_entity = null; + logger.debug(create_ns_instance_request); + try { + create_ns_instance_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (create_ns_instance_entity != null) { + if (create_ns_instance_entity.getStatusCode().is5xxServerError() ) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + } else if (create_ns_instance_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + if (create_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + } + + return create_ns_instance_entity; + } + + public ResponseEntity createNSInstance(String payload) { + // Response example + // {"notificationType": + // "NsIdentifierCreationNotification","nsName":"mynsi","vimAccountId":"8e0929c5-4cc2-4a78-887f-d3642336e18c","nsdId":"07191481-0213-4b24-a7dd-a2e98e76803c"} + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + // String body="{\"notificationType\": + // \"NsIdentifierCreationNotification\",\"nsName\":\"mynsi\",\"vimAccountId\":\""+vim_id+"\",\"nsdId\":\""+nsd_id+"\"}"; + String body = payload; + + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/", HttpMethod.POST, + create_ns_instance_request, String.class); + + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public JSONObject getNSInstanceInfo(String ns_instance_id) { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_instances/" + ns_instance_id); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONObject ns_instance_info_obj = new JSONObject(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public JSONArray getAllNSInstanceInfo() { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_instances/"); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONArray ns_instance_info_obj = new JSONArray(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public JSONObject getNSInstanceContentInfo(String ns_instance_id) { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_instances_content/" + ns_instance_id); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONObject ns_instance_info_obj = new JSONObject(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public JSONObject getNSLCMDetails(String nsLcmOpOccId) { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_lcm_op_occs/" + nsLcmOpOccId); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONObject ns_instance_info_obj = new JSONObject(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public ResponseEntity getNSLCMDetailsList() { + return this.getOSMResponse("/osm/nslcm/v1/ns_lcm_op_occs/"); + } + + public JSONObject getVNFInstanceInfo(String vnf_instance_id) { + ResponseEntity vnf_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/vnf_instances/" + vnf_instance_id); + JSONObject vnf_instance_info_obj = new JSONObject(vnf_instance_id_info_response.getBody()); + return vnf_instance_info_obj; + } + + public String getPDUDetails() { + ResponseEntity pdu_details_response = this.getOSMResponse("/pdu/v1/pdu_descriptors/"); + // JSONObject pdu_details_response_obj = new + // JSONObject(pdu_details_response.getBody()); + return pdu_details_response.toString(); + } + + public ResponseEntity getVNFInstanceInfoNew(String vnf_instance_id) { + ResponseEntity vnf_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/vnf_instances/" + vnf_instance_id); + // We should check if we got an error response. + // If we didn't we could do the JSON conversion in the application + // If we did get an error response we should decide on the behavior + try { + return vnf_instance_id_info_response; + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity instantiateNSInstance(String ns_instance_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/instantiate"); + + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/instantiate", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity actionNSInstance(String ns_instance_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/action"); + + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/action", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public String terminateNSInstance(String ns_instance_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate"); + + ResponseEntity terminate_ns_instance_entity = null; + try { + terminate_ns_instance_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate", + HttpMethod.POST, request, String.class); + } catch (RuntimeException e) { + if (terminate_ns_instance_entity != null) { + if (terminate_ns_instance_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + terminate_ns_instance_entity.getStatusCode().toString()); + } else if (terminate_ns_instance_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + terminate_ns_instance_entity.getStatusCode().toString()); + if (terminate_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + terminate_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + return null; + } + + if (terminate_ns_instance_entity.getStatusCode() == HttpStatus.NO_CONTENT) { + logger.error("No Content Replied!"); + } + if (terminate_ns_instance_entity.getStatusCode() == HttpStatus.CREATED) { + logger.info("NS Termination Succeded!"); + } + logger.debug(terminate_ns_instance_entity.getBody()); + JSONObject obj = new JSONObject(terminate_ns_instance_entity.getBody()); + String ns_instanciation_id = obj.getString("id"); + logger.info("The NS termination id is :" + ns_instanciation_id); + return ns_instanciation_id; + + } + + public ResponseEntity terminateNSInstanceNew(String ns_instance_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate"); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate", + HttpMethod.POST, request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity deleteNSInstance(String ns_instance_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity delete_ns_instance_entity = null; + delete_ns_instance_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id, HttpMethod.DELETE, request, + String.class); + if (delete_ns_instance_entity != null) { + if (delete_ns_instance_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + delete_ns_instance_entity.getStatusCode().toString()); + } else if (delete_ns_instance_entity.getStatusCode().is4xxClientError() ) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + delete_ns_instance_entity.getStatusCode().toString()); + if (delete_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + delete_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + + if (delete_ns_instance_entity.getStatusCode() == HttpStatus.NO_CONTENT) { + logger.error("No Content Replied!"); + } + if (delete_ns_instance_entity.getStatusCode() == HttpStatus.CREATED) { + logger.info("NS Deletion Succeded!"); + } + logger.debug("The NS instance deletion response is :" + delete_ns_instance_entity.getBody()); + return delete_ns_instance_entity; + } + + public ResponseEntity deleteNSInstanceNew(String ns_instance_id, boolean force) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + try { + if (force) { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "?FORCE=TRUE", + HttpMethod.DELETE, request, String.class); + } else { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id, + HttpMethod.DELETE, request, String.class); + } + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public Vnfd getVNFDbyID(String aVNFDid) { + logger.debug("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ResponseEntity response = this.getOSMResponse("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Vnfd vnfd = (Vnfd) mapper.readValue(new YAMLFactory().createParser(response.getBody()), Vnfd.class); + return vnfd; + } catch (IllegalStateException | IOException e) { +// logger.error(e.getMessage() ); + e.printStackTrace(); + } + return null; + } + + public Nsd getNSDbyID(String aNSDid) { + logger.debug("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ResponseEntity response = this.getOSMResponse("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Nsd nsd = (Nsd) mapper.readValue(new YAMLFactory().createParser(response.getBody()), Nsd.class); + logger.debug(nsd.toString()); + return nsd; + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + return null; + } + + public void deleteVNFDbyID(String aVNFDid) { + logger.debug("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ResponseEntity response = this.getOSMDeleteResponse("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Vnfd vnfd = mapper.readValue(new YAMLFactory().createParser(response.getBody()), Vnfd.class); + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + } + + public ResponseEntity deleteVNFDPackage(String vnfd_id) throws HttpClientErrorException { + // Create an instance of VNFD Package to fill. + // This is accomplished by posting to "/osm/vnfpkgm/v1/vnf_packages" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = null; + try { + entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/" + vnfd_id, + HttpMethod.DELETE, request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + logger.info("The delete NSD Package with id " + vnfd_id + " returned :" + entity.toString()); + + return entity; + } + + public void deleteNSDbyID(String aNSDid) { + logger.debug("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ResponseEntity response = this.getOSMDeleteResponse("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Nsd nsd = mapper.readValue(new YAMLFactory().createParser(response.getBody()), Nsd.class); + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + } + + public ResponseEntity deleteNSDPackage(String nsd_id) { + // Create an instance of NSD Package to fill. + // This is accomplished by posting to "/osm/nsd/v1/ns_descriptors/" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = null; + try { + entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/" + nsd_id, + HttpMethod.DELETE, request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + logger.info("The delete NSD Package with id " + nsd_id + " returned :" + entity.toString()); + return entity; + } + + public void authenticateMANO() throws HttpStatusCodeException { + // use the TrustSelfSignedStrategy to allow Self Signed Certificates + SSLContext sslContext; + try { + sslContext = SSLContextBuilder.create().loadTrustMaterial(new TrustSelfSignedStrategy()).build(); + // we can optionally disable hostname verification. + // if you don't want to further weaken the security, you don't have to include + // this. + HostnameVerifier allowAllHosts = new NoopHostnameVerifier(); + + // create an SSL Socket Factory to use the SSLContext with the trust self signed + // certificate strategy + // and allow all hosts verifier. + SSLConnectionSocketFactory sslConnectionFactory = new SSLConnectionSocketFactory(sslContext, allowAllHosts); + RegistryBuilder registryBuilder = RegistryBuilder.create(); + registryBuilder.register("https", sslConnectionFactory); + registryBuilder.register("http", PlainConnectionSocketFactory.INSTANCE); + Registry rgb = registryBuilder.build(); + + HttpClientConnectionManager ccm = new PoolingHttpClientConnectionManager( rgb ); + + httpClient = HttpClients + .custom() + .setConnectionManager(ccm) + .setDefaultRequestConfig(RequestConfig.custom().setCookieSpec( StandardCookieSpec.STRICT ).build()) + .build(); + requestFactory = new HttpComponentsClientHttpRequestFactory(); + + requestFactory.setHttpClient(httpClient); + requestFactory.setConnectTimeout(2000); + } catch (KeyManagementException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (KeyStoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + String body = "{\"password\": \"" + this.getMANOPassword() + "\", \"username\": \"" + this.getMANOUsername() + + "\", \"project_id\": \"" + this.getMANOProjectId() + "\"}"; + HttpEntity request = new HttpEntity(body, headers); + logger.debug(request.toString()); + ResponseEntity entity = null; + entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/tokens/", HttpMethod.POST, request, + String.class); + logger.debug(entity.getHeaders().toString()); + logger.debug(entity.getBody()); + logger.debug(entity.toString()); + + JSONObject obj = new JSONObject(entity.getBody()); + this.setΜΑΝΟAuthorizationBasicHeader(obj.getString("id")); + OSM10Client.setManoAuthorizationTokenTimeout(obj.getDouble("expires")); + OSM10Client.setManoAuthorizationTokenID(obj.getString("id")); +// try { +// httpClient.close(); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + } + + private static String getManoAuthorizationTokenID() { + // TODO Auto-generated method stub + return OSM10Client.manoAuthorizationTokenID; + } + + private static void setManoAuthorizationTokenID(String tokenID) { + // TODO Auto-generated method stub + OSM10Client.manoAuthorizationTokenID = tokenID; + } + + public String getMANOApiEndpoint() { + return manoApiEndpoint; + } + + public void setMANOApiEndpoint(String apiEndpoint) { + this.manoApiEndpoint = apiEndpoint; + } + + /** + * @return the project_id + */ + public String getMANOProjectId() { + return manoProjectId; + } + + /** + * @param project_id the project_id to set + */ + public void setMANOProjectId(String project_id) { + this.manoProjectId = project_id; + } + + /** + * @return the username + */ + private String getMANOUsername() { + return manoUsername; + } + + /** + * @param username the username to set + */ + public void setMANOUsername(String username) { + this.manoUsername = username; + } + + /** + * @return the password + */ + private String getMANOPassword() { + return manoPassword; + } + + /** + * @param password the password to set + */ + public void setMANOPassword(String password) { + this.manoPassword = password; + } + + public String getMANOAuthorizationBasicHeader() { + return manoAuthorizationBasicHeader; + } + + public void setΜΑΝΟAuthorizationBasicHeader(String authorizationBasicHeader) { + this.manoAuthorizationBasicHeader = authorizationBasicHeader; + } + + /** + * @return the manoAuthorizationTokenTimeout + */ + public static Double getManoAuthorizationTokenTimeout() { + return manoAuthorizationTokenTimeout; + } + + /** + * @param manoAuthorizationTokenTimeout the manoAuthorizationTokenTimeout to set + */ + public static void setManoAuthorizationTokenTimeout(double manoAuthorizationTokenTimeout) { + OSM10Client.manoAuthorizationTokenTimeout = manoAuthorizationTokenTimeout; + } + + public String getNSLCMDetailsListByNSID(String nsid) { + ResponseEntity response = this.getOSMResponse("/osm/nslcm/v1/ns_lcm_op_occs/"); + String response_body = response.getBody(); + try { + JSONArray array = new JSONArray(response_body); + JSONArray array2 = new JSONArray(); + for (int i = 0; i < array.length(); ++i) { + JSONObject obj = array.getJSONObject(i); + String id = obj.getString("nsInstanceId"); + if (id.equals(nsid)) { + array2.put(obj); + } + + } + return array2.toString(); + } catch (JSONException e) { + return null; + } + } + + @Override + public ResponseEntity scaleNSInstance(String ns_instance_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/scale"); + + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/scale", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + + public void getNSDescriptors() { + ResponseEntity response = this.getOSMResponse("/osm/nsd/v1/ns_descriptors/"); + logger.debug(response.getHeaders().toString()); + logger.debug(response.getBody()); + } + + public ResponseEntity getNSDescriptorsList() { + logger.debug("Get NSDs Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_nsd_entities = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_nsd_entities = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_nsd_entities != null) { + if (get_nsd_entities.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + get_nsd_entities.getStatusCode().toString()); + } else if (get_nsd_entities.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_nsd_entities.getStatusCode().toString()); + if (get_nsd_entities.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_nsd_entities.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_nsd_entities.getHeaders().toString()); + logger.debug(get_nsd_entities.getBody()); + logger.debug(get_nsd_entities.toString()); + return get_nsd_entities; + } + + public ResponseEntity getNSInstancesList() { + logger.debug("Get NSInstances Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_ns_instances = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_ns_instances = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_ns_instances != null) { + if (get_ns_instances.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + get_ns_instances.getStatusCode().toString()); + } else if (get_ns_instances.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_ns_instances.getStatusCode().toString()); + if (get_ns_instances.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_ns_instances.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_ns_instances.getHeaders().toString()); + logger.debug(get_ns_instances.getBody()); + logger.debug(get_ns_instances.toString()); + return get_ns_instances; + } + + public ResponseEntity getVIMs() + { + logger.debug("Get VIMs Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_vim_entities = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_vim_entities = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_vim_entities != null) { + if (get_vim_entities.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + get_vim_entities.getStatusCode().toString()); + } else if (get_vim_entities.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_vim_entities.getStatusCode().toString()); + if (get_vim_entities.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_vim_entities.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_vim_entities.getHeaders().toString()); + logger.debug(get_vim_entities.getBody()); + logger.debug(get_vim_entities.toString()); + return get_vim_entities; + } + + public ResponseEntity createVim(String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity create_vim_entity = null; + logger.debug(create_ns_instance_request); + try { + create_vim_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (create_vim_entity != null) { + if (create_vim_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_vim_entity.getStatusCode().toString()); + } else if (create_vim_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_vim_entity.getStatusCode().toString()); + if (create_vim_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_vim_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return create_vim_entity; + } + + public ResponseEntity editVim(String vim_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity edit_vim_entity = null; + logger.debug(create_ns_instance_request); + try { + edit_vim_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/" + vim_id + "/", HttpMethod.PATCH, + create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (edit_vim_entity != null) { + if (edit_vim_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + edit_vim_entity.getStatusCode().toString()); + } else if (edit_vim_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + edit_vim_entity.getStatusCode().toString()); + if (edit_vim_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + edit_vim_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return edit_vim_entity; + } +// public ResponseEntity deleteVim() +// {} + + public ResponseEntity createUser(String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_user_request = new HttpEntity<>(body, headers); + ResponseEntity create_user_entity = null; + logger.debug(create_user_request); + try { + create_user_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/users/", + HttpMethod.POST, create_user_request, String.class); + } catch (RuntimeException e) { + if (create_user_entity != null) { + if (create_user_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_user_entity.getStatusCode().toString()); + } else if (create_user_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_user_entity.getStatusCode().toString()); + if (create_user_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_user_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return create_user_entity; + } + + public ResponseEntity editUser(String user_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + // String + // body="{\"password\":\"123\",\"add_project_role_mappings\":[{\"project\":\"admin\",\"role\":\"project_admin\"},{\"project\":\"test\",\"role\":\"project_admin\"}]}"; + // String body="{\"password\":\"1234\"}"; + // {"username":"ioannis","password":"123","projects":["admin","test"],"project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"add_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"remove_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}]} + + HttpEntity edit_user_request = new HttpEntity<>(body, headers); + ResponseEntity edit_user_entity = null; + logger.debug(edit_user_request); + try { + edit_user_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/users/" + user_id + "/", + HttpMethod.PATCH, edit_user_request, String.class); + } catch (RuntimeException e) { + if (edit_user_entity != null) { + if (edit_user_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + edit_user_entity.getStatusCode().toString()); + } else if (edit_user_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + edit_user_entity.getStatusCode().toString()); + if (edit_user_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + edit_user_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + return edit_user_entity; + } + + public ResponseEntity createProject(String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_project_request = new HttpEntity<>(body, headers); + ResponseEntity create_project_entity = null; + logger.debug(create_project_request); + try { + create_project_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/projects/", + HttpMethod.POST, create_project_request, String.class); + } catch (RuntimeException e) { + if (create_project_entity != null) { + if (create_project_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_project_entity.getStatusCode().toString()); + } else if (create_project_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_project_entity.getStatusCode().toString()); + if (create_project_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_project_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return create_project_entity; + } + + public ResponseEntity editProject(String project_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity edit_project_request = new HttpEntity<>(body, headers); + ResponseEntity edit_user_entity = null; + logger.debug(edit_project_request); + try { + edit_user_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/projects/" + project_id + "/", HttpMethod.PATCH, + edit_project_request, String.class); + } catch (RuntimeException e) { + if (edit_user_entity != null) { + if (edit_user_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + edit_user_entity.getStatusCode().toString()); + } else if (edit_user_entity.getStatusCode().is4xxClientError() ) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + edit_user_entity.getStatusCode().toString()); + if (edit_user_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + edit_user_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + return edit_user_entity; + } + + public ResponseEntity getProjectDeleteResponse(String project_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/projects/" + project_id + "/", HttpMethod.DELETE, request, + String.class); + return entity; + } + + public ResponseEntity getUserDeleteResponse(String user_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/users/" + user_id + "/", HttpMethod.DELETE, request, + String.class); + return entity; + } + + public ResponseEntity getVIMDeleteResponse(String vim_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/" + vim_id + "/", HttpMethod.DELETE, request, + String.class); + return entity; + } + +// public ResponseEntity deleteUser() +// {} +// + +// public ResponseEntity createProject() +// {} +// public ResponseEntity editProject() +// {} +// public ResponseEntity deleteProject() +// {} +// + +// +// public ResponseEntity createRole() +// {} +// public ResponseEntity editRole() +// {} +// public ResponseEntity deleteRole() +// {} + +} diff --git a/src/main/java/OSM10NBIClient/OSM10NBIClientT.java b/src/main/java/OSM10NBIClient/OSM10NBIClientT.java new file mode 100644 index 0000000..07e1c94 --- /dev/null +++ b/src/main/java/OSM10NBIClient/OSM10NBIClientT.java @@ -0,0 +1,488 @@ +package OSM10NBIClient; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.jdt.annotation.Nullable; +import org.etsi.osl.sol005nbi.OSMClient; +import org.json.JSONArray; +import org.json.JSONObject; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.nsd.constituent.vnfd.ConstituentVnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.nsd.constituent.vnfd.ConstituentVnfdKey; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.Nsd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.vnfd.rev170228.project.vnfd.catalog.Vnfd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.NsdBuilder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.NsdBuilder; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.vnfd.rev170228.project.vnfd.catalog.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.vnfr.rev170228.project.vnfr.catalog.vnfr.VnfdBuilder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder; + +import org.springframework.http.ResponseEntity; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import OSM10NBIClient.NSInstantiateInstanceRequestPayload.NInterface; +import OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vdu; +import OSM10Util.OSM10VNFReq.OSM10VNFRequirements; + +public class OSM10NBIClientT { + + public static void main(String args[]) { + OSM10Client OSM10Client = new OSM10Client("https://10.10.10.41:9999","admin","admin","admin"); + String body="{\"username\":\"ioannis\",\"domain_name\":\"test\",\"password\":\"123\",\"projects\":[\"admin\",\"test\"],\"project_role_mappings\":[{\"project\":\"admin\",\"role\":\"system_admin\"},{\"project\":\"test\",\"role\":\"system_admin\"}]}"; + //{"username":"ioannis","domain_name":"test","password":"123","projects":["admin","test"],"project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}]} + //String body = payload; + +// //PROJECT CREATE +// ProjectCreateRequestPayload payloadCreateProject = new ProjectCreateRequestPayload(); +// payloadCreateProject.setName("test5"); +// payloadCreateProject.setAdmin(true); +// payloadCreateProject.setDomain_name("test"); +// OSM10Client.createProject(payloadCreateProject.toJSON()); + +// //PROJECT EDIT +// ProjectEditRequestPayload payloadEditProject = new ProjectEditRequestPayload(); +// payloadEditProject.setAdmin(false); +// payloadEditProject.setName("test6"); +// OSM10Client.editProject("521ff1e9-f980-475f-9266-c428de028f37",payloadEditProject.toJSON()); + + //OSM10Client.getProjectDeleteResponse("b127ae37-b39a-4c3e-abe8-8ffb2b4bd61f"); + +// //USER CREATE +// UserCreateRequestPayload payloadNewUser = new UserCreateRequestPayload(); +// payloadNewUser.setUsername("ioannis3"); +// payloadNewUser.setDomain_name("test"); +// payloadNewUser.setPassword("123"); +// List tmpProjects = new ArrayList(); +// tmpProjects.add("admin"); +// tmpProjects.add("test"); +// payloadNewUser.setProjects(tmpProjects); +// ProjectRoleMapping prm = new ProjectRoleMapping("admin","system_admin"); +// List prml = new ArrayList(); +// prml.add(prm); +// prm = new ProjectRoleMapping("test","system_admin"); +// prml.add(prm); +// payloadNewUser.setProject_role_mappings(prml); +// //System.out.println("Payload "+payloadNewUser.toJSON()); +// OSM10Client.createUser(payloadNewUser.toJSON()); + + //USER EDIT +// UserEditRequestPayload payloadEditUser = new UserEditRequestPayload(); +// //payloadEditUser.setUsername("ioannis3"); +// payloadEditUser.setPassword("123"); +// List tmpProjectsEdit = new ArrayList(); +// tmpProjectsEdit.add("admin"); +// tmpProjectsEdit.add("test"); +// tmpProjectsEdit.add("test2"); +// payloadEditUser.setProjects(tmpProjectsEdit); +// List prmlEdit = new ArrayList(); +// prmlEdit.add(new ProjectRoleMapping("admin","system_admin")); +// prmlEdit.add(new ProjectRoleMapping("test","project_user")); +// prmlEdit.add(new ProjectRoleMapping("test2","project_user")); +// payloadEditUser.setProject_role_mappings(prmlEdit); +//// List prmlEdit2 = new ArrayList(); +//// prmlEdit2.add(new ProjectRoleMapping("test2","system_admin")); +//// payloadEditUser.setAdd_project_role_mappings(prmlEdit2); +//// System.out.println("Payload "+payloadEditUser.toJSON()); +// OSM10Client.editUser("1914ec5b-af9a-4f32-8806-b6aa29b302f2",payloadEditUser.toJSON()); + + +// //VIM CREATE +// VIMCreateRequestPayload payloadNewVIM = new VIMCreateRequestPayload(); +// payloadNewVIM.setName("CloudVille3"); +// payloadNewVIM.setVim_type("openstack"); +// payloadNewVIM.setVim_url("http://10.80.0.11:5000/v3/"); +// payloadNewVIM.setVim_tenant_name("OSMFIVE"); +// payloadNewVIM.setVim_user("osmfivevim"); +// payloadNewVIM.setVim_password("osmfivevim5g#"); +// OSM10Client.createVim(payloadNewVIM.toJSON()); + ResponseEntity vims_list_entity = OSM10Client.getVIMs(); + if (vims_list_entity == null || vims_list_entity.getStatusCode().is4xxClientError() + || vims_list_entity.getStatusCode().is5xxServerError()) { + System.out.println("VIMs List Get Request failed. Status Code:" + vims_list_entity.getStatusCode().toString() + + ", Payload:" + vims_list_entity.getBody().toString()); + } else { + // NS action starts + System.out.println("Got VIM list "+vims_list_entity.getBody()); + } + + try { + ResponseEntity vnfd_package_content = OSM10Client.getVNFDPackageContent("5261da07-b38f-4115-863c-1465893bd8d3"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + JSONArray tmp = OSM10Client.getAllNSInstanceInfo(); + System.out.println(tmp.toString()); +// +// //VIM EDIT +// VIMEditRequestPayload payloadEditVIM = new VIMEditRequestPayload(); +// payloadEditVIM.setName("CloudVille"); +// payloadEditVIM.setVim_url("http://10.80.0.11:5000/v3/"); +// payloadEditVIM.setVim_type("Openstack"); +// payloadEditVIM.setDatacenter("datacenter"); +// payloadEditVIM.setDescription("description"); +// payloadEditVIM.setVim_password("osmfivevim5g#"); +// payloadEditVIM.setVim_user("OSMFIVE"); +// String vim_id = "6d080e3b-cbd1-4c4e-a114-9c556c285eb4"; +// OSM10Client.editVim(vim_id,payloadEditVIM.toJSON()); + + +// System.out.println("************************"); +// System.out.println("Getting Users"); +// System.out.println("************************"); +// OSM10Client.getUsers(); +// System.out.println("************************"); +// System.out.println("Getting VNFPackages"); +// System.out.println("************************"); +// OSM10Client.getVNFPackages(); +// System.out.println("************************"); +// System.out.println("Getting VNFDs"); +// System.out.println("************************"); +// Vnfd[] vnfds = OSM10Client.getVNFDs(); +// if(vnfds!=null) +// { +// for (Vnfd v : vnfds) { +// System.out.println("=== LIST VNFDs POJO object response: " + v.toString()); +// System.out.println("=== LIST VNFDs POJO object id: " + v.getId() + ", Name: " + v.getProductName()); +// Vnfd tmp_vnfd = OSM10Client.getVNFDbyID(v.getId()); +// System.out.println("=== LIST VNFDs POJO object id: " + tmp_vnfd.getId() + ", Name: " + tmp_vnfd.getProductName()); +// } +// } +// System.out.println("************************"); +// System.out.println("Getting NSDescriptors"); +// System.out.println("************************"); +// OSM10Client.getNSDescriptors(); +// System.out.println("************************"); +// System.out.println("Getting NSDs"); +// System.out.println("************************"); +// Nsd[] nsds = OSM10Client.getNSDs(); +// for (Nsd v : nsds) { +// System.out.println("=== LIST NSDs POJO object response: " + v.toString()); +// System.out.println("=== LIST NSDs POJO object id: " + v.getId() + ", Name: " + v.getName()); +// Nsd tmp_nsd = OSM10Client.getNSDbyID(v.getId()); +// System.out.println("=== LIST NSDs POJO object id: " + tmp_nsd.getId() + ", Name: " + tmp_nsd.getName()); +// } +// System.out.println("Working Directory = " +System.getProperty("user.dir")); +// +// //Create VNFD +// System.out.println("************************"); +// System.out.println("Creating VNF Instance"); +// System.out.println("************************"); +// ResponseEntity response = null; +// response = OSM10Client.createVNFDPackage(); +// if (response == null || response.getStatusCode().is4xxClientError() || response.getStatusCode().is5xxServerError()) { +// System.out.println("VNFD Package Creation failed."); +// return; +// } +// else +// { +// JSONObject obj = new JSONObject(response.getBody()); +// String vnfd_id = obj.getString("id"); +// System.out.println(response.getStatusCode()+" replied. The new VNFD Package id is :" + vnfd_id); +// System.out.println("Uploading VNF Package from URL"); +// System.out.println("************************"); +// String vnfd_package_path = "http://localhost/osm/hackfest_multivdu_vnf.tar.gz"; +// try { +// response = OSM10Client.uploadVNFDPackageContent(vnfd_id, vnfd_package_path); +// if (response == null || response.getStatusCode().is4xxClientError() +// || response.getStatusCode().is5xxServerError()) { +// System.out.println("Upload of VNFD Package Content failed. Deleting VNFD Package."+response.getBody()); +// // Delete the package from the OSM +// OSM10Client.deleteVNFDPackage(vnfd_id); +// return; +// } +// else +// { +// System.out.println("VNFD Package uploaded successfully"); +// } +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + +//// System.out.println("************************"); +//// System.out.println("Uploading VNF Zip from local file"); +//// System.out.println("************************"); +//// String vnfd_zip_path = "./src/main/resources/temp/cirros_vnf.tar.gz"; +//// try +//// { +//// OSM10Client.uploadVNFDZip(vnfd_id, vnfd_zip_path); +//// } +//// catch(IOException e) +//// { +//// System.out.println(e.getMessage()); +//// return; +//// } + +// System.out.println("Uploading NSD Package from URL"); +// System.out.println("************************"); +// String nsd_package_path = "http://localhost/osm/hackfest_multivdu_ns.tar.gz"; +// String nsd_id = null; +// response = OSM10Client.createNSDPackage(); +// if (response == null || response.getStatusCode().is4xxClientError() || response.getStatusCode().is5xxServerError()) { +// System.out.println("NSD Package Creation failed."); +// return; +// } +// else +// { +// JSONObject obj = new JSONObject(response.getBody()); +// nsd_id = obj.getString("id"); +// System.out.println(response.getStatusCode()+" replied. The new NSD Package id is :" + nsd_id); +// System.out.println("Uploading NS Package from URL"); +// System.out.println("************************"); +// try { +// response = OSM10Client.uploadNSDPackageContent(nsd_id, nsd_package_path); +// if (response == null || response.getStatusCode().is4xxClientError() +// || response.getStatusCode().is5xxServerError()) { +// System.out.println("Upload of NSD Package Content failed. Deleting NSD Package."); +// // Delete the package from the OSM +// OSM10Client.deleteVNFDPackage(nsd_id); +// return; +// } +// else +// { +// System.out.println("NSD Package uploaded successfully"); +// } +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } +// +// //Create NSD +// System.out.println("************************"); +// System.out.println("Uploading NSD Zip from local file"); +// System.out.println("************************"); +// System.out.println("************************"); +// System.out.println("Creating NSD Instance"); +// System.out.println("************************"); +// String nsd_id = OSM10Client.createNSDPackage(); +// // TODO Handle failure acquiring a vnfd_id +// System.out.println("************************"); +// System.out.println("Uploading NSD Zip"); +// System.out.println("************************"); +// String nsd_zip_path = "C:/EP/OSMDEVOPS/OSMvFIVE_NSDs/cirros_2vnf_ns_b.tar.gz"; +// OSM10Client.uploadNSDZip(nsd_id, nsd_zip_path); +// +// //Create NS Instance +// System.out.println("************************"); +// System.out.println("Creating NS Instance"); +// System.out.println("************************"); +// String vim_id="033797cd-cc1e-4727-b9a6-9f7024c92c6e"; +// String ns_instance_id = OSM10Client.createNSInstance("test",vim_id, nsd_id); +// if(ns_instance_id!=null) +// { +// OSM10Client.InstantiateNSInstance(ns_instance_id); +// } +// pressAnyKeyToContinue(); +// if(ns_instance_id!=null) +// { +// OSM10Client.deleteNSInstance(ns_instance_id); +// } + + } +// @Nullable Map constituentVnfds = OSM10Client.getNSDbyID(nsd_id).getConstituentVnfd(); +// NSCreateInstanceRequestPayload nscreateinstancerequestpayload = new NSCreateInstanceRequestPayload(); +// nscreateinstancerequestpayload.setNsName("test"); +// nscreateinstancerequestpayload.setVimAccountId("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// nscreateinstancerequestpayload.setWimAccountId(false); +// // Here we need to get the ExperimentOnBoardDescriptor based on the Experiment. +// // An Experiment might have multiple OnBoardDescriptors if it is OnBoarded to multiple OSM MANOs. +// // We temporarily select the first (and most probably the only one). +// // Otherwise the user needs to define the OSM MANO where the Experiment is OnBoarded in order to instantiate. +// nscreateinstancerequestpayload.setNsdId(nsd_id); +// Integer count = 0; +// for(ConstituentVnfd constituenVnfd : constituentVnfds.values()) +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.VnF vnf_tmp = nscreateinstancerequestpayload.new VnF(); +// count=count+1; +// vnf_tmp.setMemberVnFIndex(count.toString()); +// if(count!=2) +// vnf_tmp.setVimAccount("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// else +// { +// vnf_tmp.setVimAccount("8571aa95-4c17-4d87-a865-c98126dd0241"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vdu vdu_tmp = nscreateinstancerequestpayload.new Vdu(); +// vdu_tmp.setId("cirros_vnfd-VM"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.NInterface interface_tmp = nscreateinstancerequestpayload.new NInterface(); +// interface_tmp.setName("eth0"); +// interface_tmp.setFloating_ip_required(true); +// vdu_tmp.setInterfaceObj(new ArrayList()); +// vdu_tmp.getInterfaceObj().add(interface_tmp); +// vnf_tmp.setVdu(new ArrayList()); +// vnf_tmp.getVdu().add(vdu_tmp); +// } +// nscreateinstancerequestpayload.getVnf().add(vnf_tmp); +// } +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp = nscreateinstancerequestpayload.new Vld(); +// vld_tmp.setName("cirros_3vnf_nsd_vld1"); +// +//// IpProfileParamsBuilder ipprofileparamsbuilder = new IpProfileParamsBuilder(); +//// ipprofileparamsbuilder.setIpVersion(IpVersion.Ipv4); +//// ipprofileparamsbuilder.setSubnetAddress(new IpPrefix(new Ipv4Prefix("192.168.100.0/24"))); +//// ipprofileparamsbuilder.setGatewayAddress(new IpAddress(new Ipv4Address("0.0.0.0"))); +//// List dnsserverlist = new ArrayList(); +//// DnsServerBuilder dnsserverbuilder = new DnsServerBuilder(); +//// dnsserverbuilder.setAddress(new IpAddress(new Ipv4Address("8.8.8.8"))); +//// dnsserverlist.add(dnsserverbuilder.build()); +//// ipprofileparamsbuilder.setDnsServer(dnsserverlist); +//// IpProfileParams ipprofileparams_tmp = ipprofileparamsbuilder.build(); +//// vld_tmp.setIpProfile(ipprofileparams_tmp); +// +// //vld_tmp.setVimNetworkName("OSMFIVE_selfservice01"); +// LinkedHashMap tmp=new LinkedHashMap<>(); +// tmp.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSMFIVE_selfservice01"); +// tmp.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSMFIVE_selfservice01"); +// vld_tmp.setVimNetworkName(tmp); +// nscreateinstancerequestpayload.getVld().add(vld_tmp); +// +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp2 = nscreateinstancerequestpayload.new Vld(); +// vld_tmp2.setName("cirros_3vnf_nsd_vld2"); +// //vld_tmp2.setVimNetworkName("OSM_mgmt_net"); +// LinkedHashMap tmp2=new LinkedHashMap<>(); +// tmp2.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSM_mgmt_net"); +// tmp2.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSM_mgmt_net"); +// vld_tmp2.setVimNetworkName(tmp2); +// nscreateinstancerequestpayload.getVld().add(vld_tmp2); +// } +// //String tmptmp="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\"65a644b1-6079-44ba-a227-34577079928b\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"},{\"member-vnf-index\":\"3\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}],\"vld\":[{\"name\":\"cirros_3vnf_nsd_vld1\",\"vim-network-name\":\"OSMFIVE_selfservice01\"},{\"name\":\"cirros_3vnf_nsd_vld2\",\"vim-network-name\":\"OSM_mgmt_net\"}]}"; +// // Get Experiment ID and VIM ID and create NS Instance. +// System.out.println("NS Instance creation payload : " + nscreateinstancerequestpayload.toJSON()); +// ResponseEntity ns_instance_creation_entity = OSM10Client.createNSInstance(nscreateinstancerequestpayload.toJSON()); +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\""+nsd_id+"\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\", \"vdu\":[ {\"id\": \"mgmtVM\", \"interface\": [{\"name\": \"mgmtVM-eth0\", \"floating-ip-required\": true }]} ]},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}],\"vld\": [ {\"name\": \"mgmtnet\", \"vim-network-name\": \"OSMFIVE_selfservice01\"}]}"; +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\""+nsd_id+"\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}],\"vld\": [ {\"name\": \"mgmtnet\", \"vim-network-name\": \"OSMFIVE_selfservice01\"}]}"; +// //System.out.println("NS Instance creation payload : " + test_payload); +// //ResponseEntity ns_instance_creation_entity = OSM10Client.createNSInstance(test_payload); +// // The NS Instance ID is set +// +// // NS instance creation +// if (ns_instance_creation_entity == null || ns_instance_creation_entity.getStatusCode().is4xxClientError() +// || ns_instance_creation_entity.getStatusCode().is5xxServerError()) { +// // NS instance creation failed +// System.out.println("NS Instance creation failed with response: "+ ns_instance_creation_entity.getBody().toString()); +// } else { +// // String nsr_id = +// JSONObject ns_instance_creation_entity_json_obj = new JSONObject(ns_instance_creation_entity.getBody()); +// System.out.println("NS creation succeded with "+ns_instance_creation_entity.getBody()); +// String nsd_instance_id = ns_instance_creation_entity_json_obj.getString("id"); +// // Instantiate NS Instance +// NSInstantiateInstanceRequestPayload nsrequestpayload = new NSInstantiateInstanceRequestPayload(); +// nsrequestpayload.setNsName("test"); +// nsrequestpayload.setVimAccountId("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// nsrequestpayload.setWimAccountId(false); +// nsrequestpayload.setNsdId(nsd_id); +// count = 0; +// for(ConstituentVnfd constituenVnfd : constituentVnfds.values()) +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.VnF vnf_tmp = nsrequestpayload.new VnF(); +// count=count+1; +// vnf_tmp.setMemberVnFIndex(count.toString()); +// if(count!=2) +// vnf_tmp.setVimAccount("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// else +// { +// vnf_tmp.setVimAccount("8571aa95-4c17-4d87-a865-c98126dd0241"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vdu vdu_tmp = nscreateinstancerequestpayload.new Vdu(); +// vdu_tmp.setId("cirros_vnfd-VM"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.NInterface interface_tmp = nscreateinstancerequestpayload.new NInterface(); +// interface_tmp.setName("eth0"); +// interface_tmp.setFloating_ip_required(true); +// vdu_tmp.setInterfaceObj(new ArrayList()); +// vdu_tmp.getInterfaceObj().add(interface_tmp); +// vnf_tmp.setVdu(new ArrayList()); +// vnf_tmp.getVdu().add(vdu_tmp); +// } +// nsrequestpayload.getVnf().add(vnf_tmp); +// } +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp = nsrequestpayload.new Vld(); +// vld_tmp.setName("cirros_3vnf_nsd_vld1"); +// +//// IpProfileParamsBuilder ipprofileparamsbuilder = new IpProfileParamsBuilder(); +//// ipprofileparamsbuilder.setIpVersion(IpVersion.Ipv4); +//// ipprofileparamsbuilder.setSubnetAddress(new IpPrefix(new Ipv4Prefix("192.168.100.0/24"))); +//// ipprofileparamsbuilder.setGatewayAddress(new IpAddress(new Ipv4Address("0.0.0.0"))); +//// List dnsserverlist = new ArrayList(); +//// DnsServerBuilder dnsserverbuilder = new DnsServerBuilder(); +//// dnsserverbuilder.setAddress(new IpAddress(new Ipv4Address("8.8.8.8"))); +//// dnsserverlist.add(dnsserverbuilder.build()); +//// ipprofileparamsbuilder.setDnsServer(dnsserverlist); +//// IpProfileParams ipprofileparams_tmp = ipprofileparamsbuilder.build(); +//// vld_tmp.setIpProfile(ipprofileparams_tmp); +// +// //vld_tmp.setVimNetworkName("OSMFIVE_selfservice01"); +// LinkedHashMap tmp=new LinkedHashMap<>(); +// tmp.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSMFIVE_selfservice01"); +// tmp.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSMFIVE_selfservice01"); +// vld_tmp.setVimNetworkName(tmp); +// nsrequestpayload.getVld().add(vld_tmp); +// +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp2 = nsrequestpayload.new Vld(); +// vld_tmp2.setName("cirros_3vnf_nsd_vld2"); +// //vld_tmp2.setVimNetworkName("OSM_mgmt_net"); +// LinkedHashMap tmp2=new LinkedHashMap<>(); +// tmp2.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSM_mgmt_net"); +// tmp2.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSM_mgmt_net"); +// vld_tmp2.setVimNetworkName(tmp2); +// nsrequestpayload.getVld().add(vld_tmp2); +// } +// System.out.println("NS Instantiation payload : " + nsrequestpayload.toJSON()); +// +// +// //String test_payload={"nsName":"test","vimAccountId":"4efd8bf4-5292-4634-87b7-7b3d49108b36","nsdId":"acc18b58-1b82-40e8-8c35-2bfcc8293cdf","vnf":[{"member-vnf-index":"1","vimAccountId":"4efd8bf4-5292-4634-87b7-7b3d49108b36", vdu:[ {id: mgmtVM, interface: [{name: "mgmtVM-eth0", floating-ip-required: true }]} ], vld: [ {name: mgmtnet, vim-network-name: "OSMFIVE_selfservice01"} ]},{"member-vnf-index":"2","vimAccountId":"4efd8bf4-5292-4634-87b7-7b3d49108b36"}]}; +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\"acc18b58-1b82-40e8-8c35-2bfcc8293cdf\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\", vdu:[ {id: mgmtVM, interface: [{name: \"mgmtVM-eth0\", floating-ip-required: true }]} ], vld: [ {name: mgmtnet, vim-network-name: \"OSMFIVE_selfservice01\"} ]},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}]}"; +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\""+nsd_id+"\"}"; +// //ResponseEntity instantiate_ns_instance_entity = OSM10Client.instantiateNSInstance(nsd_instance_id, test_payload); +// // Here we need the feedback +// ResponseEntity instantiate_ns_instance_entity = OSM10Client.instantiateNSInstance(nsd_instance_id, nsrequestpayload.toJSON()); +// if (instantiate_ns_instance_entity == null || instantiate_ns_instance_entity.getStatusCode().is4xxClientError() || instantiate_ns_instance_entity.getStatusCode().is5xxServerError()) { +// System.out.println("NS Instantiation failed. Status Code:" +// + instantiate_ns_instance_entity.getStatusCode().toString() + ", Payload:" +// + ns_instance_creation_entity.getBody().toString()); +// } else { +// // NS Instantiation starts +// System.out.println("NS Instantiation of NS with id" + nsd_instance_id + " started."); +// // Save the changes to DeploymentDescriptor +// } +// } +// +// +// } +//// public OSM10Client() { +//// // Properties file path. +//// String filePath = "osm4.properties.xml"; +//// Properties prop = new Properties(); +//// try (InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(filePath)) { +//// +//// // Loading the properties. +//// prop.loadFromXML(inputStream); +//// +//// // Getting properties +//// this.manoApiEndpoint = prop.getProperty("osm4.apiEndPoint"); +//// this.manoUsername = prop.getProperty("osm4.username"); +//// this.manoPassword = prop.getProperty("osm4.password"); +//// this.manoProjectId = prop.getProperty("osm4.projectId"); +//// } catch (IOException ex) { +//// logger.error("Problem while reading properties file !"); +//// ex.printStackTrace(); +//// } +//// +//// OSM10ClientInit(); +//// } +// + +} diff --git a/src/main/java/OSM10NBIClient/ProjectCreateRequestPayload.java b/src/main/java/OSM10NBIClient/ProjectCreateRequestPayload.java new file mode 100644 index 0000000..3b231cc --- /dev/null +++ b/src/main/java/OSM10NBIClient/ProjectCreateRequestPayload.java @@ -0,0 +1,65 @@ +package OSM10NBIClient; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +//{"name":"test4","quotas":{"vnfds":1,"nsds":0,"slice_templates":0,"pduds":0,"ns_instances":0,"slice_instances":0,"vim_accounts":0,"wim_accounts":0,"sdn_controllers":0,"k8sclusters":0,"k8srepos":0,"osmrepos":1}} +public class ProjectCreateRequestPayload { + + String name; + Boolean admin; + String domain_name; + List> quotas; + + public List> getQuotas() { + return quotas; + } + + public void setQuotas(List> quotas) { + this.quotas = quotas; + } + + public Boolean getAdmin() { + return admin; + } + + public void setAdmin(Boolean admin) { + this.admin = admin; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDomain_name() { + return domain_name; + } + + public void setDomain_name(String domain_name) { + this.domain_name = domain_name; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + + +} diff --git a/src/main/java/OSM10NBIClient/ProjectEditRequestPayload.java b/src/main/java/OSM10NBIClient/ProjectEditRequestPayload.java new file mode 100644 index 0000000..f87b4ea --- /dev/null +++ b/src/main/java/OSM10NBIClient/ProjectEditRequestPayload.java @@ -0,0 +1,54 @@ +package OSM10NBIClient; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class ProjectEditRequestPayload { + + String name; + Boolean admin; + List> quotas; + + public List> getQuotas() { + return quotas; + } + + public void setQuotas(List> quotas) { + this.quotas = quotas; + } + + public Boolean getAdmin() { + return admin; + } + + public void setAdmin(Boolean admin) { + this.admin = admin; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + +} diff --git a/src/main/java/OSM10NBIClient/ProjectRoleMapping.java b/src/main/java/OSM10NBIClient/ProjectRoleMapping.java new file mode 100644 index 0000000..a652e2f --- /dev/null +++ b/src/main/java/OSM10NBIClient/ProjectRoleMapping.java @@ -0,0 +1,24 @@ +package OSM10NBIClient; + +public class ProjectRoleMapping { + private String project; + private String role; + + public ProjectRoleMapping(String project, String role) { + // TODO Auto-generated constructor stub + this.project=project; + this.role=role; + } + public String getProject() { + return project; + } + public void setProject(String project) { + this.project = project; + } + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } +} diff --git a/src/main/java/OSM10NBIClient/UserCreateRequestPayload.java b/src/main/java/OSM10NBIClient/UserCreateRequestPayload.java new file mode 100644 index 0000000..910a96b --- /dev/null +++ b/src/main/java/OSM10NBIClient/UserCreateRequestPayload.java @@ -0,0 +1,73 @@ +package OSM10NBIClient; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class UserCreateRequestPayload { + + private String username; + private String domain_name; + private String password; + private List projects; + + public List getProjects() { + return projects; + } + + public void setProjects(List projects) { + this.projects = projects; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public List getProject_role_mappings() { + return project_role_mappings; + } + + public void setProject_role_mappings(List project_role_mappings) { + this.project_role_mappings = project_role_mappings; + } + + private List project_role_mappings = new ArrayList(); + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getDomain_name() { + return domain_name; + } + + public void setDomain_name(String domain_name) { + this.domain_name = domain_name; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + +} diff --git a/src/main/java/OSM10NBIClient/UserEditRequestPayload.java b/src/main/java/OSM10NBIClient/UserEditRequestPayload.java new file mode 100644 index 0000000..4f1d924 --- /dev/null +++ b/src/main/java/OSM10NBIClient/UserEditRequestPayload.java @@ -0,0 +1,83 @@ +package OSM10NBIClient; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +//{"username":"ioannis","password":"123","projects":["admin","test"],"project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"add_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"remove_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}]} +public class UserEditRequestPayload { + + private String username; + private String password; + private List projects; + private List project_role_mappings = null; + private List add_project_role_mappings = null; + private List remove_project_role_mappings = null; + + + public List getAdd_project_role_mappings() { + return add_project_role_mappings; + } + + public void setAdd_project_role_mappings(List add_project_role_mappings) { + this.add_project_role_mappings = add_project_role_mappings; + } + + public List getRemove_project_role_mappings() { + return remove_project_role_mappings; + } + + public void setRemove_project_role_mappings(List remove_project_role_mappings) { + this.remove_project_role_mappings = remove_project_role_mappings; + } + + public List getProjects() { + return projects; + } + + public void setProjects(List projects) { + this.projects = projects; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public List getProject_role_mappings() { + return project_role_mappings; + } + + public void setProject_role_mappings(List project_role_mappings) { + this.project_role_mappings = project_role_mappings; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + +} diff --git a/src/main/java/OSM10NBIClient/VIMCreateRequestPayload.java b/src/main/java/OSM10NBIClient/VIMCreateRequestPayload.java new file mode 100644 index 0000000..c53855f --- /dev/null +++ b/src/main/java/OSM10NBIClient/VIMCreateRequestPayload.java @@ -0,0 +1,109 @@ +package OSM10NBIClient; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class VIMCreateRequestPayload { + private String schema_version; + private String schema_type; + private String name; + private String description; + private String vim; + private String datacenter; + private String vim_type; + private String vim_url; + private String vim_tenant_name; + private String vim_user; + private String vim_password; + private String config; + + public String getSchema_version() { + return schema_version; + } + public void setSchema_version(String schema_version) { + this.schema_version = schema_version; + } + public String getSchema_type() { + return schema_type; + } + public void setSchema_type(String schema_type) { + this.schema_type = schema_type; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public String getVim() { + return vim; + } + public void setVim(String vim) { + this.vim = vim; + } + public String getDatacenter() { + return datacenter; + } + public void setDatacenter(String datacenter) { + this.datacenter = datacenter; + } + public String getVim_type() { + return vim_type; + } + public void setVim_type(String vim_type) { + this.vim_type = vim_type; + } + public String getVim_url() { + return vim_url; + } + public void setVim_url(String vim_url) { + this.vim_url = vim_url; + } + public String getVim_tenant_name() { + return vim_tenant_name; + } + public void setVim_tenant_name(String vim_tenant_name) { + this.vim_tenant_name = vim_tenant_name; + } + public String getVim_user() { + return vim_user; + } + public void setVim_user(String vim_user) { + this.vim_user = vim_user; + } + public String getVim_password() { + return vim_password; + } + public void setVim_password(String vim_password) { + this.vim_password = vim_password; + } + public String getConfig() { + return config; + } + public void setConfig(String config) { + this.config = config; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + + +} diff --git a/src/main/java/OSM10NBIClient/VIMEditRequestPayload.java b/src/main/java/OSM10NBIClient/VIMEditRequestPayload.java new file mode 100644 index 0000000..0c9d6d9 --- /dev/null +++ b/src/main/java/OSM10NBIClient/VIMEditRequestPayload.java @@ -0,0 +1,94 @@ +package OSM10NBIClient; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class VIMEditRequestPayload { + private String name; + private String description; + private String vim; + private String datacenter; + private String vim_type; + private String vim_url; + private String vim_tenant_name; + private String vim_user; + private String vim_password; + private String config; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public String getVim() { + return vim; + } + public void setVim(String vim) { + this.vim = vim; + } + public String getDatacenter() { + return datacenter; + } + public void setDatacenter(String datacenter) { + this.datacenter = datacenter; + } + public String getVim_type() { + return vim_type; + } + public void setVim_type(String vim_type) { + this.vim_type = vim_type; + } + public String getVim_url() { + return vim_url; + } + public void setVim_url(String vim_url) { + this.vim_url = vim_url; + } + public String getVim_tenant_name() { + return vim_tenant_name; + } + public void setVim_tenant_name(String vim_tenant_name) { + this.vim_tenant_name = vim_tenant_name; + } + public String getVim_user() { + return vim_user; + } + public void setVim_user(String vim_user) { + this.vim_user = vim_user; + } + public String getVim_password() { + return vim_password; + } + public void setVim_password(String vim_password) { + this.vim_password = vim_password; + } + public String getConfig() { + return config; + } + public void setConfig(String config) { + this.config = config; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + +} diff --git a/src/main/java/OSM10NBIClient/testjsonparse.java b/src/main/java/OSM10NBIClient/testjsonparse.java new file mode 100644 index 0000000..9aa3073 --- /dev/null +++ b/src/main/java/OSM10NBIClient/testjsonparse.java @@ -0,0 +1,3977 @@ +package OSM10NBIClient; +//package OSM10NBIClient; +// +//import org.json.JSONArray; +//import org.json.JSONException; +//import org.json.JSONObject; +// +//public class testjsonparse { +// +// public static void main(String args[]) { +// +// String previous = "[\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927630.8796887,\r\n" +// + " \"modified\": 1613927845.185602,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"nsdId\": \"f9e6028b-c244-4125-9143-4f218da44ea9\",\r\n" +// + " \"nsName\": \"test\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\",\r\n" +// + " \"vnf\": [\r\n" +// + " {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\"\r\n" +// + " }\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927630.8796134,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/2efab51b-1357-4c32-a1d8-597b2875fddc\"\r\n" +// + " },\r\n" +// + " \"_id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927845.1855993\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927932.8781176,\r\n" +// + " \"modified\": 1613927964.094152,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927933.033377\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927932.8780527,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\"\r\n" +// + " },\r\n" +// + " \"_id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927964.0941498\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927992.9959521,\r\n" +// + " \"modified\": 1613928045.7064617,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927993.138056\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927992.9959092,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d6c18899-4857-4dd8-81b8-f44078660f16\"\r\n" +// + " },\r\n" +// + " \"_id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613928045.7064598\r\n" +// + " }\r\n" +// + "]"; +// String current = "[\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927630.8796887,\r\n" +// + " \"modified\": 1613927845.185602,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"nsdId\": \"f9e6028b-c244-4125-9143-4f218da44ea9\",\r\n" +// + " \"nsName\": \"test\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\",\r\n" +// + " \"vnf\": [\r\n" +// + " {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\"\r\n" +// + " }\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927630.8796134,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/2efab51b-1357-4c32-a1d8-597b2875fddc\"\r\n" +// + " },\r\n" +// + " \"_id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927845.1855993\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927932.8781176,\r\n" +// + " \"modified\": 1613927964.094152,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927933.033377\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927932.8780527,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\"\r\n" +// + " },\r\n" +// + " \"_id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927964.0941498\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927992.9959521,\r\n" +// + " \"modified\": 1613928045.7064617,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927993.138056\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927992.9959092,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d6c18899-4857-4dd8-81b8-f44078660f16\"\r\n" +// + " },\r\n" +// + " \"_id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613928045.7064598\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613928052.969308,\r\n" +// + " \"modified\": 1613928095.3507125,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613928053.115541\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613928052.9692612,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/38b13afd-a8fc-41fa-8dd3-fbc807348881\"\r\n" +// + " },\r\n" +// + " \"_id\": \"38b13afd-a8fc-41fa-8dd3-fbc807348881\",\r\n" +// + " \"id\": \"38b13afd-a8fc-41fa-8dd3-fbc807348881\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613928095.3507106\r\n" +// + " }\r\n" +// + "]"; +// String response_body = "[\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613908559.4522517,\r\n" +// + " \"modified\": 1613908786.152224,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"nsdId\": \"f9e6028b-c244-4125-9143-4f218da44ea9\",\r\n" +// + " \"nsName\": \"test1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\",\r\n" +// + " \"vnf\": [\r\n" +// + " {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\"\r\n" +// + " }\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"startTime\": 1613908559.4522042,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/62fca486-e858-4f5b-98c5-3dba20f8d553\"\r\n" +// + " },\r\n" +// + " \"_id\": \"62fca486-e858-4f5b-98c5-3dba20f8d553\",\r\n" +// + " \"id\": \"62fca486-e858-4f5b-98c5-3dba20f8d553\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613908786.152222\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909256.2432952,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909225.026151\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:07:04.882729Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9d99076b-570c-4e00-b022-ceaa1e65dc26\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909224.8827221,\r\n" +// + " \"_id\": \"9d99076b-570c-4e00-b022-ceaa1e65dc26\",\r\n" +// + " \"id\": \"9d99076b-570c-4e00-b022-ceaa1e65dc26\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909256.243293\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909296.6228228,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909265.189120\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:07:35.041867Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/6a8a245a-5c4b-488e-a84f-5801f10b2a55\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909255.04186,\r\n" +// + " \"_id\": \"6a8a245a-5c4b-488e-a84f-5801f10b2a55\",\r\n" +// + " \"id\": \"6a8a245a-5c4b-488e-a84f-5801f10b2a55\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909296.6228206\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909331.819041,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909305.441519\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:08:05.283424Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/96865d6e-1261-4cbe-9533-4b5495a5054d\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909285.283418,\r\n" +// + " \"_id\": \"96865d6e-1261-4cbe-9533-4b5495a5054d\",\r\n" +// + " \"id\": \"96865d6e-1261-4cbe-9533-4b5495a5054d\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909331.8190389\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909335.6219559,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:08:35.521255Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1ecf8599-2d7f-4e5e-bd33-b79cbb5bad2e\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909315.5212488,\r\n" +// + " \"_id\": \"1ecf8599-2d7f-4e5e-bd33-b79cbb5bad2e\",\r\n" +// + " \"id\": \"1ecf8599-2d7f-4e5e-bd33-b79cbb5bad2e\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909335.621953\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909375.9247396,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:09:35.822264Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/ec20f68d-e7c0-4bd6-9625-3986aecb4a56\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909375.8222575,\r\n" +// + " \"_id\": \"ec20f68d-e7c0-4bd6-9625-3986aecb4a56\",\r\n" +// + " \"id\": \"ec20f68d-e7c0-4bd6-9625-3986aecb4a56\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909375.924737\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909406.1463256,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:10:06.064572Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/fd745050-bc9c-4b82-98db-97c73ebd96f2\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909406.064563,\r\n" +// + " \"_id\": \"fd745050-bc9c-4b82-98db-97c73ebd96f2\",\r\n" +// + " \"id\": \"fd745050-bc9c-4b82-98db-97c73ebd96f2\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909406.1463227\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909462.8980637,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909436.376222\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:10:36.234204Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/6f4fffa9-46af-4df5-9503-0cd741959cb4\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909436.2341976,\r\n" +// + " \"_id\": \"6f4fffa9-46af-4df5-9503-0cd741959cb4\",\r\n" +// + " \"id\": \"6f4fffa9-46af-4df5-9503-0cd741959cb4\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909462.8980615\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909436.677574,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:10:36.435677Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/89ce4737-83cd-4014-9e5f-e4c69ac7dc8f\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909436.4356704,\r\n" +// + " \"_id\": \"89ce4737-83cd-4014-9e5f-e4c69ac7dc8f\",\r\n" +// + " \"id\": \"89ce4737-83cd-4014-9e5f-e4c69ac7dc8f\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909436.6775715\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909466.8011858,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:11:06.680565Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/466f1317-608f-45b3-8d1f-ef972e9df18d\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909466.680558,\r\n" +// + " \"_id\": \"466f1317-608f-45b3-8d1f-ef972e9df18d\",\r\n" +// + " \"id\": \"466f1317-608f-45b3-8d1f-ef972e9df18d\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909466.801183\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909527.1077504,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:12:07.009793Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d3aa410e-ca75-404e-8947-c3e8a560fd2f\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909527.0097864,\r\n" +// + " \"_id\": \"d3aa410e-ca75-404e-8947-c3e8a560fd2f\",\r\n" +// + " \"id\": \"d3aa410e-ca75-404e-8947-c3e8a560fd2f\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909527.1077466\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909557.2773156,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:12:37.175890Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/17b3eaa8-50af-4a7f-81cf-86a333b74bf3\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909557.1758833,\r\n" +// + " \"_id\": \"17b3eaa8-50af-4a7f-81cf-86a333b74bf3\",\r\n" +// + " \"id\": \"17b3eaa8-50af-4a7f-81cf-86a333b74bf3\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909557.2773128\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909587.4373255,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:13:07.346313Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9e51c559-1d3c-4102-ae30-239423178612\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909587.346306,\r\n" +// + " \"_id\": \"9e51c559-1d3c-4102-ae30-239423178612\",\r\n" +// + " \"id\": \"9e51c559-1d3c-4102-ae30-239423178612\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909587.4373229\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909617.6450963,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:13:37.551139Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8ab152ba-006a-42fa-bb7a-89613997c5c4\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909617.5511324,\r\n" +// + " \"_id\": \"8ab152ba-006a-42fa-bb7a-89613997c5c4\",\r\n" +// + " \"id\": \"8ab152ba-006a-42fa-bb7a-89613997c5c4\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909617.6450934\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909678.0753574,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:14:37.983770Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/621e38f9-fbcf-49f2-8c85-62cf39b8bc1d\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909677.9837644,\r\n" +// + " \"_id\": \"621e38f9-fbcf-49f2-8c85-62cf39b8bc1d\",\r\n" +// + " \"id\": \"621e38f9-fbcf-49f2-8c85-62cf39b8bc1d\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909678.0753548\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909708.3707678,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:15:08.256051Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/3e17aeda-c027-4750-9bea-6a887521d51e\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909708.25604,\r\n" +// + " \"_id\": \"3e17aeda-c027-4750-9bea-6a887521d51e\",\r\n" +// + " \"id\": \"3e17aeda-c027-4750-9bea-6a887521d51e\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909708.3707652\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909738.3489835,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:15:38.253779Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/87aa1856-545f-43fb-bd08-1d8fc4dbd5f0\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909738.2537727,\r\n" +// + " \"_id\": \"87aa1856-545f-43fb-bd08-1d8fc4dbd5f0\",\r\n" +// + " \"id\": \"87aa1856-545f-43fb-bd08-1d8fc4dbd5f0\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909738.348981\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909768.4961011,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:16:08.413956Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8fb31d19-265f-4f7c-b2c7-3890c0e53e61\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909768.4139502,\r\n" +// + " \"_id\": \"8fb31d19-265f-4f7c-b2c7-3890c0e53e61\",\r\n" +// + " \"id\": \"8fb31d19-265f-4f7c-b2c7-3890c0e53e61\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909768.4960983\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909768.6613002,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:16:08.573133Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/b16abf83-7f15-4249-9f44-2884a0abc244\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909768.5731268,\r\n" +// + " \"_id\": \"b16abf83-7f15-4249-9f44-2884a0abc244\",\r\n" +// + " \"id\": \"b16abf83-7f15-4249-9f44-2884a0abc244\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909768.6612976\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909869.189726,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:17:49.096628Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1cd9e694-4c2f-4cde-8a8c-67a9d7927cac\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909869.0966208,\r\n" +// + " \"_id\": \"1cd9e694-4c2f-4cde-8a8c-67a9d7927cac\",\r\n" +// + " \"id\": \"1cd9e694-4c2f-4cde-8a8c-67a9d7927cac\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909869.1897235\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909929.58234,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:18:49.488232Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/c92013c4-a65d-4d7f-b0a2-7d43281091ae\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909929.4882257,\r\n" +// + " \"_id\": \"c92013c4-a65d-4d7f-b0a2-7d43281091ae\",\r\n" +// + " \"id\": \"c92013c4-a65d-4d7f-b0a2-7d43281091ae\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909929.5823371\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910034.2460053,\r\n" +// + " \"modified\": 1613910034.3472185,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910034.2459593,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/189ac178-682b-4b85-8a2e-9a88a6c68638\"\r\n" +// + " },\r\n" +// + " \"_id\": \"189ac178-682b-4b85-8a2e-9a88a6c68638\",\r\n" +// + " \"id\": \"189ac178-682b-4b85-8a2e-9a88a6c68638\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910034.347216\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910094.2656207,\r\n" +// + " \"modified\": 1613910109.8943396,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910094.392173\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910094.265575,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d732ffcd-138e-4d45-a3a5-835ab5157c7b\"\r\n" +// + " },\r\n" +// + " \"_id\": \"d732ffcd-138e-4d45-a3a5-835ab5157c7b\",\r\n" +// + " \"id\": \"d732ffcd-138e-4d45-a3a5-835ab5157c7b\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910109.894338\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910154.8435988,\r\n" +// + " \"modified\": 1613910186.6822402,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910155.037702\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910154.8435192,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/5c46ada3-4da4-4fbc-a09b-aa61d048f52d\"\r\n" +// + " },\r\n" +// + " \"_id\": \"5c46ada3-4da4-4fbc-a09b-aa61d048f52d\",\r\n" +// + " \"id\": \"5c46ada3-4da4-4fbc-a09b-aa61d048f52d\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910186.6822376\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910214.6640532,\r\n" +// + " \"modified\": 1613910214.7608726,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910214.6640062,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/84215289-3b25-49bd-a49d-ec14dd7ba285\"\r\n" +// + " },\r\n" +// + " \"_id\": \"84215289-3b25-49bd-a49d-ec14dd7ba285\",\r\n" +// + " \"id\": \"84215289-3b25-49bd-a49d-ec14dd7ba285\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910214.7608697\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910274.9706578,\r\n" +// + " \"modified\": 1613910290.6332529,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910275.148673\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910274.970613,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/29bd71cf-1db3-4526-b94d-a725dc88d6e9\"\r\n" +// + " },\r\n" +// + " \"_id\": \"29bd71cf-1db3-4526-b94d-a725dc88d6e9\",\r\n" +// + " \"id\": \"29bd71cf-1db3-4526-b94d-a725dc88d6e9\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910290.6332498\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910364.581714,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910322.314141\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:24:52.077444Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/7d0260bb-9c28-4d0a-9c94-92689b29c48a\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910292.077437,\r\n" +// + " \"_id\": \"7d0260bb-9c28-4d0a-9c94-92689b29c48a\",\r\n" +// + " \"id\": \"7d0260bb-9c28-4d0a-9c94-92689b29c48a\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910364.5817118\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910334.381761,\r\n" +// + " \"modified\": 1613910350.0165374,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910334.526976\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910334.3817139,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/bfbdc4a0-a3cc-4fec-abc0-29cbdccc2e32\"\r\n" +// + " },\r\n" +// + " \"_id\": \"bfbdc4a0-a3cc-4fec-abc0-29cbdccc2e32\",\r\n" +// + " \"id\": \"bfbdc4a0-a3cc-4fec-abc0-29cbdccc2e32\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910350.0165346\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910429.7995875,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910382.571596\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:25:52.390508Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/50b54f54-f834-4685-9870-d8dce8f5416e\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910352.3905017,\r\n" +// + " \"_id\": \"50b54f54-f834-4685-9870-d8dce8f5416e\",\r\n" +// + " \"id\": \"50b54f54-f834-4685-9870-d8dce8f5416e\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910429.7995856\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910394.5855768,\r\n" +// + " \"modified\": 1613910431.4787664,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910394.721723\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910394.5855281,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/0bbb84f2-05e8-48f2-9504-e29113f140a8\"\r\n" +// + " },\r\n" +// + " \"_id\": \"0bbb84f2-05e8-48f2-9504-e29113f140a8\",\r\n" +// + " \"id\": \"0bbb84f2-05e8-48f2-9504-e29113f140a8\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910431.4787643\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910443.2732882,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:26:53.165084Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a9cb6f0f-46d2-4848-a224-a79bfbb73ce0\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910413.165078,\r\n" +// + " \"_id\": \"a9cb6f0f-46d2-4848-a224-a79bfbb73ce0\",\r\n" +// + " \"id\": \"a9cb6f0f-46d2-4848-a224-a79bfbb73ce0\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910443.2732852\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910454.705805,\r\n" +// + " \"modified\": 1613910465.215382,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910454.844086\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910454.7057567,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/234a616c-87f6-45e1-a193-3e953e1f80fb\"\r\n" +// + " },\r\n" +// + " \"_id\": \"234a616c-87f6-45e1-a193-3e953e1f80fb\",\r\n" +// + " \"id\": \"234a616c-87f6-45e1-a193-3e953e1f80fb\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910465.21538\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910473.6185863,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:27:53.523440Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a3756a3c-7c77-4f6f-b145-89e8d1be8a30\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910473.5234346,\r\n" +// + " \"_id\": \"a3756a3c-7c77-4f6f-b145-89e8d1be8a30\",\r\n" +// + " \"id\": \"a3756a3c-7c77-4f6f-b145-89e8d1be8a30\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910473.618584\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910515.3454695,\r\n" +// + " \"modified\": 1613910541.7016327,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910515.565245\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910515.3453994,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9ce258c7-8424-4ab9-bda7-bf21920a5fac\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9ce258c7-8424-4ab9-bda7-bf21920a5fac\",\r\n" +// + " \"id\": \"9ce258c7-8424-4ab9-bda7-bf21920a5fac\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910541.701631\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910570.9613228,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910534.252119\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:28:54.093851Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/bcc40603-7a36-46c0-bd1b-edc9c5bdd066\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910534.0938444,\r\n" +// + " \"_id\": \"bcc40603-7a36-46c0-bd1b-edc9c5bdd066\",\r\n" +// + " \"id\": \"bcc40603-7a36-46c0-bd1b-edc9c5bdd066\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910570.9613204\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910575.2397785,\r\n" +// + " \"modified\": 1613910590.870802,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910575.392916\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910575.2397187,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/73cfbe6b-c3a1-4b0e-aab3-3c80a365773b\"\r\n" +// + " },\r\n" +// + " \"_id\": \"73cfbe6b-c3a1-4b0e-aab3-3c80a365773b\",\r\n" +// + " \"id\": \"73cfbe6b-c3a1-4b0e-aab3-3c80a365773b\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910590.8707998\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910626.0078642,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910594.628977\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:29:54.468485Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/db048e5a-bd83-48c7-8218-a37b29466080\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910594.4684794,\r\n" +// + " \"_id\": \"db048e5a-bd83-48c7-8218-a37b29466080\",\r\n" +// + " \"id\": \"db048e5a-bd83-48c7-8218-a37b29466080\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910626.0078623\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910635.138362,\r\n" +// + " \"modified\": 1613910677.2629888,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910635.279426\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910635.138297,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8bb32fd9-68bd-48fb-8f64-1bc5816fb911\"\r\n" +// + " },\r\n" +// + " \"_id\": \"8bb32fd9-68bd-48fb-8f64-1bc5816fb911\",\r\n" +// + " \"id\": \"8bb32fd9-68bd-48fb-8f64-1bc5816fb911\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910677.2629857\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910694.940018,\r\n" +// + " \"modified\": 1613910710.5964007,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910695.072941\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910694.9399714,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1533bb7f-9260-4fc3-aab5-5dbcb64aca23\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1533bb7f-9260-4fc3-aab5-5dbcb64aca23\",\r\n" +// + " \"id\": \"1533bb7f-9260-4fc3-aab5-5dbcb64aca23\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910710.5963984\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910755.0686476,\r\n" +// + " \"modified\": 1613910797.2895927,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910755.216604\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910755.0685987,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1527f671-f917-4421-bd34-918b3ad09fea\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1527f671-f917-4421-bd34-918b3ad09fea\",\r\n" +// + " \"id\": \"1527f671-f917-4421-bd34-918b3ad09fea\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910797.2895906\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910815.0303142,\r\n" +// + " \"modified\": 1613910846.841692,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910815.214299\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910815.0302649,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a06b303b-f7f7-40ca-b5ff-fec58bb5fa75\"\r\n" +// + " },\r\n" +// + " \"_id\": \"a06b303b-f7f7-40ca-b5ff-fec58bb5fa75\",\r\n" +// + " \"id\": \"a06b303b-f7f7-40ca-b5ff-fec58bb5fa75\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910846.84169\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910874.8476086,\r\n" +// + " \"modified\": 1613910890.4736896,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910874.985552\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910874.847478,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9bbc24ff-feac-4006-af36-dcb4afabdf09\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9bbc24ff-feac-4006-af36-dcb4afabdf09\",\r\n" +// + " \"id\": \"9bbc24ff-feac-4006-af36-dcb4afabdf09\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910890.473688\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910935.1008294,\r\n" +// + " \"modified\": 1613910945.6500735,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910935.269509\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910935.100782,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/b899e50b-bd61-425b-8922-5e9ccdfd9178\"\r\n" +// + " },\r\n" +// + " \"_id\": \"b899e50b-bd61-425b-8922-5e9ccdfd9178\",\r\n" +// + " \"id\": \"b899e50b-bd61-425b-8922-5e9ccdfd9178\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910945.6500702\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910996.4660888,\r\n" +// + " \"modified\": 1613911033.2293398,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910996.656248\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910996.466044,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/f53b8dc3-fdf4-4c20-902a-7cc2c23b3b99\"\r\n" +// + " },\r\n" +// + " \"_id\": \"f53b8dc3-fdf4-4c20-902a-7cc2c23b3b99\",\r\n" +// + " \"id\": \"f53b8dc3-fdf4-4c20-902a-7cc2c23b3b99\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911033.229338\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911050.5486434,\r\n" +// + " \"modified\": 1613911066.225315,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911050.688298\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911050.548594,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/69e4b810-1fe9-438d-a31b-6cf9b31d45f7\"\r\n" +// + " },\r\n" +// + " \"_id\": \"69e4b810-1fe9-438d-a31b-6cf9b31d45f7\",\r\n" +// + " \"id\": \"69e4b810-1fe9-438d-a31b-6cf9b31d45f7\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911066.225313\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911110.5881708,\r\n" +// + " \"modified\": 1613911121.0799134,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911110.750472\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911110.5881114,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/28d548bb-daaf-4c13-93fc-094907981564\"\r\n" +// + " },\r\n" +// + " \"_id\": \"28d548bb-daaf-4c13-93fc-094907981564\",\r\n" +// + " \"id\": \"28d548bb-daaf-4c13-93fc-094907981564\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911121.0799115\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911171.1116796,\r\n" +// + " \"modified\": 1613911171.1979456,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911171.1116383,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/3eae096d-2f05-4fdd-ab3e-a347183591e2\"\r\n" +// + " },\r\n" +// + " \"_id\": \"3eae096d-2f05-4fdd-ab3e-a347183591e2\",\r\n" +// + " \"id\": \"3eae096d-2f05-4fdd-ab3e-a347183591e2\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911171.1979434\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911230.813983,\r\n" +// + " \"modified\": 1613911230.8896387,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911230.8139443,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9ac0c28e-76ae-47aa-9bca-d103bc5e84c6\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9ac0c28e-76ae-47aa-9bca-d103bc5e84c6\",\r\n" +// + " \"id\": \"9ac0c28e-76ae-47aa-9bca-d103bc5e84c6\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911230.8896365\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911383.1045403,\r\n" +// + " \"modified\": 1613911383.2016208,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911383.1044917,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1f0f5e6b-7718-4d3d-a280-652d9eb3d13f\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1f0f5e6b-7718-4d3d-a280-652d9eb3d13f\",\r\n" +// + " \"id\": \"1f0f5e6b-7718-4d3d-a280-652d9eb3d13f\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911383.2016182\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911439.4396203,\r\n" +// + " \"modified\": 1613911465.6242385,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911439.585795\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911439.4395723,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a81e4764-481f-4518-91d3-ae3ce8cb305d\"\r\n" +// + " },\r\n" +// + " \"_id\": \"a81e4764-481f-4518-91d3-ae3ce8cb305d\",\r\n" +// + " \"id\": \"a81e4764-481f-4518-91d3-ae3ce8cb305d\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911465.6242363\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911499.3622625,\r\n" +// + " \"modified\": 1613911514.9143875,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911499.498071\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911499.3622153,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/5890fedb-800b-4e67-93d6-db15ff706895\"\r\n" +// + " },\r\n" +// + " \"_id\": \"5890fedb-800b-4e67-93d6-db15ff706895\",\r\n" +// + " \"id\": \"5890fedb-800b-4e67-93d6-db15ff706895\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911514.9143853\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911559.2898803,\r\n" +// + " \"modified\": 1613911595.531617,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911559.436866\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911559.2898374,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8bfe4851-c453-4ffb-8806-1b39e86fde8e\"\r\n" +// + " },\r\n" +// + " \"_id\": \"8bfe4851-c453-4ffb-8806-1b39e86fde8e\",\r\n" +// + " \"id\": \"8bfe4851-c453-4ffb-8806-1b39e86fde8e\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911595.5316153\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911620.0033092,\r\n" +// + " \"modified\": 1613911635.637214,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911620.148513\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911620.0032625,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1c692144-803a-4815-b47a-b000ef7a914a\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1c692144-803a-4815-b47a-b000ef7a914a\",\r\n" +// + " \"id\": \"1c692144-803a-4815-b47a-b000ef7a914a\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911635.6372118\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911679.276305,\r\n" +// + " \"modified\": 1613911716.0668747,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911679.438384\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911679.2762609,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/facf2b4a-0a8c-4bff-acfd-9b054fcbf57f\"\r\n" +// + " },\r\n" +// + " \"_id\": \"facf2b4a-0a8c-4bff-acfd-9b054fcbf57f\",\r\n" +// + " \"id\": \"facf2b4a-0a8c-4bff-acfd-9b054fcbf57f\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911716.0668714\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911739.6183205,\r\n" +// + " \"modified\": 1613911750.1136234,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911739.747430\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911739.6182737,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/63ad2615-f034-4386-9c79-3590ae44bbdf\"\r\n" +// + " },\r\n" +// + " \"_id\": \"63ad2615-f034-4386-9c79-3590ae44bbdf\",\r\n" +// + " \"id\": \"63ad2615-f034-4386-9c79-3590ae44bbdf\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911750.1136212\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911799.2334297,\r\n" +// + " \"modified\": 1613911841.2871606,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911799.363900\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911799.2333803,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/98a025c6-f9c1-4f2f-881a-97091aead12d\"\r\n" +// + " },\r\n" +// + " \"_id\": \"98a025c6-f9c1-4f2f-881a-97091aead12d\",\r\n" +// + " \"id\": \"98a025c6-f9c1-4f2f-881a-97091aead12d\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911841.2871587\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911859.3068163,\r\n" +// + " \"modified\": 1613911874.888463,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911859.466150\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911859.3067691,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/00fa47c7-a987-4705-b500-c84e05eb3131\"\r\n" +// + " },\r\n" +// + " \"_id\": \"00fa47c7-a987-4705-b500-c84e05eb3131\",\r\n" +// + " \"id\": \"00fa47c7-a987-4705-b500-c84e05eb3131\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911874.8884618\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911919.2559352,\r\n" +// + " \"modified\": 1613911961.0181375,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911919.429585\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911919.255896,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9acdaa1c-d7f0-4173-ab0a-52499e3e26c6\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9acdaa1c-d7f0-4173-ab0a-52499e3e26c6\",\r\n" +// + " \"id\": \"9acdaa1c-d7f0-4173-ab0a-52499e3e26c6\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911961.0181353\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911979.2063522,\r\n" +// + " \"modified\": 1613912010.748398,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911979.363413\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911979.2062573,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/b2f86ede-4545-4263-9b87-a226750886e4\"\r\n" +// + " },\r\n" +// + " \"_id\": \"b2f86ede-4545-4263-9b87-a226750886e4\",\r\n" +// + " \"id\": \"b2f86ede-4545-4263-9b87-a226750886e4\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613912010.748396\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613912039.3231254,\r\n" +// + " \"modified\": 1613912076.0972588,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613912039.461176\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613912039.3230777,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/bb155452-4044-4750-a0ec-b1ff15ecf6ad\"\r\n" +// + " },\r\n" +// + " \"_id\": \"bb155452-4044-4750-a0ec-b1ff15ecf6ad\",\r\n" +// + " \"id\": \"bb155452-4044-4750-a0ec-b1ff15ecf6ad\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613912076.0972567\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613912098.5701716,\r\n" +// + " \"modified\": 1613912098.681397,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613912098.5701249,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a1cbf62f-1b32-4788-9da6-3a9fdafd3ef9\"\r\n" +// + " },\r\n" +// + " \"_id\": \"a1cbf62f-1b32-4788-9da6-3a9fdafd3ef9\",\r\n" +// + " \"id\": \"a1cbf62f-1b32-4788-9da6-3a9fdafd3ef9\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613912098.6813943\r\n" +// + " }\r\n" +// + "]"; +//// System.out.println("Round 1"); +//// String output = getNSLCMDetailsListByNSID(response_body, "b87a6b38-2f46-4b65-9791-f86f482ec267"); +//// System.out.println(output); +//// System.out.println("Round 2"); +//// output = getNSLCMDetailsListByNSID(output, "b87a6b38-2f46-4b65-9791-f86f482ec267"); +//// System.out.println(output); +//// System.out.println("Round 3"); +//// output = getNSLCMDetailsListByNSID(output, "b87a6b38-2f46-4b65-9791-f86f482ec267"); +//// System.out.println(output); +// System.out.println(compareNSLCMDetailsScaleOpsList(current, current)); +// System.out.println(compareNSLCMDetailsScaleOpsList(current, current).length()); +// } +// +// public static JSONArray compareNSLCMDetailsScaleOpsList(String previous, String current) +// { +// JSONArray result = new JSONArray(); +// try { +// JSONArray array = new JSONArray(previous); +// JSONArray array2 = new JSONArray(current); +// if(array.length()%s
", this.nsDescriptor.getName() ); + fmt.format("%s: %s
", "Vendor", nsDescriptor.getDesigner()); + fmt.format("%s: %s
", "Version", nsDescriptor.getVersion()); + fmt.format("%s: %s
", "Description", nsDescriptor.getName()); + if ( nsDescriptor.getDf() != null ) { + fmt.format("%s: %d
", "VNF Count", nsDescriptor.getDf().size()); + } + + fmt.format("%s: %d
", "VM Count", vmCount); + fmt.format("%s: %d
", "vCPU Count", vcpuCount); + fmt.format("%s: %d MB
", "Memory", memoryMB); + fmt.format("%s: %d GB
", "Storage", storageGB); + + fmt.format("

%s


", "ConstituentVnfds" ); + if ( nsDescriptor.getDf() != null ) { + @Nullable Map vl = nsDescriptor.getDf(); + for (Df df : vl.values()) { + fmt.format("%s: %s
", "VnfdId", df.getId()); + } + } + + + return stringBuilder.toString(); + } + + @Override + public String toString() { + return "NSRequirements{" + + "nsName=" + nsDescriptor.getName() + + ", memoryMB=" + memoryMB + + ", storageGB=" + storageGB + + ", vcpuCount=" + vcpuCount + + ", vmCount=" + vmCount + + '}'; + } +} diff --git a/src/main/java/OSM10Util/OSM10VNFReq/OSM10VNFRequirements.java b/src/main/java/OSM10Util/OSM10VNFReq/OSM10VNFRequirements.java new file mode 100644 index 0000000..e8ef42a --- /dev/null +++ b/src/main/java/OSM10Util/OSM10VNFReq/OSM10VNFRequirements.java @@ -0,0 +1,92 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * Copyright (C) 2019 openslice.io + * %% + * 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================================== + */ +package OSM10Util.OSM10VNFReq; + +import java.util.Formatter; +import java.util.Map; + +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; + +public class OSM10VNFRequirements { + public Vnfd descriptor; + + public boolean unknownFields = false; + public int memoryMB = 0; + public int storageGB = 0; + public int vcpuCount = 0; + public int vmCount = 0; + + public OSM10VNFRequirements() + {} + + public OSM10VNFRequirements(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd vnfHackfestMultiVduDescriptor) { + this.descriptor = vnfHackfestMultiVduDescriptor; + + this.memoryMB = 0; + this.storageGB = 0; + this.vcpuCount = 0; + this.vmCount = 0; + Map virtualComputeDescMap = vnfHackfestMultiVduDescriptor.getVirtualComputeDesc(); + if ( virtualComputeDescMap != null) { + for(VirtualComputeDesc tmp : virtualComputeDescMap.values()) + { + this.memoryMB = tmp.getVirtualMemory().getSize().intValue(); + this.vcpuCount = tmp.getVirtualCpu().getNumVirtualCpu().intValue(); + this.vmCount++; + } + Map virtualStorageDescMap = vnfHackfestMultiVduDescriptor.getVirtualStorageDesc(); + for(VirtualStorageDesc tmp : virtualStorageDescMap.values()) + { + this.storageGB = tmp.getSizeOfStorage().intValue(); + } + } + + } + + public String toHTML() { + StringBuilder stringBuilder = new StringBuilder(); + Formatter fmt = new Formatter(stringBuilder); + fmt.format("

%s


", descriptor.getProductName()); + fmt.format("%s: %s
", "Vendor", descriptor.getProvider() ); + fmt.format("%s: %s
", "Version", descriptor.getVersion() ); + fmt.format("%s: %s
", "Description", descriptor.getProductInfoDescription()); + fmt.format("%s: %d
", "VM Count", vmCount); + fmt.format("%s: %d
", "vCPU Count", vcpuCount); + fmt.format("%s: %d MB
", "Memory", memoryMB); + fmt.format("%s: %d GB
", "Storage", storageGB); + + return stringBuilder.toString(); + } + + @Override + public String toString() { + return "VNFRequirements{" + + "vnfName=" + descriptor.getProductName() + + ", memoryMB=" + memoryMB + + ", storageGB=" + storageGB + + ", vcpuCount=" + vcpuCount + + ", vmCount=" + vmCount + + '}'; + } +} diff --git a/src/main/java/OSM10Util/examples/Example.java b/src/main/java/OSM10Util/examples/Example.java new file mode 100644 index 0000000..4f12a14 --- /dev/null +++ b/src/main/java/OSM10Util/examples/Example.java @@ -0,0 +1,83 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * Copyright (C) 2019 openslice.io + * %% + * 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================================== + */ +package OSM10Util.examples; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Map; + +import org.apache.commons.io.FileUtils; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; + +import OSM10Util.OSM10ArchiveExtractor.OSM10NSExtractor; +import OSM10Util.OSM10ArchiveExtractor.OSM10VNFDExtractor; +import OSM10Util.OSM10NSReq.OSM10NSRequirements; +import OSM10Util.OSM10VNFReq.OSM10VNFRequirements; + + + +public class Example { + //private static URL cirrosVnfUrl; + //private static URL hackfest1VnfUrl; + //private static URL hackfest2VnfUrl; + //private static URL pingPongNsUrl; + private static URL hackfestMultiVduUrl; + private static URL hackfestMultiVduNSUrl; + + public static void main(String[] args) throws IOException { + hackfestMultiVduUrl = new URL("http://localhost/osm/hackfest_multivdu_vnf.tar.gz"); + hackfestMultiVduNSUrl = new URL("http://localhost/osm/hackfest_multivdu_ns.tar.gz"); + + File hackfestMultiVduFile = File.createTempFile("hackfest_multivdu_vnf", ".tar.gz"); + File hackfestMultiVduNSFile = File.createTempFile("hackfest_multivdu_ns", ".tar.gz"); + //File pingPongNsFile = File.createTempFile("ping_pong_ns", ".tar.gz"); + + hackfestMultiVduFile.deleteOnExit(); + hackfestMultiVduNSFile.deleteOnExit(); + + System.out.println("Downloading VNF"); + + FileUtils.copyURLToFile(hackfestMultiVduUrl, hackfestMultiVduFile); + FileUtils.copyURLToFile(hackfestMultiVduNSUrl, hackfestMultiVduNSFile); + + System.out.println("Calculating requirements..."); + + OSM10VNFDExtractor vnfHackfestMultiVduExtract = new OSM10VNFDExtractor(hackfestMultiVduFile.getPath()); + Vnfd vnfHackfestMultiVduDescriptor = vnfHackfestMultiVduExtract.extractVnfdDescriptor(); + System.out.println(vnfHackfestMultiVduDescriptor.toString()); + OSM10VNFRequirements vnfHackfestMultiVduRequirements = new OSM10VNFRequirements(vnfHackfestMultiVduDescriptor); + System.out.println(vnfHackfestMultiVduRequirements.toHTML()); + OSM10NSExtractor nsExtractor = new OSM10NSExtractor(hackfestMultiVduNSFile); + Nsd hackfestMultiVduNSDescriptor = nsExtractor.extractNsDescriptor(); + OSM10NSRequirements hackfestMultiVduNSRequirements = new OSM10NSRequirements(hackfestMultiVduNSDescriptor); + + for (Df v : hackfestMultiVduNSDescriptor.getDf().values()) { + for( VnfProfile q : v.getVnfProfile().values()) + { + System.out.println("setMemberVNFIndex: "+Integer.parseInt(q.getId())); + System.out.println("setVNFDIdRef: "+(String) q.getVnfdId()); + } + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModelBindingProvider.java new file mode 100644 index 0000000..710b8fa --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModuleInfoImpl.java new file mode 100644 index 0000000..debda92 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModuleInfoImpl.java @@ -0,0 +1,173 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-descriptors").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(EtsiNfvNsInfo.getInstance()); + set.add(EtsiNfvCommonInfo.getInstance()); + set.add(EtsiNfvVnfInfo.getInstance()); + set.add(EtsiNfvPnfInfo.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-descriptors@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + + private static final class EtsiNfvNsInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-ns").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvNsInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvNsInfo() { + importedModules = ImmutableSet.of(); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-ns@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } + + private static final class EtsiNfvCommonInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-common").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvCommonInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvCommonInfo() { + importedModules = ImmutableSet.of(); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-common@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } + + private static final class EtsiNfvVnfInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-03-18", "etsi-nfv-vnf").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvVnfInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvVnfInfo() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-vnf@2019-03-18.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } + + private static final class EtsiNfvPnfInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-pnf").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvPnfInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvPnfInfo() { + importedModules = ImmutableSet.of(); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-pnf@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AddressType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AddressType.java new file mode 100644 index 0000000..e3311f1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AddressType.java @@ -0,0 +1,32 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the type of the address to be assigned to the CP instantiated from + * parent CPD. Value: • MAC address. • IP address. • … The content type shall be + * aligned with the address type supported by the layerProtocol attribute of the + * parent CPD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity address-type {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/address-type + * + */ +public interface AddressType + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("address-type"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityScope.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityScope.java new file mode 100644 index 0000000..7ede879 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityScope.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum AffinityScope implements Enumeration { + NfviNode(0, "nfvi-node"), + + ZoneGroup(1, "zone-group"), + + Zone(2, "zone"), + + NfviPop(3, "nfvi-pop") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (AffinityScope enumItem : AffinityScope.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private AffinityScope(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding AffinityScope item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding AffinityScope item, or null if no such item exists + */ + public static AffinityScope forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityType.java new file mode 100644 index 0000000..b32148b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityType.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum AffinityType implements Enumeration { + Affinity(0, "affinity"), + + AntiAffinity(1, "anti-affinity") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (AffinityType enumItem : AffinityType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private AffinityType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding AffinityType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding AffinityType item, or null if no such item exists + */ + public static AffinityType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChangeVnfFlavour.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChangeVnfFlavour.java new file mode 100644 index 0000000..8db3309 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChangeVnfFlavour.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation changes the DF of a VNF instance. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity change-vnf-flavour {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/change-vnf-flavour + * + */ +public interface ChangeVnfFlavour + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("change-vnf-flavour"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChecksumAlgorithm.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChecksumAlgorithm.java new file mode 100644 index 0000000..e97ae86 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChecksumAlgorithm.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies the algorithms supported for the purpose of calculating the checksum. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity checksum-algorithm {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/checksum-algorithm + * + */ +public interface ChecksumAlgorithm + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("checksum-algorithm"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ConnectivityType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ConnectivityType.java new file mode 100644 index 0000000..ee2e87a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ConnectivityType.java @@ -0,0 +1,48 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping connectivity-type {
+ *   container connectivity-type {
+ *     leaf-list layer-protocol {
+ *       type identityref {
+ *         base layer-protocol;
+ *       }
+ *     }
+ *     leaf flow-pattern {
+ *       type flow-pattern;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/connectivity-type + * + */ +public interface ConnectivityType + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("connectivity-type"); + + @Override + Class implementedInterface(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.ConnectivityType connectivityType, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.@Nullable ConnectivityType getConnectivityType(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/CpRole.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/CpRole.java new file mode 100644 index 0000000..2b5c8b0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/CpRole.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies the role of the port in the context of the traffic flow patterns in + * the VNF or parent NS. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity cp-role {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cp-role + * + */ +public interface CpRole + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cp-role"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Cpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Cpd.java new file mode 100644 index 0000000..adfbda8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Cpd.java @@ -0,0 +1,175 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.ProtocolKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * A Cpd information element describes network connectivity to a compute resource + * or a VL. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping cpd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf-list layer-protocol {
+ *     default ethernet;
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   leaf role {
+ *     type identityref {
+ *       base cp-role;
+ *     }
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list protocol {
+ *     key associated-layer-protocol;
+ *     leaf associated-layer-protocol {
+ *       type identityref {
+ *         base layer-protocol;
+ *       }
+ *     }
+ *     list address-data {
+ *       key type;
+ *       leaf type {
+ *         type identityref {
+ *           base address-type;
+ *         }
+ *       }
+ *       container l2-address-data {
+ *         when "../type='mac-address'";
+ *         leaf mac-address-assignment {
+ *           type boolean;
+ *         }
+ *       }
+ *       container l3-address-data {
+ *         when "../type='ip-address'";
+ *         leaf ip-address-assignment {
+ *           type boolean;
+ *         }
+ *         leaf floating-ip-activated {
+ *           type boolean;
+ *         }
+ *         leaf ip-address-type {
+ *           type enumeration {
+ *             enum ipv4;
+ *             enum ipv6;
+ *           }
+ *         }
+ *         leaf number-of-ip-addresses {
+ *           type uint32;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   leaf trunk-mode {
+ *     type boolean;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd + * + */ +public interface Cpd + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cpd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this Cpd information element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Identifies a protocol that the connection points corresponding to the CPD + * support for connectivity purposes (e.g. Ethernet, MPLS, ODU2, IPV4, IPV6, + * Pseudo-Wire, etc.). + * + * + * + * @return java.util.List layerProtocol, or null if not present + */ + @Nullable List> getLayerProtocol(); + + /** + * Identifies the role of the connection points corresponding to the CPD in the + * context of the traffic flow patterns in the VNF, PNF or NS. For example an NS + * with a tree flow pattern within the NS will have legal cpRoles of ROOT and LEAF. + * + * + * + * @return java.lang.Class role, or null if not present + */ + @Nullable Class getRole(); + + /** + * Provides human-readable information on the purpose of the connection point (e.g. + * connection point for control plane traffic). + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Identifies the protocol layering information the CP uses for connectivity + * purposes and associated information. There shall be one cpProtocol for each + * layer protocol as indicated by the attribute layerProtocol. When a PnfExtCpd as + * defined in ETSI GS NFV-IFA 014 [i.8] is inherited from this Cpd, the cardinality + * is set to 0. + * + * + * + * @return java.util.Map protocol, or null if not present + */ + @Nullable Map getProtocol(); + + /** + * @return java.util.Map protocol, or an empty list if it is not present + */ + default @NonNull Map nonnullProtocol() { + return CodeHelpers.nonnull(getProtocol()); + } + + /** + * Information about whether the Cp instantiated from this CPD is in Trunk mode + * (802.1Q or other). When operating in 'trunk mode', the Cp is capable of carrying + * traffic for several VLANs. A cardinality of 0 implies that trunkMode is not + * configured for the Cp i.e. It is equivalent to Boolean value 'false'. + * + * + * + * @return java.lang.Boolean trunkMode, or null if not present + */ + @Nullable Boolean isTrunkMode(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EphemeralStorage.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EphemeralStorage.java new file mode 100644 index 0000000..da1a7ea --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EphemeralStorage.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Ephemeral type of storage. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ephemeral-storage {
+ *   base storage-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ephemeral-storage + * + */ +public interface EphemeralStorage + extends + StorageType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ephemeral-storage"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ethernet.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ethernet.java new file mode 100644 index 0000000..d8752a1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ethernet.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ethernet {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ethernet + * + */ +public interface Ethernet + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ethernet"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EtsiNfvDescriptorsData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EtsiNfvDescriptorsData.java new file mode 100644 index 0000000..de70e27 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EtsiNfvDescriptorsData.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataRoot; + +/** + * Network Function Virtualization Descriptors + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * module etsi-nfv-descriptors {
+ *   yang-version 1.1;
+ *   namespace urn:etsi:nfv:yang:etsi-nfv-descriptors;
+ *   prefix nfv;
+ *   include etsi-nfv-common;
+ *   include etsi-nfv-ns;
+ *   include etsi-nfv-vnf;
+ *   include etsi-nfv-pnf;
+ *   revision 2019-04-25 {
+ *   }
+ *   container nfv {
+ *     list vnfd {
+ *       key id;
+ *       uses vnfd;
+ *     }
+ *     list nsd {
+ *       key id;
+ *       uses nsd;
+ *     }
+ *     list pnfd {
+ *       key id;
+ *       uses pnfd;
+ *     }
+ *   }
+ * }
+ * 
+ * + */ +public interface EtsiNfvDescriptorsData + extends + DataRoot +{ + + + + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv nfv, or null if not present + */ + @Nullable Nfv getNfv(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/FlowPattern.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/FlowPattern.java new file mode 100644 index 0000000..ce42843 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/FlowPattern.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum FlowPattern implements Enumeration { + Line(0, "line"), + + Tree(1, "tree"), + + Mesh(2, "mesh") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (FlowPattern enumItem : FlowPattern.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private FlowPattern(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding FlowPattern item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding FlowPattern item, or null if no such item exists + */ + public static FlowPattern forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/HealVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/HealVnf.java new file mode 100644 index 0000000..441fa9e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/HealVnf.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation enables the NFVO to request a VNFM to perform a VNF healing + * procedure. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity heal-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/heal-vnf + * + */ +public interface HealVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("heal-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InstantiateVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InstantiateVnf.java new file mode 100644 index 0000000..c0a8ef1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InstantiateVnf.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation instantiates a particular DF of a VNF based on the definition in + * the VNFD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity instantiate-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/instantiate-vnf + * + */ +public interface InstantiateVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("instantiate-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InternalLifecycleManagementScriptEvent.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InternalLifecycleManagementScriptEvent.java new file mode 100644 index 0000000..1f5290e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InternalLifecycleManagementScriptEvent.java @@ -0,0 +1,99 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum InternalLifecycleManagementScriptEvent implements Enumeration { + StartInstantiation(0, "start-instantiation"), + + EndInstantiation(1, "end-instantiation"), + + StartScaling(2, "start-scaling"), + + EndScaling(3, "end-scaling"), + + StartHealing(4, "start-healing"), + + EndHealing(5, "end-healing"), + + StartTermination(6, "start-termination"), + + EndTermination(7, "end-termination"), + + StartVnfFlavourChange(8, "start-vnf-flavour-change"), + + EndVnfFlavourChange(9, "end-vnf-flavour-change"), + + StartVnfOperationChange(10, "start-vnf-operation-change"), + + EndVnfOperationChange(11, "end-vnf-operation-change"), + + StartVnfExtConnChange(12, "start-vnf-ext-conn-change"), + + EndVnfExtConnChange(13, "end-vnf-ext-conn-change"), + + StartVnfinfoModification(14, "start-vnfinfo-modification"), + + EndVnfinfoModification(15, "end-vnfinfo-modification") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (InternalLifecycleManagementScriptEvent enumItem : InternalLifecycleManagementScriptEvent.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private InternalLifecycleManagementScriptEvent(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding InternalLifecycleManagementScriptEvent item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding InternalLifecycleManagementScriptEvent item, or null if no such item exists + */ + public static InternalLifecycleManagementScriptEvent forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/IpAddress.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/IpAddress.java new file mode 100644 index 0000000..8ccb486 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/IpAddress.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ip-address {
+ *   base address-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ip-address + * + */ +public interface IpAddress + extends + AddressType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ip-address"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv4.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv4.java new file mode 100644 index 0000000..d43c9d2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv4.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ipv4 {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ipv4 + * + */ +public interface Ipv4 + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ipv4"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv6.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv6.java new file mode 100644 index 0000000..c6b337a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv6.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ipv6 {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ipv6 + * + */ +public interface Ipv6 + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ipv6"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LayerProtocol.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LayerProtocol.java new file mode 100644 index 0000000..321aaf3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LayerProtocol.java @@ -0,0 +1,27 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity layer-protocol;
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/layer-protocol + * + */ +public interface LayerProtocol + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("layer-protocol"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Leaf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Leaf.java new file mode 100644 index 0000000..0a757cf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Leaf.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity leaf {
+ *   base cp-role;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/leaf + * + */ +public interface Leaf + extends + CpRole +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("leaf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LinkBitrateRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LinkBitrateRequirements.java new file mode 100644 index 0000000..8ddd79a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LinkBitrateRequirements.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping link-bitrate-requirements {
+ *   leaf root {
+ *     type uint64;
+ *     units Mbps;
+ *   }
+ *   leaf leaf {
+ *     type uint64;
+ *     units Mbps;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/link-bitrate-requirements + * + */ +public interface LinkBitrateRequirements + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("link-bitrate-requirements"); + + @Override + Class implementedInterface(); + + /** + * Specifies the throughput requirement of the link (e.g. bitrate of E-Line, root + * bitrate of E-Tree, aggregate capacity of E-LAN). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 root, or null if not present + */ + @Nullable Uint64 getRoot(); + + /** + * Specifies the throughput requirement of leaf connections to the link when + * applicable to the connectivity type (e.g. for E-Tree and E-LAN branches). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 leaf, or null if not present + */ + @Nullable Uint64 getLeaf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LocalAffinityOrAntiAffinityRule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LocalAffinityOrAntiAffinityRule.java new file mode 100644 index 0000000..9008dee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LocalAffinityOrAntiAffinityRule.java @@ -0,0 +1,57 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRuleKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping local-affinity-or-anti-affinity-rule {
+ *   list local-affinity-or-anti-affinity-rule {
+ *     key "affinity-type affinity-scope";
+ *     leaf affinity-type {
+ *       type affinity-type;
+ *     }
+ *     leaf affinity-scope {
+ *       type affinity-scope;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/local-affinity-or-anti-affinity-rule + * + */ +public interface LocalAffinityOrAntiAffinityRule + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("local-affinity-or-anti-affinity-rule"); + + @Override + Class implementedInterface(); + + /** + * @return java.util.Map localAffinityOrAntiAffinityRule, or null if not present + */ + @Nullable Map getLocalAffinityOrAntiAffinityRule(); + + /** + * @return java.util.Map localAffinityOrAntiAffinityRule, or an empty list if it is not present + */ + default @NonNull Map nonnullLocalAffinityOrAntiAffinityRule() { + return CodeHelpers.nonnull(getLocalAffinityOrAntiAffinityRule()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MacAddress.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MacAddress.java new file mode 100644 index 0000000..6693410 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MacAddress.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity mac-address {
+ *   base address-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/mac-address + * + */ +public interface MacAddress + extends + AddressType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("mac-address"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ModifyVnfInformation.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ModifyVnfInformation.java new file mode 100644 index 0000000..ba547a5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ModifyVnfInformation.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation allows updating information about a VNF instance. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity modify-vnf-information {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/modify-vnf-information + * + */ +public interface ModifyVnfInformation + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("modify-vnf-information"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MonitoringParameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MonitoringParameter.java new file mode 100644 index 0000000..a5b39a1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MonitoringParameter.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping monitoring-parameter {
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf performance-metric {
+ *     type string;
+ *   }
+ *   leaf collection-period {
+ *     type uint64;
+ *     units ms;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/monitoring-parameter + * + */ +public interface MonitoringParameter + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitoring-parameter"); + + @Override + Class implementedInterface(); + + /** + * Human readable name of the monitoring parameter. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Performance metric that is monitored. This attribute shall contain the related + * 'Measurement Name' value as defined in clause 7.2 of ETSI GS NFV-IFA 027 + * + * + * + * @return java.lang.String performanceMetric, or null if not present + */ + @Nullable String getPerformanceMetric(); + + /** + * An attribute that describes the recommended periodicity at which to collect the + * performance information. VNFM determines if this parameter is considered. The + * vendor may provide this information as a guidance for creating PmJobs if needed. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 collectionPeriod, or null if not present + */ + @Nullable Uint64 getCollectionPeriod(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Mpls.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Mpls.java new file mode 100644 index 0000000..bfdeb63 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Mpls.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity mpls {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/mpls + * + */ +public interface Mpls + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("mpls"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nfv.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nfv.java new file mode 100644 index 0000000..5b0214d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nfv.java @@ -0,0 +1,112 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Pnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.PnfdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container nfv {
+ *   list vnfd {
+ *     key id;
+ *     uses vnfd;
+ *   }
+ *   list nsd {
+ *     key id;
+ *     uses nsd;
+ *   }
+ *   list pnfd {
+ *     key id;
+ *     uses pnfd;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv + * + *

To create instances of this class use {@link NfvBuilder}. + * @see NfvBuilder + * + */ +public interface Nfv + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nfv"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv.class; + } + + /** + * A VNF Descriptor (VNFD) is a deployment template which describes a VNF in terms + * of deployment and operational behaviour requirements. It also contains + * connectivity, interface and virtualised resource requirements + * + * + * + * @return java.util.Map vnfd, or null if not present + */ + @Nullable Map getVnfd(); + + /** + * @return java.util.Map vnfd, or an empty list if it is not present + */ + default @NonNull Map nonnullVnfd() { + return CodeHelpers.nonnull(getVnfd()); + } + + /** + * The NSD information element is a deployment template whose instances are used by + * the NFVO for the lifecycle management of NSs. + * + * + * + * @return java.util.Map nsd, or null if not present + */ + @Nullable Map getNsd(); + + /** + * @return java.util.Map nsd, or an empty list if it is not present + */ + default @NonNull Map nonnullNsd() { + return CodeHelpers.nonnull(getNsd()); + } + + /** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only. + * + * + * + * @return java.util.Map pnfd, or null if not present + */ + @Nullable Map getPnfd(); + + /** + * @return java.util.Map pnfd, or an empty list if it is not present + */ + default @NonNull Map nonnullPnfd() { + return CodeHelpers.nonnull(getPnfd()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/NfvBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/NfvBuilder.java new file mode 100644 index 0000000..81f9e2d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/NfvBuilder.java @@ -0,0 +1,331 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Pnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.PnfdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NfvBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NfvBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NfvBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NfvBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NfvBuilder + * @see Builder + * + */ +public class NfvBuilder implements Builder { + + private Map _nsd; + private Map _pnfd; + private Map _vnfd; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NfvBuilder() { + } + + public NfvBuilder(Nfv base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._nsd = base.getNsd(); + this._pnfd = base.getPnfd(); + this._vnfd = base.getVnfd(); + } + + + public Map getNsd() { + return _nsd; + } + + public Map getPnfd() { + return _pnfd; + } + + public Map getVnfd() { + return _vnfd; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NfvBuilder setNsd(final Map values) { + this._nsd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder setNsd(final List values) { + return setNsd(CodeHelpers.compatMap(values)); + } + public NfvBuilder setPnfd(final Map values) { + this._pnfd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setPnfd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder setPnfd(final List values) { + return setPnfd(CodeHelpers.compatMap(values)); + } + public NfvBuilder setVnfd(final Map values) { + this._vnfd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnfd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder setVnfd(final List values) { + return setVnfd(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NfvBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NfvBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NfvBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nfv build() { + return new NfvImpl(this); + } + + private static final class NfvImpl + extends AbstractAugmentable + implements Nfv { + + private final Map _nsd; + private final Map _pnfd; + private final Map _vnfd; + + NfvImpl(NfvBuilder base) { + super(base.augmentation); + this._nsd = CodeHelpers.emptyToNull(base.getNsd()); + this._pnfd = CodeHelpers.emptyToNull(base.getPnfd()); + this._vnfd = CodeHelpers.emptyToNull(base.getVnfd()); + } + + @Override + public Map getNsd() { + return _nsd; + } + + @Override + public Map getPnfd() { + return _pnfd; + } + + @Override + public Map getVnfd() { + return _vnfd; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_nsd); + result = prime * result + Objects.hashCode(_pnfd); + result = prime * result + Objects.hashCode(_vnfd); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nfv.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nfv other = (Nfv)obj; + if (!Objects.equals(_nsd, other.getNsd())) { + return false; + } + if (!Objects.equals(_pnfd, other.getPnfd())) { + return false; + } + if (!Objects.equals(_vnfd, other.getVnfd())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NfvImpl otherImpl = (NfvImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nfv"); + CodeHelpers.appendValue(helper, "_nsd", _nsd); + CodeHelpers.appendValue(helper, "_pnfd", _pnfd); + CodeHelpers.appendValue(helper, "_vnfd", _vnfd); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nsd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nsd.java new file mode 100644 index 0000000..1e80837 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nsd.java @@ -0,0 +1,867 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdBuilder.NsdImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder.VnfdImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.SapdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VnffgdKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping nsd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf designer {
+ *     type string;
+ *   }
+ *   leaf version {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf invariant-id {
+ *     type string;
+ *   }
+ *   leaf-list nested-nsd-id {
+ *     must ". != ../id";
+ *     type leafref {
+ *       path ../../nsd/id;
+ *     }
+ *   }
+ *   leaf-list vnfd-id {
+ *     type leafref {
+ *       path ../../vnfd/id;
+ *     }
+ *   }
+ *   leaf-list pnfd-id {
+ *     type leafref {
+ *       path ../../pnfd/id;
+ *     }
+ *   }
+ *   list sapd {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf address-assignment {
+ *       type boolean;
+ *     }
+ *     choice cpd-or-virtual-link {
+ *       case virtual-link-desc {
+ *         leaf virtual-link-desc {
+ *           type leafref {
+ *             path ../../virtual-link-desc/id;
+ *           }
+ *         }
+ *       }
+ *       case vnf {
+ *         container vnf {
+ *           leaf vnfd-id {
+ *             type leafref {
+ *               path ../../../../vnfd/id;
+ *             }
+ *             must boolean(../../../vnfd-id[.=current()]);
+ *           }
+ *           leaf ext-cpd-id {
+ *             type leafref {
+ *               path deref(../vnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case pnf {
+ *         container pnf {
+ *           leaf pnfd-id {
+ *             type leafref {
+ *               path ../../../../pnfd/id;
+ *             }
+ *             must boolean(../pnfd-id[.=current()]);
+ *           }
+ *           leaf ext-cpd-id {
+ *             type leafref {
+ *               path deref(../pnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case ns {
+ *         container ns {
+ *           leaf nsd-id {
+ *             type leafref {
+ *               path ../../../../nsd/id;
+ *             }
+ *             must boolean(../nsd-id[.=current()]);
+ *           }
+ *           leaf ext-cpd-id {
+ *             type leafref {
+ *               path deref(../nsd-id)/../sapd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     uses connectivity-type;
+ *     list df {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       container qos {
+ *         presence "VL QoS parameters";
+ *         leaf latency {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-delay-variation {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-loss-ratio {
+ *           type decimal64 {
+ *             fraction-digits 2;
+ *             range 0..1.00;
+ *           }
+ *         }
+ *         leaf priority {
+ *           type uint32;
+ *         }
+ *       }
+ *       leaf service-availability-level {
+ *         type enumeration {
+ *           enum level-1;
+ *           enum level-2;
+ *           enum level-3;
+ *         }
+ *       }
+ *     }
+ *     leaf test-access {
+ *       type enumeration {
+ *         enum none;
+ *         enum passive-monitoring;
+ *         enum active;
+ *       }
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     uses security-parameters;
+ *   }
+ *   list vnffgd {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf-list vnf-profile-id {
+ *       type leafref {
+ *         path ../../df/vnf-profile/id;
+ *       }
+ *     }
+ *     leaf-list pnf-profile-id {
+ *       type leafref {
+ *         path ../../df/pnf-profile/id;
+ *       }
+ *     }
+ *     leaf-list nested-ns-profile-id {
+ *       type leafref {
+ *         path ../../df/ns-profile/id;
+ *       }
+ *     }
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../df/virtual-link-profile/id;
+ *       }
+ *     }
+ *     list cpd-pool {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       choice constituent-base-element-id {
+ *         case vnf-profile {
+ *           container vnf-profile {
+ *             leaf vnf-profile-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/df/vnf-profile/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case pnf-profile {
+ *           container pnf-profile {
+ *             leaf pnf-profile-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/df/pnf-profile/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case ns-profile {
+ *           container ns-profile {
+ *             leaf ns-profile-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/df/ns-profile/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *       }
+ *       choice constituent-cpd-id {
+ *         case vnf {
+ *           container vnf {
+ *             leaf vnfd-id {
+ *               type leafref {
+ *                 path ../../../../../vnfd/id;
+ *               }
+ *             }
+ *             leaf cpd-id {
+ *               type leafref {
+ *                 path deref(../vnfd-id)/../ext-cpd/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case pnf {
+ *           container pnf {
+ *             leaf pnfd-id {
+ *               type leafref {
+ *                 path ../../../../../pnfd/id;
+ *               }
+ *             }
+ *             leaf pnf-cpd-id {
+ *               type leafref {
+ *                 path deref(../pnfd-id)/../ext-cpd/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case ns {
+ *           container ns {
+ *             leaf nsd-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/id;
+ *               }
+ *             }
+ *             leaf sap-cpd-id {
+ *               type leafref {
+ *                 path deref(../nsd-id)/../sapd/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list nfpd {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf rule {
+ *         type string;
+ *       }
+ *       list position-desc-id {
+ *         key id;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         list cp-profile-id {
+ *           key id;
+ *           leaf id {
+ *             type string;
+ *           }
+ *           list constituent-profile-elements {
+ *             key id;
+ *             leaf id {
+ *               type string;
+ *             }
+ *             leaf cpd-id {
+ *               type string;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   leaf-list autoscale-rule {
+ *     type string;
+ *   }
+ *   list lifecycle-management-script {
+ *     key event;
+ *     leaf event {
+ *       type string;
+ *     }
+ *     leaf script {
+ *       type string;
+ *     }
+ *   }
+ *   list df {
+ *     min-elements 1;
+ *     must "default-instantiation-level or count(ns-instantiation-level) = 1" {
+ *       error-message
+ *         "default-instantiation-level must be present if there multiple instantion-level";
+ *     }
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf flavour-key {
+ *       type leafref {
+ *         path ../monitored-info/id;
+ *       }
+ *     }
+ *     list vnf-profile {
+ *       must "min-number-of-instances <= max-number-of-instances";
+ *       must boolean(../../vnfd-id[.=current()/vnfd-id]) {
+ *         error-message
+ *           "VNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *       }
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf vnfd-id {
+ *         type leafref {
+ *           path ../../../../vnfd/id;
+ *         }
+ *       }
+ *       leaf flavour-id {
+ *         type leafref {
+ *           path deref(../vnfd-id)/../df/id;
+ *         }
+ *       }
+ *       leaf instantiation-level {
+ *         type leafref {
+ *           path deref(../flavour-id)/../instantiation-level/id;
+ *         }
+ *       }
+ *       leaf min-number-of-instances {
+ *         default 1;
+ *         type uint16;
+ *       }
+ *       leaf max-number-of-instances {
+ *         default 1;
+ *         type uint16;
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       list virtual-link-connectivity {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         list constituent-cpd-id {
+ *           key constituent-base-element-id;
+ *           leaf constituent-base-element-id {
+ *             type leafref {
+ *               path ../../../id;
+ *             }
+ *           }
+ *           leaf constituent-cpd-id {
+ *             type leafref {
+ *               path deref(../../../vnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list pnf-profile {
+ *       key id;
+ *       must boolean(../../pnfd-id[.=current()/pnfd-id]) {
+ *         error-message
+ *           "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *       }
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf pnfd-id {
+ *         type leafref {
+ *           path ../../../../pnfd/id;
+ *         }
+ *       }
+ *       list virtual-link-connectivity {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         list constituent-cpd-id {
+ *           key constituent-base-element-id;
+ *           leaf constituent-base-element-id {
+ *             type leafref {
+ *               path ../../../id;
+ *             }
+ *           }
+ *           leaf constituent-cpd-id {
+ *             type leafref {
+ *               path deref(../../../pnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-profile {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf virtual-link-desc-id {
+ *         type leafref {
+ *           path ../../../virtual-link-desc/id;
+ *         }
+ *       }
+ *       leaf flavour-id {
+ *         type leafref {
+ *           path deref(../virtual-link-desc-id)/../df/id;
+ *         }
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       container max-bitrate-requirements {
+ *         uses link-bitrate-requirements;
+ *       }
+ *       container min-bitrate-requirements {
+ *         uses link-bitrate-requirements;
+ *       }
+ *     }
+ *     list scaling-aspect {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       leaf scaling-level {
+ *         type leafref {
+ *           path ../../ns-instantiation-level/id;
+ *         }
+ *       }
+ *     }
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf type {
+ *         type affinity-type;
+ *       }
+ *       leaf scope {
+ *         type affinity-scope;
+ *       }
+ *     }
+ *     list ns-instantiation-level {
+ *       min-elements 1;
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       list vnf-to-level-mapping {
+ *         key vnf-profile-id;
+ *         leaf vnf-profile-id {
+ *           type leafref {
+ *             path ../../../vnf-profile/id;
+ *           }
+ *         }
+ *         leaf number-of-instances {
+ *           default 1;
+ *           type uint32;
+ *         }
+ *       }
+ *       list virtual-link-to-level-mapping {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         uses link-bitrate-requirements;
+ *       }
+ *       list ns-to-level-mapping {
+ *         key ns-profile-id;
+ *         leaf ns-profile-id {
+ *           type leafref {
+ *             path ../../../ns-profile/id;
+ *           }
+ *         }
+ *         leaf number-of-instances {
+ *           default 1;
+ *           type uint32;
+ *         }
+ *       }
+ *       must "(count(vnf-to-level-mapping) + count(virtual-link-to-level-mapping) + count(ns-to-level-mapping)) > 0" {
+ *         error-message
+ *           "At least one attribute between vnf-to-level-mapping, virtual-link-to-level-mapping and ns-to-level-mapping shall be present.";
+ *       }
+ *     }
+ *     leaf default-instantiation-level {
+ *       type leafref {
+ *         path ../ns-instantiation-level/id;
+ *       }
+ *     }
+ *     list ns-profile {
+ *       must "min-number-of-instances <= max-number-of-instances" {
+ *         error-message
+ *           "min-number-of-instances has to be less than or equalmax-number-of-instances.";
+ *       }
+ *       must boolean(../../nested-nsd-id[.=current()/nsd-id]) {
+ *         error-message
+ *           "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *       }
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf nsd-id {
+ *         type leafref {
+ *           path ../../../../nsd/id;
+ *         }
+ *       }
+ *       leaf ns-df-id {
+ *         type leafref {
+ *           path deref(../nsd-id)/../df/id;
+ *         }
+ *       }
+ *       leaf instantiation-level-id {
+ *         type leafref {
+ *           path deref(../ns-df-id)/../ns-instantiation-level/id;
+ *         }
+ *       }
+ *       leaf min-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *       }
+ *       leaf max-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *       }
+ *       list affinity-or-anti-affinity-group-id {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       list virtual-link-connectivity {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         list constituent-cpd-id {
+ *           key constituent-base-element-id;
+ *           leaf constituent-base-element-id {
+ *             type leafref {
+ *               path ../../../id;
+ *             }
+ *           }
+ *           leaf constituent-cpd-id {
+ *             type leafref {
+ *               path deref(../../../nsd-id)/../sapd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list dependencies {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       choice primary-id {
+ *         case primary-vnf-profile {
+ *           leaf primary-vnf-profile {
+ *             type leafref {
+ *               path ../../vnf-profile/vnfd-id;
+ *             }
+ *           }
+ *         }
+ *         case primary-ns-profile {
+ *           leaf primary-ns-profile {
+ *             type leafref {
+ *               path ../../ns-profile/nsd-id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       choice secondary-id {
+ *         case secondary-vnf-profile {
+ *           leaf secondary-vnf-profile {
+ *             type leafref {
+ *               path ../../vnf-profile/vnfd-id;
+ *             }
+ *           }
+ *         }
+ *         case secondary-ns-profile {
+ *           leaf secondary-ns-profile {
+ *             type leafref {
+ *               path ../../ns-profile/nsd-id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list monitored-info {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       container vnf-indicator-info {
+ *         leaf vnfd-id {
+ *           type leafref {
+ *             path ../../../../../vnfd/id;
+ *           }
+ *         }
+ *         leaf vnf-indicator {
+ *           type leafref {
+ *             path deref(../vnfd-id)/../indicator/id;
+ *           }
+ *         }
+ *       }
+ *       container monitoring-parameter {
+ *         leaf id {
+ *           type string;
+ *         }
+ *         leaf name {
+ *           type string;
+ *         }
+ *         leaf performance-metric {
+ *           type string;
+ *         }
+ *         leaf collection-period {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   uses security-parameters;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd + * + */ +@JsonDeserialize(as = NsdImpl.class) +@JsonIgnoreProperties(value= {"virtualStorageDesc","extCpd","securityGroupRule","indicator","swImageDesc"}, ignoreUnknown = true) +public interface Nsd + extends + DataObject, + SecurityParameters +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nsd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this NSD information element. It Globally uniquely identifies an + * instance of the NSD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Identifies the designer of the NSD. + * + * + * + * @return java.lang.String designer, or null if not present + */ + @Nullable String getDesigner(); + + /** + * Identifies the version of the NSD. + * + * + * + * @return java.lang.String version, or null if not present + */ + @Nullable String getVersion(); + + /** + * Provides the human readable name of the NSD. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Identifies an NSD in a version independent manner. This attribute is invariant + * across versions of the network service descriptor. + * + * + * + * @return java.lang.String invariantId, or null if not present + */ + @Nullable String getInvariantId(); + + /** + * References the NSD of a constituent nested NS. + * + * + * + * @return java.util.List nestedNsdId, or null if not present + */ + @Nullable List getNestedNsdId(); + + /** + * References the VNFD of a constituent VNF. + * + * + * + * @return java.util.List vnfdId, or null if not present + */ + @Nullable List getVnfdId(); + + /** + * References the PNFD of a constituent PNF. + * + * + * + * @return java.util.List pnfdId, or null if not present + */ + @Nullable List getPnfdId(); + + /** + * Provides the descriptor of a service access point of the network service. + * + * + * + * @return java.util.Map sapd, or null if not present + */ + @Nullable Map getSapd(); + + /** + * @return java.util.Map sapd, or an empty list if it is not present + */ + default @NonNull Map nonnullSapd() { + return CodeHelpers.nonnull(getSapd()); + } + + /** + * Provides the constituent VLDs. + * + * + * + * @return java.util.Map virtualLinkDesc, or null if not present + */ + @Nullable Map getVirtualLinkDesc(); + + /** + * @return java.util.Map virtualLinkDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkDesc() { + return CodeHelpers.nonnull(getVirtualLinkDesc()); + } + + /** + * Provides the descriptors of the applicable forwarding graphs. + * + * + * + * @return java.util.Map vnffgd, or null if not present + */ + @Nullable Map getVnffgd(); + + /** + * @return java.util.Map vnffgd, or an empty list if it is not present + */ + default @NonNull Map nonnullVnffgd() { + return CodeHelpers.nonnull(getVnffgd()); + } + + /** + * @return java.util.List autoscaleRule, or null if not present + */ + @Nullable List getAutoscaleRule(); + + /** + * @return java.util.Map lifecycleManagementScript, or null if not present + */ + @Nullable Map getLifecycleManagementScript(); + + /** + * @return java.util.Map lifecycleManagementScript, or an empty list if it is not present + */ + default @NonNull Map nonnullLifecycleManagementScript() { + return CodeHelpers.nonnull(getLifecycleManagementScript()); + } + + /** + * Identifies a DF within the scope of an NSD. + * + * + * + * @return java.util.Map df, or null if not present + */ + @Nullable Map getDf(); + + /** + * @return java.util.Map df, or an empty list if it is not present + */ + default @NonNull Map nonnullDf() { + return CodeHelpers.nonnull(getDf()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Odu2.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Odu2.java new file mode 100644 index 0000000..c1b8c17 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Odu2.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity odu2 {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/odu2 + * + */ +public interface Odu2 + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("odu2"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/OperateVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/OperateVnf.java new file mode 100644 index 0000000..f3f7b5f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/OperateVnf.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation enables requesting to change the state of a VNF instance, + * including starting and stopping the VNF instance. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity operate-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/operate-vnf + * + */ +public interface OperateVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("operate-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Pnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Pnfd.java new file mode 100644 index 0000000..adb9460 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Pnfd.java @@ -0,0 +1,175 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.Security; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.SecurityKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping pnfd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf function-description {
+ *     type string;
+ *   }
+ *   leaf provider {
+ *     type string;
+ *   }
+ *   leaf version {
+ *     type string;
+ *   }
+ *   leaf invariant-id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   list ext-cpd {
+ *     key id;
+ *     uses cpd;
+ *   }
+ *   list security {
+ *     key signature;
+ *     uses security-parameters;
+ *   }
+ *   leaf geographical-location-info {
+ *     type string;
+ *   }
+ *   uses security-group-rule;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/pnfd + * + */ +public interface Pnfd + extends + DataObject, + SecurityGroupRule +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnfd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this Pnfd information element. It uniquely identifies the PNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Describes the PNF function. + * + * + * + * @return java.lang.String functionDescription, or null if not present + */ + @Nullable String getFunctionDescription(); + + /** + * Identifies the provider of the PNFD. + * + * + * + * @return java.lang.String provider, or null if not present + */ + @Nullable String getProvider(); + + /** + * Identifies the version of the PNFD. + * + * + * + * @return java.lang.String version, or null if not present + */ + @Nullable String getVersion(); + + /** + * Identifies a PNFD in a version independent manner. This attribute is invariant + * across versions of PNFD. + * + * + * + * @return java.lang.String invariantId, or null if not present + */ + @Nullable String getInvariantId(); + + /** + * Provides the human readable name of the PNFD. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Specifies the characteristics of one or more connection points where to connect + * the PNF to a VL. + * + * + * + * @return java.util.Map extCpd, or null if not present + */ + @Nullable Map getExtCpd(); + + /** + * @return java.util.Map extCpd, or an empty list if it is not present + */ + default @NonNull Map nonnullExtCpd() { + return CodeHelpers.nonnull(getExtCpd()); + } + + /** + * Provides a signature to prevent tampering. Editor's Note: While IFA014 does + * specify that the PNFD includes a security parameter. SOL001 does not have one. + * We need to harmonize SOL001 & SOL006 on this point. + * + * + * + * @return java.util.Map security, or null if not present + */ + @Nullable Map getSecurity(); + + /** + * @return java.util.Map security, or an empty list if it is not present + */ + default @NonNull Map nonnullSecurity() { + return CodeHelpers.nonnull(getSecurity()); + } + + /** + * It provides information about the geographical location (e.g. geographic + * coordinates or address of the building, etc.) of the PNF. The cardinality 0 is + * used when the location is unknown. Editor's Note: The type is TBD in SOL001. We + * need to make a common SOL001/SOL006 decision. + * + * + * + * @return java.lang.String geographicalLocationInfo, or null if not present + */ + @Nullable String getGeographicalLocationInfo(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/PseudoWire.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/PseudoWire.java new file mode 100644 index 0000000..cf1adcc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/PseudoWire.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity pseudo-wire {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/pseudo-wire + * + */ +public interface PseudoWire + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pseudo-wire"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/QueryVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/QueryVnf.java new file mode 100644 index 0000000..2906f3e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/QueryVnf.java @@ -0,0 +1,31 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation provides information about VNF instances. The applicable VNF + * instances can be chosen based on filtering criteria, and the information can be + * restricted to selected attributes. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity query-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/query-vnf + * + */ +public interface QueryVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("query-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ResourceHandle.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ResourceHandle.java new file mode 100644 index 0000000..41738be --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ResourceHandle.java @@ -0,0 +1,58 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping resource-handle {
+ *   leaf vim-id {
+ *     type string;
+ *   }
+ *   leaf resource-provider-id {
+ *     type string;
+ *   }
+ *   leaf resource-id {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/resource-handle + * + */ +public interface ResourceHandle + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("resource-handle"); + + @Override + Class implementedInterface(); + + /** + * @return java.lang.String vimId, or null if not present + */ + @Nullable String getVimId(); + + /** + * @return java.lang.String resourceProviderId, or null if not present + */ + @Nullable String getResourceProviderId(); + + /** + * @return java.lang.String resourceId, or null if not present + */ + @Nullable String getResourceId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Root.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Root.java new file mode 100644 index 0000000..c71ed85 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Root.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity root {
+ *   base cp-role;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/root + * + */ +public interface Root + extends + CpRole +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("root"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/RootStorage.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/RootStorage.java new file mode 100644 index 0000000..4de09bc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/RootStorage.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Root type of storage. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity root-storage {
+ *   base storage-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/root-storage + * + */ +public interface RootStorage + extends + StorageType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("root-storage"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnf.java new file mode 100644 index 0000000..7ad35e4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnf.java @@ -0,0 +1,32 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation provides methods to request scaling a VNF in multiple ways: • + * horizontal scaling: - scale out: adding additional VNFC instances to the VNF to + * increase capacity - scale in: removing VNFC instances from the VNF, in order to + * release unused capacity + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity scale-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/scale-vnf + * + */ +public interface ScaleVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scale-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnfToLevel.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnfToLevel.java new file mode 100644 index 0000000..ba34b21 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnfToLevel.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation scales an instantiated VNF of a particular DF to a target size. + * The target size is either expressed as an instantiation level of that DF as + * defined in the VNFD, or given as a list of scale levels, one per scaling aspect + * of that DF. Instantiation levels and scaling aspects are declared in the VNFD. + * Typically, the result of this operation is adding and/or removing Network + * Functions Virtualization Infrastructure (NFVI) resources to/from the VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity scale-vnf-to-level {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/scale-vnf-to-level + * + */ +public interface ScaleVnfToLevel + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scale-vnf-to-level"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityGroupRule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityGroupRule.java new file mode 100644 index 0000000..032472d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityGroupRule.java @@ -0,0 +1,93 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping security-group-rule {
+ *   list security-group-rule {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf direction {
+ *       type enumeration {
+ *         enum ingress;
+ *         enum egress;
+ *       }
+ *       default ingress;
+ *     }
+ *     leaf ether-type {
+ *       type enumeration {
+ *         enum ipv4;
+ *         enum ipv6;
+ *       }
+ *       default ipv4;
+ *     }
+ *     leaf protocol {
+ *       type enumeration {
+ *         enum tcp;
+ *         enum udp;
+ *         enum icmp;
+ *       }
+ *       default tcp;
+ *     }
+ *     leaf port-range-min {
+ *       must ". <= ../port-range-max";
+ *       type uint16;
+ *       default 0;
+ *     }
+ *     leaf port-range-max {
+ *       must ". >= ../port-range-min";
+ *       type uint16;
+ *       default 65535;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/security-group-rule + * + */ +public interface SecurityGroupRule + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("security-group-rule"); + + @Override + Class implementedInterface(); + + /** + * Defines security group rules to be used by the VNF. + * + * + * + * @return java.util.Map securityGroupRule, or null if not present + */ + @Nullable Map getSecurityGroupRule(); + + /** + * @return java.util.Map securityGroupRule, or an empty list if it is not present + */ + default @NonNull Map nonnullSecurityGroupRule() { + return CodeHelpers.nonnull(getSecurityGroupRule()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityParameters.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityParameters.java new file mode 100644 index 0000000..eb41f0b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityParameters.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping security-parameters {
+ *   leaf signature {
+ *     type string;
+ *   }
+ *   leaf algorithm {
+ *     type string;
+ *   }
+ *   leaf certificate {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/security-parameters + * + */ +public interface SecurityParameters + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("security-parameters"); + + @Override + Class implementedInterface(); + + /** + * Provides the signature of the signed part of the descriptor. + * + * + * + * @return java.lang.String signature, or null if not present + */ + @Nullable String getSignature(); + + /** + * Identifies the algorithm used to compute the signature. + * + * + * + * @return java.lang.String algorithm, or null if not present + */ + @Nullable String getAlgorithm(); + + /** + * Provides a certificate or a reference to a certificate to validate the + * signature. + * + * + * + * @return java.lang.String certificate, or null if not present + */ + @Nullable String getCertificate(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha224.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha224.java new file mode 100644 index 0000000..772f352 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha224.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-224. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-224 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-224 + * + */ +public interface Sha224 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-224"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha256.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha256.java new file mode 100644 index 0000000..4448189 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha256.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-256. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-256 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-256 + * + */ +public interface Sha256 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-256"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha384.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha384.java new file mode 100644 index 0000000..b23be7a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha384.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-384. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-384 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-384 + * + */ +public interface Sha384 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-384"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha512.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha512.java new file mode 100644 index 0000000..d467b05 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha512.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-512. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-512 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-512 + * + */ +public interface Sha512 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-512"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/StorageType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/StorageType.java new file mode 100644 index 0000000..84f8724 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/StorageType.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Base type of storage that identities can derive from. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity storage-type {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/storage-type + * + */ +public interface StorageType + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("storage-type"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SupportedOperation.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SupportedOperation.java new file mode 100644 index 0000000..47bdf88 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SupportedOperation.java @@ -0,0 +1,31 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Indicates which operations are available for this DF via the VNF LCM interface. + * Instantiate VNF, Query VNF and Terminate VNF are supported in all DF and + * therefore need not be included in this list. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity supported-operation {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/supported-operation + * + */ +public interface SupportedOperation + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("supported-operation"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SwapStorage.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SwapStorage.java new file mode 100644 index 0000000..9c1be42 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SwapStorage.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Swap type of storage. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity swap-storage {
+ *   base storage-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/swap-storage + * + */ +public interface SwapStorage + extends + StorageType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("swap-storage"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/TerminateVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/TerminateVnf.java new file mode 100644 index 0000000..2919578 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/TerminateVnf.java @@ -0,0 +1,35 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation terminates a VNF. A VNF can be terminated gracefully or + * forcefully. Graceful termination means that the VNFM arranges to take the VNF + * out of service, e.g. by asking the VNF's EM to take the VNF out of service, and + * only after that shuts down the VNF and releases the resources. Forceful + * termination means that the VNFM immediately shuts down the VNF and releases the + * resources. A time interval can be specified for taking the VNF out of service, + * after which the VNF is shut down if taking it out of service has not completed. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity terminate-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/terminate-vnf + * + */ +public interface TerminateVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("terminate-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/VirtualNetworkInterfaceRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/VirtualNetworkInterfaceRequirements.java new file mode 100644 index 0000000..fa3bbb3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/VirtualNetworkInterfaceRequirements.java @@ -0,0 +1,78 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirementKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping virtual-network-interface-requirements {
+ *   list virtual-network-interface-requirement {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf support-mandatory {
+ *       default false;
+ *       type boolean;
+ *     }
+ *     list network-interface-requirements {
+ *       key key;
+ *       min-elements 1;
+ *       max-elements 1;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/virtual-network-interface-requirements + * + */ +public interface VirtualNetworkInterfaceRequirements + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-network-interface-requirements"); + + @Override + Class implementedInterface(); + + /** + * Specifies requirements on a virtual network interface realising the CPs + * instantiated from this CPD. + * + * + * + * @return java.util.Map virtualNetworkInterfaceRequirement, or null if not present + */ + @Nullable Map getVirtualNetworkInterfaceRequirement(); + + /** + * @return java.util.Map virtualNetworkInterfaceRequirement, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualNetworkInterfaceRequirement() { + return CodeHelpers.nonnull(getVirtualNetworkInterfaceRequirement()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Vnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Vnfd.java new file mode 100644 index 0000000..27db5c0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Vnfd.java @@ -0,0 +1,1328 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder.VnfdImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping vnfd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf provider {
+ *     type string;
+ *   }
+ *   leaf product-name {
+ *     type string;
+ *   }
+ *   leaf software-version {
+ *     type string;
+ *   }
+ *   leaf version {
+ *     type string;
+ *   }
+ *   leaf product-info-name {
+ *     type string;
+ *   }
+ *   leaf product-info-description {
+ *     type string;
+ *   }
+ *   leaf-list vnfm-info {
+ *     type string;
+ *     min-elements 1;
+ *   }
+ *   leaf localization-language {
+ *     type string;
+ *   }
+ *   leaf default-localization-language {
+ *     when ../localization-language;
+ *     type string;
+ *   }
+ *   list vdu {
+ *     key id;
+ *     min-elements 1;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list int-cpd {
+ *       key id;
+ *       min-elements 1;
+ *       leaf int-virtual-link-desc {
+ *         type leafref {
+ *           path ../../../int-virtual-link-desc/id;
+ *         }
+ *       }
+ *       leaf bitrate-requirement {
+ *         type uint64;
+ *         units Mbps;
+ *       }
+ *       uses virtual-network-interface-requirements;
+ *       leaf nicio-requirements {
+ *         type leafref {
+ *           path ../../../virtual-compute-desc/id;
+ *         }
+ *       }
+ *       leaf-list order {
+ *         type uint32;
+ *       }
+ *       uses cpd;
+ *       leaf security-group-rule-id {
+ *         type leafref {
+ *           path ../../../security-group-rule/id;
+ *         }
+ *       }
+ *     }
+ *     leaf virtual-compute-desc {
+ *       type leafref {
+ *         path ../../virtual-compute-desc/id;
+ *       }
+ *       must "../../virtual-compute-desc[id=current()]/virtual-memory/size >=../../sw-image-desc[id=current()/../sw-image-desc]/min-ram";
+ *     }
+ *     leaf-list virtual-storage-desc {
+ *       type leafref {
+ *         path ../../virtual-storage-desc/id;
+ *       }
+ *     }
+ *     list boot-order {
+ *       ordered-by user;
+ *       key key;
+ *       leaf key {
+ *         type uint32;
+ *       }
+ *       leaf value {
+ *         type leafref {
+ *           path ../../virtual-storage-desc;
+ *         }
+ *       }
+ *     }
+ *     leaf sw-image-desc {
+ *       type leafref {
+ *         path ../../sw-image-desc/id;
+ *       }
+ *     }
+ *     leaf-list nfvi-constraint {
+ *       type string;
+ *     }
+ *     list monitoring-parameter {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       uses monitoring-parameter;
+ *     }
+ *     list configurable-properties {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf boot-data {
+ *       type string;
+ *     }
+ *   }
+ *   list virtual-compute-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list logical-node {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       list requirement-detail {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     list request-additional-capability {
+ *       key name;
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf support-mandatory {
+ *         type boolean;
+ *       }
+ *       leaf min-version {
+ *         type string;
+ *       }
+ *       leaf preferred-version {
+ *         type string;
+ *       }
+ *       list target-performance-parameters {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     leaf compute-requirements {
+ *       type string;
+ *     }
+ *     container virtual-memory {
+ *       leaf size {
+ *         type decimal64 {
+ *           fraction-digits 1;
+ *           range 0..max;
+ *         }
+ *         units GB;
+ *         default 1;
+ *       }
+ *       leaf over-subscription-policy {
+ *         type string;
+ *       }
+ *       list vdu-mem-requirements {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *       leaf numa-enabled {
+ *         type boolean;
+ *       }
+ *     }
+ *     container virtual-cpu {
+ *       leaf cpu-architecture {
+ *         type string;
+ *       }
+ *       leaf num-virtual-cpu {
+ *         type uint16 {
+ *           range 1..max;
+ *         }
+ *         default 1;
+ *       }
+ *       leaf clock {
+ *         type uint32;
+ *         units MHz;
+ *       }
+ *       leaf oversubscription-policy {
+ *         type string;
+ *       }
+ *       list vdu-cpu-requirements {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *       container pinning {
+ *         presence "Set to specify CPU pinning.";
+ *         leaf policy {
+ *           default dynamic;
+ *           type enumeration {
+ *             enum static;
+ *             enum dynamic;
+ *           }
+ *         }
+ *         list rule {
+ *           when "../policy = 'static'";
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list virtual-storage-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf type-of-storage {
+ *       default root-storage;
+ *       type identityref {
+ *         base storage-type;
+ *       }
+ *     }
+ *     leaf size-of-storage {
+ *       type uint64;
+ *       units GB;
+ *       default 0;
+ *     }
+ *     list vdu-storage-requirements {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf rdma-enabled {
+ *       type boolean;
+ *     }
+ *     leaf sw-image-desc {
+ *       type leafref {
+ *         path ../../sw-image-desc/id;
+ *       }
+ *       must "../size-of-storage >=../../sw-image-desc[id=current()]/min-disk";
+ *     }
+ *   }
+ *   list sw-image-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf version {
+ *       type string;
+ *     }
+ *     container checksum {
+ *       leaf algorithm {
+ *         type identityref {
+ *           base checksum-algorithm;
+ *         }
+ *       }
+ *       leaf hash {
+ *         type string;
+ *       }
+ *     }
+ *     leaf container-format {
+ *       default bare;
+ *       type enumeration {
+ *         enum aki {
+ *         }
+ *         enum ami {
+ *         }
+ *         enum ari {
+ *         }
+ *         enum bare {
+ *         }
+ *         enum docker {
+ *         }
+ *         enum ova {
+ *         }
+ *         enum ovf {
+ *         }
+ *       }
+ *     }
+ *     leaf disk-format {
+ *       default qcow2;
+ *       type enumeration {
+ *         enum aki {
+ *         }
+ *         enum ami {
+ *         }
+ *         enum ari {
+ *         }
+ *         enum iso {
+ *         }
+ *         enum qcow2 {
+ *         }
+ *         enum raw {
+ *         }
+ *         enum vdi {
+ *         }
+ *         enum vhd {
+ *         }
+ *         enum vhdx {
+ *         }
+ *         enum vmdk {
+ *         }
+ *       }
+ *     }
+ *     leaf min-disk {
+ *       type uint64;
+ *       units GB;
+ *     }
+ *     leaf min-ram {
+ *       type decimal64 {
+ *         fraction-digits 1;
+ *         range 0..max;
+ *       }
+ *       units GB;
+ *       default 0;
+ *     }
+ *     leaf size {
+ *       type uint64;
+ *       units GB;
+ *     }
+ *     leaf image {
+ *       default .;
+ *       type inet:uri;
+ *     }
+ *     leaf operating-system {
+ *       type string;
+ *     }
+ *     leaf-list supported-virtualization-environment {
+ *       type string;
+ *     }
+ *   }
+ *   list int-virtual-link-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list flavour {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       container qos {
+ *         presence "VL QoS parameters";
+ *         leaf latency {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-delay-variation {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-loss-ratio {
+ *           type decimal64 {
+ *             fraction-digits 2;
+ *             range 0..1.00;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     uses connectivity-type;
+ *     leaf-list test-access {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list monitoring-parameters {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       uses monitoring-parameter;
+ *     }
+ *   }
+ *   uses security-group-rule;
+ *   list ext-cpd {
+ *     key id;
+ *     min-elements 1;
+ *     choice cp-connection {
+ *       case int-virtual-link-desc {
+ *         leaf int-virtual-link-desc {
+ *           type leafref {
+ *             path ../../int-virtual-link-desc/id;
+ *           }
+ *         }
+ *       }
+ *       case int-cpd {
+ *         container int-cpd {
+ *           leaf vdu-id {
+ *             type leafref {
+ *               path ../../../vdu/id;
+ *             }
+ *           }
+ *           leaf cpd {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       case k8s-cluster-net {
+ *         leaf k8s-cluster-net {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     uses virtual-network-interface-requirements;
+ *     leaf nicio-requirements {
+ *       type leafref {
+ *         path ../../virtual-compute-desc/id;
+ *       }
+ *     }
+ *     uses cpd;
+ *     leaf security-group-rule-id {
+ *       type leafref {
+ *         path ../../security-group-rule/id;
+ *       }
+ *     }
+ *   }
+ *   list df {
+ *     must "default-instantiation-level or count(instantiation-level) = 1";
+ *     key id;
+ *     min-elements 1;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list vdu-profile {
+ *       key id;
+ *       min-elements 1;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../vdu/id;
+ *         }
+ *       }
+ *       leaf min-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *       }
+ *       leaf max-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *         must ". >= ../min-number-of-instances";
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-profile {
+ *       key "id flavour";
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../int-virtual-link-desc/id;
+ *         }
+ *       }
+ *       leaf flavour {
+ *         type leafref {
+ *           path ../../../flavour/id;
+ *         }
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       container max-bit-rate-requirements {
+ *         leaf root {
+ *           type uint32;
+ *         }
+ *         leaf leaf {
+ *           type uint32;
+ *         }
+ *       }
+ *       container min-bit-rate-requirements {
+ *         leaf root {
+ *           type uint32;
+ *         }
+ *         leaf leaf {
+ *           type uint32;
+ *         }
+ *       }
+ *       container virtual-link-protocol-data {
+ *         leaf associated-layer-protocol {
+ *           type identityref {
+ *             base layer-protocol;
+ *           }
+ *         }
+ *         container l2-protocol-data {
+ *           when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *           leaf name {
+ *             type string;
+ *           }
+ *           leaf network-type {
+ *             type enumeration {
+ *               enum flat;
+ *               enum vlan;
+ *               enum vxlan;
+ *               enum gre;
+ *             }
+ *           }
+ *           leaf vlan-transparent {
+ *             type boolean;
+ *           }
+ *           leaf mtu {
+ *             type uint16;
+ *           }
+ *         }
+ *         container l3-protocol-data {
+ *           when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *           leaf name {
+ *             type string;
+ *           }
+ *           leaf ip-version {
+ *             type enumeration {
+ *               enum ipv4;
+ *               enum ipv6;
+ *             }
+ *             default ipv4;
+ *           }
+ *           leaf cidr {
+ *             type string;
+ *           }
+ *           leaf-list ip-allocation-pools {
+ *             type string;
+ *           }
+ *           leaf gateway-ip {
+ *             type inet:ip-address;
+ *           }
+ *           leaf dhcp-enabled {
+ *             type boolean;
+ *             default true;
+ *           }
+ *           leaf ipv6-address-mode {
+ *             when "../ip-version = 'ipv6'";
+ *             type enumeration {
+ *               enum slaac;
+ *               enum dhcpv6-stateful;
+ *               enum dhcpv6-stateless;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list instantiation-level {
+ *       key id;
+ *       min-elements 1;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       list vdu-level {
+ *         key vdu-id;
+ *         min-elements 1;
+ *         leaf vdu-id {
+ *           type leafref {
+ *             path ../../../../vdu/id;
+ *           }
+ *         }
+ *         leaf number-of-instances {
+ *           type uint16;
+ *           must ". <= ../../../../df/vdu-profile[id=current()/../vdu-id]/max-number-of-instances";
+ *           must ". >= ../../../../df/vdu-profile[id=current()/../vdu-id]/min-number-of-instances";
+ *           default 1;
+ *         }
+ *       }
+ *       list scaling-info {
+ *         key scaling-aspect-id;
+ *         leaf scaling-aspect-id {
+ *           type leafref {
+ *             path ../../../scaling-aspect/id;
+ *           }
+ *         }
+ *         leaf scale-level {
+ *           type uint32;
+ *         }
+ *       }
+ *     }
+ *     leaf default-instantiation-level {
+ *       type leafref {
+ *         path ../instantiation-level/id;
+ *       }
+ *     }
+ *     leaf-list supported-operation {
+ *       type identityref {
+ *         base supported-operation;
+ *       }
+ *     }
+ *     container lcm-operations-configuration {
+ *       container instantiate-vnf-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container scale-vnf-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *         leaf scaling-by-more-than-one-step-supported {
+ *           type boolean;
+ *           default false;
+ *         }
+ *       }
+ *       container scale-vnf-to-level-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *         leaf arbitrary-target-levels-supported {
+ *           type boolean;
+ *           default false;
+ *         }
+ *       }
+ *       container heal-vnf-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *         leaf-list cause {
+ *           type string;
+ *         }
+ *       }
+ *       container terminate-vnf-op-config {
+ *         leaf min-graceful-termination {
+ *           type yang:timeticks;
+ *           default 1;
+ *         }
+ *         leaf max-recommended-graceful-termination {
+ *           type yang:timeticks;
+ *         }
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container operate-vnf-op-config {
+ *         leaf min-graceful-stop-timeout {
+ *           type yang:timeticks;
+ *           default 1;
+ *         }
+ *         leaf max-recommended-graceful-stop-timeout {
+ *           type yang:timeticks;
+ *         }
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container change-vnf-flavour-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container change-ext-vnf-connectivity-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf type {
+ *         type affinity-type;
+ *       }
+ *       leaf scope {
+ *         type affinity-scope;
+ *       }
+ *     }
+ *     list indicator {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf indicator-value {
+ *         type string;
+ *       }
+ *       leaf source {
+ *         type enumeration {
+ *           enum vnf;
+ *           enum em;
+ *           enum both;
+ *         }
+ *       }
+ *     }
+ *     list supported-vnf-interfaces {
+ *       key name;
+ *       leaf name {
+ *         type enumeration {
+ *           enum vnf-configuration;
+ *           enum vnf-indicator;
+ *         }
+ *       }
+ *       leaf-list cpd-id {
+ *         type leafref {
+ *           path ../../../ext-cpd/id;
+ *         }
+ *       }
+ *       list interface-details {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     list monitoring-parameter {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       uses monitoring-parameter;
+ *     }
+ *     list scaling-aspect {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       leaf max-scale-level {
+ *         type uint32 {
+ *           range 1..max;
+ *         }
+ *       }
+ *       container aspect-delta-details {
+ *         list deltas {
+ *           key id;
+ *           min-elements 1;
+ *           leaf id {
+ *             type string;
+ *           }
+ *           list vdu-delta {
+ *             key id;
+ *             leaf id {
+ *               type leafref {
+ *                 path ../../../../../../vdu/id;
+ *               }
+ *             }
+ *             leaf number-of-instances {
+ *               type uint32 {
+ *                 range 0..max;
+ *               }
+ *             }
+ *           }
+ *           list virtual-link-bit-rate-delta {
+ *             key id;
+ *             leaf id {
+ *               type string;
+ *             }
+ *             container bit-rate-requirements {
+ *               leaf root {
+ *                 type uint32;
+ *                 units bits/sec;
+ *               }
+ *               leaf leaf {
+ *                 type uint32;
+ *                 units bits/sec;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         leaf step-deltas {
+ *           type leafref {
+ *             path ../deltas/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   container configurable-properties {
+ *     leaf is-auto-scalable-enabled {
+ *       type boolean;
+ *     }
+ *     leaf is-auto-heal-enabled {
+ *       type boolean;
+ *     }
+ *     list additional-configurable-property {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   container modifiable-attributes {
+ *     leaf-list extension {
+ *       type string;
+ *     }
+ *     leaf-list metadata {
+ *       type string;
+ *     }
+ *   }
+ *   list lifecycle-management-script {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf-list event {
+ *       type internal-lifecycle-management-script-event;
+ *     }
+ *     leaf-list lcm-transition-event {
+ *       type string;
+ *     }
+ *     leaf script {
+ *       type string;
+ *     }
+ *     leaf script-dsl {
+ *       type string;
+ *     }
+ *     list script-input {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   list element-group {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf-list vdu {
+ *       type leafref {
+ *         path ../../vdu/id;
+ *       }
+ *     }
+ *     leaf-list virtual-link-desc {
+ *       type leafref {
+ *         path ../../int-virtual-link-desc/id;
+ *       }
+ *     }
+ *   }
+ *   list indicator {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf-list indicator-value {
+ *       type string;
+ *     }
+ *     leaf source {
+ *       type enumeration {
+ *         enum vnf;
+ *         enum em;
+ *         enum both;
+ *       }
+ *     }
+ *   }
+ *   leaf-list auto-scale {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd + * + */ +@JsonDeserialize(as = VnfdImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface Vnfd + extends + DataObject, + SecurityGroupRule +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this VNFD information element. This attribute shall be globally + * unique. The format will be defined in the data model specification phase. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Provider of the VNF and of the VNFD + * + * + * + * @return java.lang.String provider, or null if not present + */ + @Nullable String getProvider(); + + /** + * Name to identify the VNF Product. Invariant for the VNF Product lifetime. + * + * + * + * @return java.lang.String productName, or null if not present + */ + @Nullable String getProductName(); + + /** + * Software version of the VNF. This is changed when there is any change to the + * software that is included in the VNF Package + * + * + * + * @return java.lang.String softwareVersion, or null if not present + */ + @Nullable String getSoftwareVersion(); + + /** + * Identifies the version of the VNFD + * + * + * + * @return java.lang.String version, or null if not present + */ + @Nullable String getVersion(); + + /** + * Human readable name of the VNFD. Can change during the VNF Product lifetime. + * + * + * + * @return java.lang.String productInfoName, or null if not present + */ + @Nullable String getProductInfoName(); + + /** + * Human readable description of the VNFD. Can change during the VNF Product + * lifetime. + * + * + * + * @return java.lang.String productInfoDescription, or null if not present + */ + @Nullable String getProductInfoDescription(); + + /** + * Identifies VNFM(s) compatible with the VNF described in this version of the + * VNFD. + * + * + * + * @return java.util.List vnfmInfo, or null if not present + */ + @Nullable List getVnfmInfo(); + + /** + * Information about the language of the VNF. + * + * + * + * @return java.lang.String localizationLanguage, or null if not present + */ + @Nullable String getLocalizationLanguage(); + + /** + * Default localization language that is instantiated if no information about + * selected localization language is available. Shall be present if + * 'localization-language' is present and shall be absent otherwise. + * + * + * + * @return java.lang.String defaultLocalizationLanguage, or null if not present + */ + @Nullable String getDefaultLocalizationLanguage(); + + /** + * The Virtualisation Deployment Unit (VDU) is a construct supporting the + * description of the deployment and operational behaviour of a VNF component, or + * the entire VNF if it was not componentized in components. + * + * + * + * @return java.util.Map vdu, or null if not present + */ + @Nullable Map getVdu(); + + /** + * @return java.util.Map vdu, or an empty list if it is not present + */ + default @NonNull Map nonnullVdu() { + return CodeHelpers.nonnull(getVdu()); + } + + /** + * Defines descriptors of virtual compute resources to be used by the VNF. + * + * + * + * @return java.util.Map virtualComputeDesc, or null if not present + */ + @Nullable Map getVirtualComputeDesc(); + + /** + * @return java.util.Map virtualComputeDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualComputeDesc() { + return CodeHelpers.nonnull(getVirtualComputeDesc()); + } + + /** + * Storage requirements for a Virtual Storage instance attached to the VNFC created + * from this VDU + * + * + * + * @return java.util.Map virtualStorageDesc, or null if not present + */ + @Nullable Map getVirtualStorageDesc(); + + /** + * @return java.util.Map virtualStorageDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualStorageDesc() { + return CodeHelpers.nonnull(getVirtualStorageDesc()); + } + + /** + * Defines descriptors of software images to be used by the VNF. + * + * + * + * @return java.util.Map swImageDesc, or null if not present + */ + @Nullable Map getSwImageDesc(); + + /** + * @return java.util.Map swImageDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullSwImageDesc() { + return CodeHelpers.nonnull(getSwImageDesc()); + } + + /** + * Represents the type of network connectivity mandated by the VNF provider between + * two or more CPs which includes at least one internal CP. + * + * + * + * @return java.util.Map intVirtualLinkDesc, or null if not present + */ + @Nullable Map getIntVirtualLinkDesc(); + + /** + * @return java.util.Map intVirtualLinkDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullIntVirtualLinkDesc() { + return CodeHelpers.nonnull(getIntVirtualLinkDesc()); + } + + /** + * Describes an external interface exposed by this VNF enabling connection with a + * Virual Link + * + * + * + * @return java.util.Map extCpd, or null if not present + */ + @Nullable Map getExtCpd(); + + /** + * @return java.util.Map extCpd, or an empty list if it is not present + */ + default @NonNull Map nonnullExtCpd() { + return CodeHelpers.nonnull(getExtCpd()); + } + + /** + * Describes a specific Deployment Flavour (DF) of a VNF with specific requirements + * for capacity and performance. + * + * + * + * @return java.util.Map df, or null if not present + */ + @Nullable Map getDf(); + + /** + * @return java.util.Map df, or an empty list if it is not present + */ + default @NonNull Map nonnullDf() { + return CodeHelpers.nonnull(getDf()); + } + + /** + * Describes the configurable properties of the VNF (e.g. related to auto scaling + * and auto healing). + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties configurableProperties, or null if not present + */ + @Nullable ConfigurableProperties getConfigurableProperties(); + + /** + * Describes the modifiable attributes of the VNF. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes modifiableAttributes, or null if not present + */ + @Nullable ModifiableAttributes getModifiableAttributes(); + + /** + * Includes a list of events and corresponding management scripts performed for the + * VNF. + * + * + * + * @return java.util.Map lifecycleManagementScript, or null if not present + */ + @Nullable Map getLifecycleManagementScript(); + + /** + * @return java.util.Map lifecycleManagementScript, or an empty list if it is not present + */ + default @NonNull Map nonnullLifecycleManagementScript() { + return CodeHelpers.nonnull(getLifecycleManagementScript()); + } + + /** + * Describes the associated elements of a VNFD for a certain purpose during VNF + * lifecycle management. + * + * + * + * @return java.util.Map elementGroup, or null if not present + */ + @Nullable Map getElementGroup(); + + /** + * @return java.util.Map elementGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullElementGroup() { + return CodeHelpers.nonnull(getElementGroup()); + } + + /** + * Declares the VNF indicators that are supported by this VNF. + * + * + * + * @return java.util.Map indicator, or null if not present + */ + @Nullable Map getIndicator(); + + /** + * @return java.util.Map indicator, or an empty list if it is not present + */ + default @NonNull Map nonnullIndicator() { + return CodeHelpers.nonnull(getIndicator()); + } + + /** + * Rule that determines when a scaling action needs to be triggered on a VNF + * instance e.g. based on certain VNF indicator values or VNF indicator value + * changes or a combination of VNF indicator value(s) and monitoring parameter(s). + * + * + * + * @return java.util.List autoScale, or null if not present + */ + @Nullable List getAutoScale(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityType.java new file mode 100644 index 0000000..6c04aa7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityType.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type; +import java.lang.Class; +import java.lang.Override; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.FlowPattern; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container connectivity-type {
+ *   leaf-list layer-protocol {
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   leaf flow-pattern {
+ *     type flow-pattern;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/connectivity-type/connectivity-type + * + *

To create instances of this class use {@link ConnectivityTypeBuilder}. + * @see ConnectivityTypeBuilder + * + */ +public interface ConnectivityType + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("connectivity-type"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.ConnectivityType.class; + } + + /** + * Identifies the protocols that the VL uses (Ethernet, MPLS, ODU2, IPV4, IPV6, + * Pseudo-Wire). The top layer protocol of the VL protocol stack shall always be + * provided. The lower layer protocols may be included when there are specific + * requirements on these layers. + * + * + * + * @return java.util.List layerProtocol, or null if not present + */ + @Nullable List> getLayerProtocol(); + + /** + * Identifies the flow pattern of the connectivity (Line, Tree, Mesh). + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.FlowPattern flowPattern, or null if not present + */ + @Nullable FlowPattern getFlowPattern(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityTypeBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityTypeBuilder.java new file mode 100644 index 0000000..56e6d61 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityTypeBuilder.java @@ -0,0 +1,253 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.FlowPattern; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConnectivityTypeBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConnectivityTypeBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConnectivityTypeBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConnectivityTypeBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConnectivityTypeBuilder + * @see Builder + * + */ +public class ConnectivityTypeBuilder implements Builder { + + private FlowPattern _flowPattern; + private List> _layerProtocol; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConnectivityTypeBuilder() { + } + + public ConnectivityTypeBuilder(ConnectivityType base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._flowPattern = base.getFlowPattern(); + this._layerProtocol = base.getLayerProtocol(); + } + + + public FlowPattern getFlowPattern() { + return _flowPattern; + } + + public List> getLayerProtocol() { + return _layerProtocol; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public ConnectivityTypeBuilder setFlowPattern(final FlowPattern value) { + this._flowPattern = value; + return this; + } + public ConnectivityTypeBuilder setLayerProtocol(final List> values) { + this._layerProtocol = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConnectivityTypeBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConnectivityTypeBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConnectivityTypeBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConnectivityTypeBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConnectivityType build() { + return new ConnectivityTypeImpl(this); + } + + private static final class ConnectivityTypeImpl + extends AbstractAugmentable + implements ConnectivityType { + + private final FlowPattern _flowPattern; + private final List> _layerProtocol; + + ConnectivityTypeImpl(ConnectivityTypeBuilder base) { + super(base.augmentation); + this._flowPattern = base.getFlowPattern(); + this._layerProtocol = base.getLayerProtocol(); + } + + @Override + public FlowPattern getFlowPattern() { + return _flowPattern; + } + + @Override + public List> getLayerProtocol() { + return _layerProtocol; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_flowPattern); + result = prime * result + Objects.hashCode(_layerProtocol); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConnectivityType.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConnectivityType other = (ConnectivityType)obj; + if (!Objects.equals(_flowPattern, other.getFlowPattern())) { + return false; + } + if (!Objects.equals(_layerProtocol, other.getLayerProtocol())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConnectivityTypeImpl otherImpl = (ConnectivityTypeImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConnectivityType"); + CodeHelpers.appendValue(helper, "_flowPattern", _flowPattern); + CodeHelpers.appendValue(helper, "_layerProtocol", _layerProtocol); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/Protocol.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/Protocol.java new file mode 100644 index 0000000..a0e01e3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/Protocol.java @@ -0,0 +1,122 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressDataKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies the protocol layering information the CP uses for connectivity + * purposes and associated information. There shall be one cpProtocol for each + * layer protocol as indicated by the attribute layerProtocol. When a PnfExtCpd as + * defined in ETSI GS NFV-IFA 014 [i.8] is inherited from this Cpd, the + * is set to 0. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list protocol {
+ *   key associated-layer-protocol;
+ *   leaf associated-layer-protocol {
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   list address-data {
+ *     key type;
+ *     leaf type {
+ *       type identityref {
+ *         base address-type;
+ *       }
+ *     }
+ *     container l2-address-data {
+ *       when "../type='mac-address'";
+ *       leaf mac-address-assignment {
+ *         type boolean;
+ *       }
+ *     }
+ *     container l3-address-data {
+ *       when "../type='ip-address'";
+ *       leaf ip-address-assignment {
+ *         type boolean;
+ *       }
+ *       leaf floating-ip-activated {
+ *         type boolean;
+ *       }
+ *       leaf ip-address-type {
+ *         type enumeration {
+ *           enum ipv4;
+ *           enum ipv6;
+ *         }
+ *       }
+ *       leaf number-of-ip-addresses {
+ *         type uint32;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol + * + *

To create instances of this class use {@link ProtocolBuilder}. + * @see ProtocolBuilder + * @see ProtocolKey + * + */ +public interface Protocol + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("protocol"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol.class; + } + + /** + * One of the values of the attribute layerProtocol of the Cpd IE. + * + * + * + * @return java.lang.Class associatedLayerProtocol, or null if not present + */ + @Nullable Class getAssociatedLayerProtocol(); + + /** + * Provides information on the addresses to be assigned to the CP(s) instantiated + * from the CPD. + * + * + * + * @return java.util.Map addressData, or null if not present + */ + @Nullable Map getAddressData(); + + /** + * @return java.util.Map addressData, or an empty list if it is not present + */ + default @NonNull Map nonnullAddressData() { + return CodeHelpers.nonnull(getAddressData()); + } + + @Override + ProtocolKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolBuilder.java new file mode 100644 index 0000000..3f66622 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolBuilder.java @@ -0,0 +1,292 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressDataKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ProtocolBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ProtocolBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ProtocolBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ProtocolBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ProtocolBuilder + * @see Builder + * + */ +public class ProtocolBuilder implements Builder { + + private Map _addressData; + private Class _associatedLayerProtocol; + private ProtocolKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ProtocolBuilder() { + } + + public ProtocolBuilder(Protocol base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._associatedLayerProtocol = base.getAssociatedLayerProtocol(); + this._addressData = base.getAddressData(); + } + + + public ProtocolKey key() { + return key; + } + + public Map getAddressData() { + return _addressData; + } + + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ProtocolBuilder withKey(final ProtocolKey key) { + this.key = key; + return this; + } + public ProtocolBuilder setAddressData(final Map values) { + this._addressData = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAddressData(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ProtocolBuilder setAddressData(final List values) { + return setAddressData(CodeHelpers.compatMap(values)); + } + + public ProtocolBuilder setAssociatedLayerProtocol(final Class value) { + this._associatedLayerProtocol = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ProtocolBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ProtocolBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ProtocolBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ProtocolBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Protocol build() { + return new ProtocolImpl(this); + } + + private static final class ProtocolImpl + extends AbstractAugmentable + implements Protocol { + + private final Map _addressData; + private final Class _associatedLayerProtocol; + private final ProtocolKey key; + + ProtocolImpl(ProtocolBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ProtocolKey(base.getAssociatedLayerProtocol()); + } + this._associatedLayerProtocol = key.getAssociatedLayerProtocol(); + this._addressData = CodeHelpers.emptyToNull(base.getAddressData()); + } + + @Override + public ProtocolKey key() { + return key; + } + + @Override + public Map getAddressData() { + return _addressData; + } + + @Override + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_addressData); + result = prime * result + Objects.hashCode(_associatedLayerProtocol); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Protocol.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Protocol other = (Protocol)obj; + if (!Objects.equals(_addressData, other.getAddressData())) { + return false; + } + if (!Objects.equals(_associatedLayerProtocol, other.getAssociatedLayerProtocol())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ProtocolImpl otherImpl = (ProtocolImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Protocol"); + CodeHelpers.appendValue(helper, "_addressData", _addressData); + CodeHelpers.appendValue(helper, "_associatedLayerProtocol", _associatedLayerProtocol); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolKey.java new file mode 100644 index 0000000..649a55f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolKey.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ProtocolKey + implements Identifier { + private static final long serialVersionUID = -7029882376556824581L; + private final Class _associatedLayerProtocol; + + + public ProtocolKey(Class _associatedLayerProtocol) { + + this._associatedLayerProtocol = _associatedLayerProtocol; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ProtocolKey(ProtocolKey source) { + this._associatedLayerProtocol = source._associatedLayerProtocol; + } + + + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_associatedLayerProtocol); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ProtocolKey)) { + return false; + } + final ProtocolKey other = (ProtocolKey) obj; + if (!Objects.equals(_associatedLayerProtocol, other._associatedLayerProtocol)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ProtocolKey.class); + CodeHelpers.appendValue(helper, "_associatedLayerProtocol", _associatedLayerProtocol); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressData.java new file mode 100644 index 0000000..004e339 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressData.java @@ -0,0 +1,111 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AddressType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides information on the addresses to be assigned to the CP(s) instantiated + * from the CPD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list address-data {
+ *   key type;
+ *   leaf type {
+ *     type identityref {
+ *       base address-type;
+ *     }
+ *   }
+ *   container l2-address-data {
+ *     when "../type='mac-address'";
+ *     leaf mac-address-assignment {
+ *       type boolean;
+ *     }
+ *   }
+ *   container l3-address-data {
+ *     when "../type='ip-address'";
+ *     leaf ip-address-assignment {
+ *       type boolean;
+ *     }
+ *     leaf floating-ip-activated {
+ *       type boolean;
+ *     }
+ *     leaf ip-address-type {
+ *       type enumeration {
+ *         enum ipv4;
+ *         enum ipv6;
+ *       }
+ *     }
+ *     leaf number-of-ip-addresses {
+ *       type uint32;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol/address-data + * + *

To create instances of this class use {@link AddressDataBuilder}. + * @see AddressDataBuilder + * @see AddressDataKey + * + */ +public interface AddressData + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("address-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData.class; + } + + /** + * Describes the type of the address to be assigned to the CP instantiated from the + * parent CPD. Value: • MAC address. • IP address. • Etc. The content type shall be + * aligned with the address type supported by the layerProtocol attribute of the + * parent CPD. + * + * + * + * @return java.lang.Class type, or null if not present + */ + @Nullable Class getType(); + + /** + * Provides the information on the MAC addresses to be assigned to the CP(s) + * instantiated from the parent CPD. Shall be present when the addressType is MAC + * address. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData l2AddressData, or null if not present + */ + @Nullable L2AddressData getL2AddressData(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData l3AddressData, or null if not present + */ + @Nullable L3AddressData getL3AddressData(); + + @Override + AddressDataKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataBuilder.java new file mode 100644 index 0000000..82d5805 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataBuilder.java @@ -0,0 +1,297 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AddressType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AddressDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AddressDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AddressDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AddressDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AddressDataBuilder + * @see Builder + * + */ +public class AddressDataBuilder implements Builder { + + private L2AddressData _l2AddressData; + private L3AddressData _l3AddressData; + private Class _type; + private AddressDataKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AddressDataBuilder() { + } + + public AddressDataBuilder(AddressData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._type = base.getType(); + this._l2AddressData = base.getL2AddressData(); + this._l3AddressData = base.getL3AddressData(); + } + + + public AddressDataKey key() { + return key; + } + + public L2AddressData getL2AddressData() { + return _l2AddressData; + } + + public L3AddressData getL3AddressData() { + return _l3AddressData; + } + + public Class getType() { + return _type; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AddressDataBuilder withKey(final AddressDataKey key) { + this.key = key; + return this; + } + + public AddressDataBuilder setL2AddressData(final L2AddressData value) { + this._l2AddressData = value; + return this; + } + + public AddressDataBuilder setL3AddressData(final L3AddressData value) { + this._l3AddressData = value; + return this; + } + + public AddressDataBuilder setType(final Class value) { + this._type = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AddressDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AddressDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AddressDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AddressDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AddressData build() { + return new AddressDataImpl(this); + } + + private static final class AddressDataImpl + extends AbstractAugmentable + implements AddressData { + + private final L2AddressData _l2AddressData; + private final L3AddressData _l3AddressData; + private final Class _type; + private final AddressDataKey key; + + AddressDataImpl(AddressDataBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AddressDataKey(base.getType()); + } + this._type = key.getType(); + this._l2AddressData = base.getL2AddressData(); + this._l3AddressData = base.getL3AddressData(); + } + + @Override + public AddressDataKey key() { + return key; + } + + @Override + public L2AddressData getL2AddressData() { + return _l2AddressData; + } + + @Override + public L3AddressData getL3AddressData() { + return _l3AddressData; + } + + @Override + public Class getType() { + return _type; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_l2AddressData); + result = prime * result + Objects.hashCode(_l3AddressData); + result = prime * result + Objects.hashCode(_type); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AddressData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AddressData other = (AddressData)obj; + if (!Objects.equals(_l2AddressData, other.getL2AddressData())) { + return false; + } + if (!Objects.equals(_l3AddressData, other.getL3AddressData())) { + return false; + } + if (!Objects.equals(_type, other.getType())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AddressDataImpl otherImpl = (AddressDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AddressData"); + CodeHelpers.appendValue(helper, "_l2AddressData", _l2AddressData); + CodeHelpers.appendValue(helper, "_l3AddressData", _l3AddressData); + CodeHelpers.appendValue(helper, "_type", _type); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataKey.java new file mode 100644 index 0000000..67327af --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataKey.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AddressType; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AddressDataKey + implements Identifier { + private static final long serialVersionUID = 8153895744830229393L; + private final Class _type; + + + public AddressDataKey(Class _type) { + + this._type = _type; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AddressDataKey(AddressDataKey source) { + this._type = source._type; + } + + + public Class getType() { + return _type; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_type); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AddressDataKey)) { + return false; + } + final AddressDataKey other = (AddressDataKey) obj; + if (!Objects.equals(_type, other._type)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AddressDataKey.class); + CodeHelpers.appendValue(helper, "_type", _type); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressData.java new file mode 100644 index 0000000..d74bde3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressData.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the information on the MAC addresses to be assigned to the CP(s) + * instantiated from the parent CPD. Shall be present when the addressType is MAC + * address. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container l2-address-data {
+ *   when "../type='mac-address'";
+ *   leaf mac-address-assignment {
+ *     type boolean;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol/address-data/l2-address-data + * + *

To create instances of this class use {@link L2AddressDataBuilder}. + * @see L2AddressDataBuilder + * + */ +public interface L2AddressData + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l2-address-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData.class; + } + + /** + * Specify if the MAC address assignment is the responsibility of management and + * orchestration function or not. If it is set to True, it is the management and + * orchestration function responsibility. If it is set to False, it will be + * provided by an external entity, e.g. OSS/BSS. + * + * + * + * @return java.lang.Boolean macAddressAssignment, or null if not present + */ + @Nullable Boolean isMacAddressAssignment(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressDataBuilder.java new file mode 100644 index 0000000..be27914 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressDataBuilder.java @@ -0,0 +1,228 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link L2AddressDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L2AddressDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L2AddressDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L2AddressDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L2AddressDataBuilder + * @see Builder + * + */ +public class L2AddressDataBuilder implements Builder { + + private Boolean _macAddressAssignment; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L2AddressDataBuilder() { + } + + public L2AddressDataBuilder(L2AddressData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._macAddressAssignment = base.isMacAddressAssignment(); + } + + + public Boolean isMacAddressAssignment() { + return _macAddressAssignment; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L2AddressDataBuilder setMacAddressAssignment(final Boolean value) { + this._macAddressAssignment = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L2AddressDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L2AddressDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L2AddressDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L2AddressDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L2AddressData build() { + return new L2AddressDataImpl(this); + } + + private static final class L2AddressDataImpl + extends AbstractAugmentable + implements L2AddressData { + + private final Boolean _macAddressAssignment; + + L2AddressDataImpl(L2AddressDataBuilder base) { + super(base.augmentation); + this._macAddressAssignment = base.isMacAddressAssignment(); + } + + @Override + public Boolean isMacAddressAssignment() { + return _macAddressAssignment; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_macAddressAssignment); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L2AddressData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L2AddressData other = (L2AddressData)obj; + if (!Objects.equals(_macAddressAssignment, other.isMacAddressAssignment())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L2AddressDataImpl otherImpl = (L2AddressDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L2AddressData"); + CodeHelpers.appendValue(helper, "_macAddressAssignment", _macAddressAssignment); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressData.java new file mode 100644 index 0000000..64cf61e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressData.java @@ -0,0 +1,168 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container l3-address-data {
+ *   when "../type='ip-address'";
+ *   leaf ip-address-assignment {
+ *     type boolean;
+ *   }
+ *   leaf floating-ip-activated {
+ *     type boolean;
+ *   }
+ *   leaf ip-address-type {
+ *     type enumeration {
+ *       enum ipv4;
+ *       enum ipv6;
+ *     }
+ *   }
+ *   leaf number-of-ip-addresses {
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol/address-data/l3-address-data + * + *

To create instances of this class use {@link L3AddressDataBuilder}. + * @see L3AddressDataBuilder + * + */ +public interface L3AddressData + extends + ChildOf, + Augmentable +{ + + + public enum IpAddressType implements Enumeration { + Ipv4(0, "ipv4"), + + Ipv6(1, "ipv6") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (IpAddressType enumItem : IpAddressType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private IpAddressType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding IpAddressType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding IpAddressType item, or null if no such item exists + */ + public static IpAddressType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l3-address-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData.class; + } + + /** + * Specify if the address assignment is the responsibility of management and + * orchestration function or not. If it is set to True, it is the management and + * orchestration function responsibility. + * + * + * + * @return java.lang.Boolean ipAddressAssignment, or null if not present + */ + @Nullable Boolean isIpAddressAssignment(); + + /** + * Specify if the floating IP scheme is activated on the CP or not. + * + * + * + * @return java.lang.Boolean floatingIpActivated, or null if not present + */ + @Nullable Boolean isFloatingIpActivated(); + + /** + * Define address type. The address type should be aligned with the address type + * supported by the layerProtocol attribute of the parent VnfExtCpd. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData.IpAddressType ipAddressType, or null if not present + */ + @Nullable IpAddressType getIpAddressType(); + + /** + * Minimum number of IP addresses to be assigned based on this L3AddressData + * information element. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 numberOfIpAddresses, or null if not present + */ + @Nullable Uint32 getNumberOfIpAddresses(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressDataBuilder.java new file mode 100644 index 0000000..cad0243 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressDataBuilder.java @@ -0,0 +1,311 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link L3AddressDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L3AddressDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L3AddressDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L3AddressDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L3AddressDataBuilder + * @see Builder + * + */ +public class L3AddressDataBuilder implements Builder { + + private L3AddressData.IpAddressType _ipAddressType; + private Uint32 _numberOfIpAddresses; + private Boolean _floatingIpActivated; + private Boolean _ipAddressAssignment; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L3AddressDataBuilder() { + } + + public L3AddressDataBuilder(L3AddressData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._ipAddressType = base.getIpAddressType(); + this._numberOfIpAddresses = base.getNumberOfIpAddresses(); + this._floatingIpActivated = base.isFloatingIpActivated(); + this._ipAddressAssignment = base.isIpAddressAssignment(); + } + + + public L3AddressData.IpAddressType getIpAddressType() { + return _ipAddressType; + } + + public Uint32 getNumberOfIpAddresses() { + return _numberOfIpAddresses; + } + + public Boolean isFloatingIpActivated() { + return _floatingIpActivated; + } + + public Boolean isIpAddressAssignment() { + return _ipAddressAssignment; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L3AddressDataBuilder setIpAddressType(final L3AddressData.IpAddressType value) { + this._ipAddressType = value; + return this; + } + + public L3AddressDataBuilder setNumberOfIpAddresses(final Uint32 value) { + this._numberOfIpAddresses = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumberOfIpAddresses(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public L3AddressDataBuilder setNumberOfIpAddresses(final Long value) { + return setNumberOfIpAddresses(CodeHelpers.compatUint(value)); + } + + public L3AddressDataBuilder setFloatingIpActivated(final Boolean value) { + this._floatingIpActivated = value; + return this; + } + + public L3AddressDataBuilder setIpAddressAssignment(final Boolean value) { + this._ipAddressAssignment = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L3AddressDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L3AddressDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L3AddressDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L3AddressDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L3AddressData build() { + return new L3AddressDataImpl(this); + } + + private static final class L3AddressDataImpl + extends AbstractAugmentable + implements L3AddressData { + + private final L3AddressData.IpAddressType _ipAddressType; + private final Uint32 _numberOfIpAddresses; + private final Boolean _floatingIpActivated; + private final Boolean _ipAddressAssignment; + + L3AddressDataImpl(L3AddressDataBuilder base) { + super(base.augmentation); + this._ipAddressType = base.getIpAddressType(); + this._numberOfIpAddresses = base.getNumberOfIpAddresses(); + this._floatingIpActivated = base.isFloatingIpActivated(); + this._ipAddressAssignment = base.isIpAddressAssignment(); + } + + @Override + public L3AddressData.IpAddressType getIpAddressType() { + return _ipAddressType; + } + + @Override + public Uint32 getNumberOfIpAddresses() { + return _numberOfIpAddresses; + } + + @Override + public Boolean isFloatingIpActivated() { + return _floatingIpActivated; + } + + @Override + public Boolean isIpAddressAssignment() { + return _ipAddressAssignment; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_ipAddressType); + result = prime * result + Objects.hashCode(_numberOfIpAddresses); + result = prime * result + Objects.hashCode(_floatingIpActivated); + result = prime * result + Objects.hashCode(_ipAddressAssignment); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L3AddressData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L3AddressData other = (L3AddressData)obj; + if (!Objects.equals(_ipAddressType, other.getIpAddressType())) { + return false; + } + if (!Objects.equals(_numberOfIpAddresses, other.getNumberOfIpAddresses())) { + return false; + } + if (!Objects.equals(_floatingIpActivated, other.isFloatingIpActivated())) { + return false; + } + if (!Objects.equals(_ipAddressAssignment, other.isIpAddressAssignment())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L3AddressDataImpl otherImpl = (L3AddressDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L3AddressData"); + CodeHelpers.appendValue(helper, "_ipAddressType", _ipAddressType); + CodeHelpers.appendValue(helper, "_numberOfIpAddresses", _numberOfIpAddresses); + CodeHelpers.appendValue(helper, "_floatingIpActivated", _floatingIpActivated); + CodeHelpers.appendValue(helper, "_ipAddressAssignment", _ipAddressAssignment); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRule.java new file mode 100644 index 0000000..a2f27c7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRule.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list local-affinity-or-anti-affinity-rule {
+ *   key "affinity-type affinity-scope";
+ *   leaf affinity-type {
+ *     type affinity-type;
+ *   }
+ *   leaf affinity-scope {
+ *     type affinity-scope;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/local-affinity-or-anti-affinity-rule/local-affinity-or-anti-affinity-rule + * + *

To create instances of this class use {@link LocalAffinityOrAntiAffinityRuleBuilder}. + * @see LocalAffinityOrAntiAffinityRuleBuilder + * @see LocalAffinityOrAntiAffinityRuleKey + * + */ +public interface LocalAffinityOrAntiAffinityRule + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("local-affinity-or-anti-affinity-rule"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRule.class; + } + + /** + * Specifies whether the rule is an affinity rule or an anti-affinity rule. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType affinityType, or null if not present + */ + @Nullable AffinityType getAffinityType(); + + /** + * Specifies the scope of the rule, possible values are 'NFVI-PoP', 'Zone', + * 'ZoneGroup', 'NFVI-node'. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope affinityScope, or null if not present + */ + @Nullable AffinityScope getAffinityScope(); + + @Override + LocalAffinityOrAntiAffinityRuleKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleBuilder.java new file mode 100644 index 0000000..66b71c1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleBuilder.java @@ -0,0 +1,276 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link LocalAffinityOrAntiAffinityRuleBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     LocalAffinityOrAntiAffinityRuleBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new LocalAffinityOrAntiAffinityRuleBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of LocalAffinityOrAntiAffinityRuleBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see LocalAffinityOrAntiAffinityRuleBuilder + * @see Builder + * + */ +public class LocalAffinityOrAntiAffinityRuleBuilder implements Builder { + + private AffinityScope _affinityScope; + private AffinityType _affinityType; + private LocalAffinityOrAntiAffinityRuleKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public LocalAffinityOrAntiAffinityRuleBuilder() { + } + + public LocalAffinityOrAntiAffinityRuleBuilder(LocalAffinityOrAntiAffinityRule base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._affinityScope = base.getAffinityScope(); + this._affinityType = base.getAffinityType(); + } + + + public LocalAffinityOrAntiAffinityRuleKey key() { + return key; + } + + public AffinityScope getAffinityScope() { + return _affinityScope; + } + + public AffinityType getAffinityType() { + return _affinityType; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public LocalAffinityOrAntiAffinityRuleBuilder withKey(final LocalAffinityOrAntiAffinityRuleKey key) { + this.key = key; + return this; + } + + public LocalAffinityOrAntiAffinityRuleBuilder setAffinityScope(final AffinityScope value) { + this._affinityScope = value; + return this; + } + + public LocalAffinityOrAntiAffinityRuleBuilder setAffinityType(final AffinityType value) { + this._affinityType = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public LocalAffinityOrAntiAffinityRuleBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public LocalAffinityOrAntiAffinityRuleBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public LocalAffinityOrAntiAffinityRuleBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private LocalAffinityOrAntiAffinityRuleBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public LocalAffinityOrAntiAffinityRule build() { + return new LocalAffinityOrAntiAffinityRuleImpl(this); + } + + private static final class LocalAffinityOrAntiAffinityRuleImpl + extends AbstractAugmentable + implements LocalAffinityOrAntiAffinityRule { + + private final AffinityScope _affinityScope; + private final AffinityType _affinityType; + private final LocalAffinityOrAntiAffinityRuleKey key; + + LocalAffinityOrAntiAffinityRuleImpl(LocalAffinityOrAntiAffinityRuleBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new LocalAffinityOrAntiAffinityRuleKey(base.getAffinityScope(), base.getAffinityType()); + } + this._affinityScope = key.getAffinityScope(); + this._affinityType = key.getAffinityType(); + } + + public LocalAffinityOrAntiAffinityRuleImpl() { + this( new LocalAffinityOrAntiAffinityRuleBuilder()); + } + @Override + public LocalAffinityOrAntiAffinityRuleKey key() { + return key; + } + + @Override + public AffinityScope getAffinityScope() { + return _affinityScope; + } + + @Override + public AffinityType getAffinityType() { + return _affinityType; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityScope); + result = prime * result + Objects.hashCode(_affinityType); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!LocalAffinityOrAntiAffinityRule.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + LocalAffinityOrAntiAffinityRule other = (LocalAffinityOrAntiAffinityRule)obj; + if (!Objects.equals(_affinityScope, other.getAffinityScope())) { + return false; + } + if (!Objects.equals(_affinityType, other.getAffinityType())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + LocalAffinityOrAntiAffinityRuleImpl otherImpl = (LocalAffinityOrAntiAffinityRuleImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LocalAffinityOrAntiAffinityRule"); + CodeHelpers.appendValue(helper, "_affinityScope", _affinityScope); + CodeHelpers.appendValue(helper, "_affinityType", _affinityType); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleKey.java new file mode 100644 index 0000000..a61afd7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleKey.java @@ -0,0 +1,94 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.KeyDeserializer; +import com.google.common.base.MoreObjects; + +import java.io.IOException; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class LocalAffinityOrAntiAffinityRuleKey extends KeyDeserializer + implements Identifier { + private static final long serialVersionUID = -2457432228320345751L; + private final AffinityType _affinityType; + private final AffinityScope _affinityScope; + + + public LocalAffinityOrAntiAffinityRuleKey() { + this._affinityType = null; + this._affinityScope = null; + } + + public LocalAffinityOrAntiAffinityRuleKey(AffinityScope _affinityScope, AffinityType _affinityType) { + + this._affinityType = _affinityType; + this._affinityScope = _affinityScope; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public LocalAffinityOrAntiAffinityRuleKey(LocalAffinityOrAntiAffinityRuleKey source) { + this._affinityType = source._affinityType; + this._affinityScope = source._affinityScope; + } + + + public AffinityType getAffinityType() { + return _affinityType; + } + + public AffinityScope getAffinityScope() { + return _affinityScope; + } + + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityType); + result = prime * result + Objects.hashCode(_affinityScope); + return result; + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LocalAffinityOrAntiAffinityRuleKey)) { + return false; + } + final LocalAffinityOrAntiAffinityRuleKey other = (LocalAffinityOrAntiAffinityRuleKey) obj; + if (!Objects.equals(_affinityType, other._affinityType)) { + return false; + } + if (!Objects.equals(_affinityScope, other._affinityScope)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(LocalAffinityOrAntiAffinityRuleKey.class); + CodeHelpers.appendValue(helper, "_affinityType", _affinityType); + CodeHelpers.appendValue(helper, "_affinityScope", _affinityScope); + return helper.toString(); + } + + @Override + public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException { + // TODO Auto-generated method stub + return this.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Nsd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Nsd.java new file mode 100644 index 0000000..215f675 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Nsd.java @@ -0,0 +1,52 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The NSD information element is a deployment template whose instances are used + * the NFVO for the lifecycle management of NSs. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list nsd {
+ *   key id;
+ *   uses nsd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv/nsd + * + *

To create instances of this class use {@link NsdBuilder}. + * @see NsdBuilder + * @see NsdKey + * + */ +public interface Nsd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nsd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Nsd.class; + } + + @Override + NsdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdBuilder.java new file mode 100644 index 0000000..82b08f0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdBuilder.java @@ -0,0 +1,790 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.SapdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VnffgdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsdBuilder + * @see Builder + * + */ +public class NsdBuilder implements Builder { + + private String _algorithm; + private List _autoscaleRule; + private String _certificate; + private String _designer; + private Map _df; + private String _id; + private String _invariantId; + private Map _lifecycleManagementScript; + private String _name; + private List _nestedNsdId; + private List _pnfdId; + private Map _sapd; + private String _signature; + private String _version; + private Map _virtualLinkDesc; + private List _vnfdId; + private Map _vnffgd; + private NsdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsdBuilder() { + } + public NsdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd arg) { + this._id = arg.getId(); + this._designer = arg.getDesigner(); + this._version = arg.getVersion(); + this._name = arg.getName(); + this._invariantId = arg.getInvariantId(); + this._nestedNsdId = arg.getNestedNsdId(); + this._vnfdId = arg.getVnfdId(); + this._pnfdId = arg.getPnfdId(); + this._sapd = arg.getSapd(); + this._virtualLinkDesc = arg.getVirtualLinkDesc(); + this._vnffgd = arg.getVnffgd(); + this._autoscaleRule = arg.getAutoscaleRule(); + this._lifecycleManagementScript = arg.getLifecycleManagementScript(); + this._df = arg.getDf(); + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + public NsdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters arg) { + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + + public NsdBuilder(Nsd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._algorithm = base.getAlgorithm(); + this._autoscaleRule = base.getAutoscaleRule(); + this._certificate = base.getCertificate(); + this._designer = base.getDesigner(); + this._df = base.getDf(); + this._invariantId = base.getInvariantId(); + this._lifecycleManagementScript = base.getLifecycleManagementScript(); + this._name = base.getName(); + this._nestedNsdId = base.getNestedNsdId(); + this._pnfdId = base.getPnfdId(); + this._sapd = base.getSapd(); + this._signature = base.getSignature(); + this._version = base.getVersion(); + this._virtualLinkDesc = base.getVirtualLinkDesc(); + this._vnfdId = base.getVnfdId(); + this._vnffgd = base.getVnffgd(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getId(); + this._designer = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getDesigner(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVersion(); + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getName(); + this._invariantId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getInvariantId(); + this._nestedNsdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getNestedNsdId(); + this._vnfdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVnfdId(); + this._pnfdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getPnfdId(); + this._sapd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getSapd(); + this._virtualLinkDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVirtualLinkDesc(); + this._vnffgd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVnffgd(); + this._autoscaleRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getAutoscaleRule(); + this._lifecycleManagementScript = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getLifecycleManagementScript(); + this._df = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getDf(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters) { + this._signature = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getSignature(); + this._algorithm = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getAlgorithm(); + this._certificate = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getCertificate(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters]"); + } + + public NsdKey key() { + return key; + } + + public String getAlgorithm() { + return _algorithm; + } + + public List getAutoscaleRule() { + return _autoscaleRule; + } + + public String getCertificate() { + return _certificate; + } + + public String getDesigner() { + return _designer; + } + + public Map getDf() { + return _df; + } + + public String getId() { + return _id; + } + + public String getInvariantId() { + return _invariantId; + } + + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + public String getName() { + return _name; + } + + public List getNestedNsdId() { + return _nestedNsdId; + } + + public List getPnfdId() { + return _pnfdId; + } + + public Map getSapd() { + return _sapd; + } + + public String getSignature() { + return _signature; + } + + public String getVersion() { + return _version; + } + + public Map getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + public List getVnfdId() { + return _vnfdId; + } + + public Map getVnffgd() { + return _vnffgd; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsdBuilder withKey(final NsdKey key) { + this.key = key; + return this; + } + + public NsdBuilder setAlgorithm(final String value) { + this._algorithm = value; + return this; + } + public NsdBuilder setAutoscaleRule(final List values) { + this._autoscaleRule = values; + return this; + } + + + public NsdBuilder setCertificate(final String value) { + this._certificate = value; + return this; + } + + public NsdBuilder setDesigner(final String value) { + this._designer = value; + return this; + } + public NsdBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public NsdBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setId(final String value) { + this._id = value; + return this; + } + + public NsdBuilder setInvariantId(final String value) { + this._invariantId = value; + return this; + } + public NsdBuilder setLifecycleManagementScript(final Map values) { + this._lifecycleManagementScript = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLifecycleManagementScript(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public NsdBuilder setLifecycleManagementScript(final List values) { + return setLifecycleManagementScript(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setName(final String value) { + this._name = value; + return this; + } + public NsdBuilder setNestedNsdId(final List values) { + this._nestedNsdId = values; + return this; + } + + public NsdBuilder setPnfdId(final List values) { + this._pnfdId = values; + return this; + } + + public NsdBuilder setSapd(final Map values) { + this._sapd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSapd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setSapd(final List values) { + return setSapd(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setSignature(final String value) { + this._signature = value; + return this; + } + + public NsdBuilder setVersion(final String value) { + this._version = value; + return this; + } + public NsdBuilder setVirtualLinkDesc(final Map values) { + this._virtualLinkDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setVirtualLinkDesc(final List values) { + return setVirtualLinkDesc(CodeHelpers.compatMap(values)); + } + public NsdBuilder setVnfdId(final List values) { + this._vnfdId = values; + return this; + } + + public NsdBuilder setVnffgd(final Map values) { + this._vnffgd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnffgd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setVnffgd(final List values) { + return setVnffgd(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nsd build() { + return new NsdImpl(this); + } + + public static final class NsdImpl + extends AbstractAugmentable + implements Nsd { + + private final String _algorithm; + private final List _autoscaleRule; + private final String _certificate; + private final String _designer; + private Map _df; + @JsonProperty("id") + private final String _id; + @JsonProperty("_id") + private final String _invariantId; + private final Map _lifecycleManagementScript; + @JsonProperty("name") + private final String _name; + private final List _nestedNsdId; + private final List _pnfdId; + private final Map _sapd; + private final String _signature; + @JsonProperty("version") + private final String _version; + private final Map _virtualLinkDesc; + @JsonProperty("vnfd-id") + private final List _vnfdId; + private final Map _vnffgd; + private final NsdKey key; + + NsdImpl(NsdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsdKey(base.getId()); + } + this._id = key.getId(); + this._algorithm = base.getAlgorithm(); + this._autoscaleRule = base.getAutoscaleRule(); + this._certificate = base.getCertificate(); + this._designer = base.getDesigner(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._invariantId = base.getInvariantId(); + this._lifecycleManagementScript = CodeHelpers.emptyToNull(base.getLifecycleManagementScript()); + this._name = base.getName(); + this._nestedNsdId = base.getNestedNsdId(); + this._pnfdId = base.getPnfdId(); + this._sapd = CodeHelpers.emptyToNull(base.getSapd()); + this._signature = base.getSignature(); + this._version = base.getVersion(); + this._virtualLinkDesc = CodeHelpers.emptyToNull(base.getVirtualLinkDesc()); + this._vnfdId = base.getVnfdId(); + this._vnffgd = CodeHelpers.emptyToNull(base.getVnffgd()); + } + + public NsdImpl(){ + this( new NsdBuilder() ); + } + + @Override + public NsdKey key() { + return key; + } + + @Override + public String getAlgorithm() { + return _algorithm; + } + + @Override + public List getAutoscaleRule() { + return _autoscaleRule; + } + + @Override + public String getCertificate() { + return _certificate; + } + + @Override + public String getDesigner() { + return _designer; + } + + public Map setDf(final List values) { + return _df = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInvariantId() { + return _invariantId; + } + + @Override + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + @Override + public String getName() { + return _name; + } + + @Override + public List getNestedNsdId() { + return _nestedNsdId; + } + + @Override + public List getPnfdId() { + return _pnfdId; + } + + @Override + public Map getSapd() { + return _sapd; + } + + @Override + public String getSignature() { + return _signature; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public Map getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + @Override + public List getVnfdId() { + return _vnfdId; + } + + @Override + public Map getVnffgd() { + return _vnffgd; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_algorithm); + result = prime * result + Objects.hashCode(_autoscaleRule); + result = prime * result + Objects.hashCode(_certificate); + result = prime * result + Objects.hashCode(_designer); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_invariantId); + result = prime * result + Objects.hashCode(_lifecycleManagementScript); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_nestedNsdId); + result = prime * result + Objects.hashCode(_pnfdId); + result = prime * result + Objects.hashCode(_sapd); + result = prime * result + Objects.hashCode(_signature); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(_virtualLinkDesc); + result = prime * result + Objects.hashCode(_vnfdId); + result = prime * result + Objects.hashCode(_vnffgd); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nsd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nsd other = (Nsd)obj; + if (!Objects.equals(_algorithm, other.getAlgorithm())) { + return false; + } + if (!Objects.equals(_autoscaleRule, other.getAutoscaleRule())) { + return false; + } + if (!Objects.equals(_certificate, other.getCertificate())) { + return false; + } + if (!Objects.equals(_designer, other.getDesigner())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_invariantId, other.getInvariantId())) { + return false; + } + if (!Objects.equals(_lifecycleManagementScript, other.getLifecycleManagementScript())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_nestedNsdId, other.getNestedNsdId())) { + return false; + } + if (!Objects.equals(_pnfdId, other.getPnfdId())) { + return false; + } + if (!Objects.equals(_sapd, other.getSapd())) { + return false; + } + if (!Objects.equals(_signature, other.getSignature())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (!Objects.equals(_virtualLinkDesc, other.getVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_vnfdId, other.getVnfdId())) { + return false; + } + if (!Objects.equals(_vnffgd, other.getVnffgd())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsdImpl otherImpl = (NsdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nsd"); + CodeHelpers.appendValue(helper, "_algorithm", _algorithm); + CodeHelpers.appendValue(helper, "_autoscaleRule", _autoscaleRule); + CodeHelpers.appendValue(helper, "_certificate", _certificate); + CodeHelpers.appendValue(helper, "_designer", _designer); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_invariantId", _invariantId); + CodeHelpers.appendValue(helper, "_lifecycleManagementScript", _lifecycleManagementScript); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_nestedNsdId", _nestedNsdId); + CodeHelpers.appendValue(helper, "_pnfdId", _pnfdId); + CodeHelpers.appendValue(helper, "_sapd", _sapd); + CodeHelpers.appendValue(helper, "_signature", _signature); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "_virtualLinkDesc", _virtualLinkDesc); + CodeHelpers.appendValue(helper, "_vnfdId", _vnfdId); + CodeHelpers.appendValue(helper, "_vnffgd", _vnffgd); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdKey.java new file mode 100644 index 0000000..06a1f06 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsdKey + implements Identifier { + private static final long serialVersionUID = 8060294317279421094L; + private final String _id; + + + public NsdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsdKey(NsdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsdKey)) { + return false; + } + final NsdKey other = (NsdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Pnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Pnfd.java new file mode 100644 index 0000000..9cb3d8a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Pnfd.java @@ -0,0 +1,52 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list pnfd {
+ *   key id;
+ *   uses pnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv/pnfd + * + *

To create instances of this class use {@link PnfdBuilder}. + * @see PnfdBuilder + * @see PnfdKey + * + */ +public interface Pnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Pnfd.class; + } + + @Override + PnfdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdBuilder.java new file mode 100644 index 0000000..ed925be --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdBuilder.java @@ -0,0 +1,561 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.Security; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.SecurityKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfdBuilder + * @see Builder + * + */ +public class PnfdBuilder implements Builder { + + private Map _extCpd; + private String _functionDescription; + private String _geographicalLocationInfo; + private String _id; + private String _invariantId; + private String _name; + private String _provider; + private Map _security; + private Map _securityGroupRule; + private String _version; + private PnfdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfdBuilder() { + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd arg) { + this._id = arg.getId(); + this._functionDescription = arg.getFunctionDescription(); + this._provider = arg.getProvider(); + this._version = arg.getVersion(); + this._invariantId = arg.getInvariantId(); + this._name = arg.getName(); + this._extCpd = arg.getExtCpd(); + this._security = arg.getSecurity(); + this._geographicalLocationInfo = arg.getGeographicalLocationInfo(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public PnfdBuilder(Pnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._extCpd = base.getExtCpd(); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = base.getSecurity(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._version = base.getVersion(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getId(); + this._functionDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getFunctionDescription(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getProvider(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getVersion(); + this._invariantId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getInvariantId(); + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getName(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getExtCpd(); + this._security = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getSecurity(); + this._geographicalLocationInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getGeographicalLocationInfo(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd]"); + } + + public PnfdKey key() { + return key; + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getFunctionDescription() { + return _functionDescription; + } + + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + public String getId() { + return _id; + } + + public String getInvariantId() { + return _invariantId; + } + + public String getName() { + return _name; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurity() { + return _security; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getVersion() { + return _version; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PnfdBuilder withKey(final PnfdKey key) { + this.key = key; + return this; + } + public PnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public PnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setFunctionDescription(final String value) { + this._functionDescription = value; + return this; + } + + public PnfdBuilder setGeographicalLocationInfo(final String value) { + this._geographicalLocationInfo = value; + return this; + } + + public PnfdBuilder setId(final String value) { + this._id = value; + return this; + } + + public PnfdBuilder setInvariantId(final String value) { + this._invariantId = value; + return this; + } + + public PnfdBuilder setName(final String value) { + this._name = value; + return this; + } + + public PnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public PnfdBuilder setSecurity(final Map values) { + this._security = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setSecurity(final List values) { + return setSecurity(CodeHelpers.compatMap(values)); + } + public PnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public PnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnfd build() { + return new PnfdImpl(this); + } + + private static final class PnfdImpl + extends AbstractAugmentable + implements Pnfd { + + private final Map _extCpd; + private final String _functionDescription; + private final String _geographicalLocationInfo; + private final String _id; + private final String _invariantId; + private final String _name; + private final String _provider; + private final Map _security; + private final Map _securityGroupRule; + private final String _version; + private final PnfdKey key; + + PnfdImpl(PnfdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new PnfdKey(base.getId()); + } + this._id = key.getId(); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = CodeHelpers.emptyToNull(base.getSecurity()); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._version = base.getVersion(); + } + + @Override + public PnfdKey key() { + return key; + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getFunctionDescription() { + return _functionDescription; + } + + @Override + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInvariantId() { + return _invariantId; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurity() { + return _security; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getVersion() { + return _version; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_functionDescription); + result = prime * result + Objects.hashCode(_geographicalLocationInfo); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_invariantId); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_security); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnfd other = (Pnfd)obj; + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_functionDescription, other.getFunctionDescription())) { + return false; + } + if (!Objects.equals(_geographicalLocationInfo, other.getGeographicalLocationInfo())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_invariantId, other.getInvariantId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_security, other.getSecurity())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfdImpl otherImpl = (PnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnfd"); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_functionDescription", _functionDescription); + CodeHelpers.appendValue(helper, "_geographicalLocationInfo", _geographicalLocationInfo); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_invariantId", _invariantId); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_security", _security); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdKey.java new file mode 100644 index 0000000..14e61d3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class PnfdKey + implements Identifier { + private static final long serialVersionUID = -6839690951618085740L; + private final String _id; + + + public PnfdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public PnfdKey(PnfdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof PnfdKey)) { + return false; + } + final PnfdKey other = (PnfdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(PnfdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Vnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Vnfd.java new file mode 100644 index 0000000..6135999 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Vnfd.java @@ -0,0 +1,57 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder.VnfdImpl; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * A VNF Descriptor (VNFD) is a deployment template which describes a VNF in terms + * of deployment and operational behaviour requirements. It also contains + * connectivity, interface and virtualised resource requirements + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vnfd {
+ *   key id;
+ *   uses vnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv/vnfd + * + *

To create instances of this class use {@link VnfdBuilder}. + * @see VnfdBuilder + * @see VnfdKey + * + */ +public interface Vnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd.class; + } + + @Override + VnfdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdBuilder.java new file mode 100644 index 0000000..d173c36 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdBuilder.java @@ -0,0 +1,1096 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfdBuilder + * @see Builder + * + */ +public class VnfdBuilder implements Builder { + + private List _autoScale; + private ConfigurableProperties _configurableProperties; + private String _defaultLocalizationLanguage; + private Map _df; + private Map _elementGroup; + private Map _extCpd; + private String _id; + private Map _indicator; + private Map _intVirtualLinkDesc; + private Map _lifecycleManagementScript; + private String _localizationLanguage; + private ModifiableAttributes _modifiableAttributes; + private String _productInfoDescription; + private String _productInfoName; + private String _productName; + private String _provider; + private Map _securityGroupRule; + private String _softwareVersion; + private Map _swImageDesc; + private Map _vdu; + private String _version; + private Map _virtualComputeDesc; + private Map _virtualStorageDesc; + private List _vnfmInfo; + private VnfdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfdBuilder() { + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd arg) { + this._id = arg.getId(); + this._provider = arg.getProvider(); + this._productName = arg.getProductName(); + this._softwareVersion = arg.getSoftwareVersion(); + this._version = arg.getVersion(); + this._productInfoName = arg.getProductInfoName(); + this._productInfoDescription = arg.getProductInfoDescription(); + this._vnfmInfo = arg.getVnfmInfo(); + this._localizationLanguage = arg.getLocalizationLanguage(); + this._defaultLocalizationLanguage = arg.getDefaultLocalizationLanguage(); + this._vdu = arg.getVdu(); + this._virtualComputeDesc = arg.getVirtualComputeDesc(); + this._virtualStorageDesc = arg.getVirtualStorageDesc(); + this._swImageDesc = arg.getSwImageDesc(); + this._intVirtualLinkDesc = arg.getIntVirtualLinkDesc(); + this._extCpd = arg.getExtCpd(); + this._df = arg.getDf(); + this._configurableProperties = arg.getConfigurableProperties(); + this._modifiableAttributes = arg.getModifiableAttributes(); + this._lifecycleManagementScript = arg.getLifecycleManagementScript(); + this._elementGroup = arg.getElementGroup(); + this._indicator = arg.getIndicator(); + this._autoScale = arg.getAutoScale(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public VnfdBuilder(Vnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = base.getDf(); + this._elementGroup = base.getElementGroup(); + this._extCpd = base.getExtCpd(); + this._indicator = base.getIndicator(); + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + this._lifecycleManagementScript = base.getLifecycleManagementScript(); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = base.getSwImageDesc(); + this._vdu = base.getVdu(); + this._version = base.getVersion(); + this._virtualComputeDesc = base.getVirtualComputeDesc(); + this._virtualStorageDesc = base.getVirtualStorageDesc(); + this._vnfmInfo = base.getVnfmInfo(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getId(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProvider(); + this._productName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductName(); + this._softwareVersion = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSoftwareVersion(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVersion(); + this._productInfoName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoName(); + this._productInfoDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoDescription(); + this._vnfmInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVnfmInfo(); + this._localizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLocalizationLanguage(); + this._defaultLocalizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDefaultLocalizationLanguage(); + this._vdu = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVdu(); + this._virtualComputeDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualComputeDesc(); + this._virtualStorageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualStorageDesc(); + this._swImageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSwImageDesc(); + this._intVirtualLinkDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIntVirtualLinkDesc(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getExtCpd(); + this._df = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDf(); + this._configurableProperties = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getConfigurableProperties(); + this._modifiableAttributes = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getModifiableAttributes(); + this._lifecycleManagementScript = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLifecycleManagementScript(); + this._elementGroup = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getElementGroup(); + this._indicator = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIndicator(); + this._autoScale = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getAutoScale(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd]"); + } + + public VnfdKey key() { + return key; + } + + public List getAutoScale() { + return _autoScale; + } + + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + public Map getDf() { + return _df; + } + + public Map getElementGroup() { + return _elementGroup; + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getId() { + return _id; + } + + public Map getIndicator() { + return _indicator; + } + + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + public String getProductInfoDescription() { + return _productInfoDescription; + } + + public String getProductInfoName() { + return _productInfoName; + } + + public String getProductName() { + return _productName; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getSoftwareVersion() { + return _softwareVersion; + } + + public Map getSwImageDesc() { + return _swImageDesc; + } + + public Map getVdu() { + return _vdu; + } + + public String getVersion() { + return _version; + } + + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + public List getVnfmInfo() { + return _vnfmInfo; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnfdBuilder withKey(final VnfdKey key) { + this.key = key; + return this; + } + public VnfdBuilder setAutoScale(final List values) { + this._autoScale = values; + return this; + } + + + public VnfdBuilder setConfigurableProperties(final ConfigurableProperties value) { + this._configurableProperties = value; + return this; + } + + public VnfdBuilder setDefaultLocalizationLanguage(final String value) { + this._defaultLocalizationLanguage = value; + return this; + } + public VnfdBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setElementGroup(final Map values) { + this._elementGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setElementGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setElementGroup(final List values) { + return setElementGroup(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setIndicator(final Map values) { + this._indicator = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIndicator(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIndicator(final List values) { + return setIndicator(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setIntVirtualLinkDesc(final Map values) { + this._intVirtualLinkDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIntVirtualLinkDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIntVirtualLinkDesc(final List values) { + return setIntVirtualLinkDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setLifecycleManagementScript(final Map values) { + this._lifecycleManagementScript = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLifecycleManagementScript(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setLifecycleManagementScript(final List values) { + return setLifecycleManagementScript(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setLocalizationLanguage(final String value) { + this._localizationLanguage = value; + return this; + } + + public VnfdBuilder setModifiableAttributes(final ModifiableAttributes value) { + this._modifiableAttributes = value; + return this; + } + + public VnfdBuilder setProductInfoDescription(final String value) { + this._productInfoDescription = value; + return this; + } + + public VnfdBuilder setProductInfoName(final String value) { + this._productInfoName = value; + return this; + } + + public VnfdBuilder setProductName(final String value) { + this._productName = value; + return this; + } + + public VnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public VnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setSoftwareVersion(final String value) { + this._softwareVersion = value; + return this; + } + public VnfdBuilder setSwImageDesc(final Map values) { + this._swImageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSwImageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSwImageDesc(final List values) { + return setSwImageDesc(CodeHelpers.compatMap(values)); + } + @JsonSetter("vdu") + public VnfdBuilder setVdu(final Map values) { + this._vdu = values; + return this; + } + + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVdu(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVdu(final List values) { + return setVdu(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + + @JsonSetter("virtual-compute-desc") + public VnfdBuilder setVirtualComputeDesc(final Map values) { + this._virtualComputeDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualComputeDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualComputeDesc(final List values) { + return setVirtualComputeDesc(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setVirtualStorageDesc(final Map values) { + this._virtualStorageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualStorageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualStorageDesc(final List values) { + return setVirtualStorageDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVnfmInfo(final List values) { + this._vnfmInfo = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnfd build() { + return new VnfdImpl(this); + } + + public static final class VnfdImpl + extends AbstractAugmentable + implements Vnfd { + + private final List _autoScale; + private final ConfigurableProperties _configurableProperties; + private final String _defaultLocalizationLanguage; + private Map _df; + private final Map _elementGroup; + private final Map _extCpd; + @JsonProperty("_id") + private final String _id; + private final Map _indicator; + private final Map _intVirtualLinkDesc; + private final Map _lifecycleManagementScript; + private final String _localizationLanguage; + private final ModifiableAttributes _modifiableAttributes; + @JsonProperty("product-info-description") + private final String _productInfoDescription; + private final String _productInfoName; + @JsonProperty("product-name") + private final String _productName; + @JsonProperty("provider") + private final String _provider; + private final Map _securityGroupRule; + private final String _softwareVersion; + private final Map _swImageDesc; + @JsonProperty("vdu") + private Map _vdu; + @JsonProperty("version") + private final String _version; + @JsonProperty("virtual-compute-desc") + private Map _virtualComputeDesc; + @JsonProperty("virtual-storage-desc") + private Map _virtualStorageDesc; + private final List _vnfmInfo; + private final VnfdKey key; + + VnfdImpl(VnfdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VnfdKey(base.getId()); + } + this._id = key.getId(); + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._elementGroup = CodeHelpers.emptyToNull(base.getElementGroup()); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._indicator = CodeHelpers.emptyToNull(base.getIndicator()); + this._intVirtualLinkDesc = CodeHelpers.emptyToNull(base.getIntVirtualLinkDesc()); + this._lifecycleManagementScript = CodeHelpers.emptyToNull(base.getLifecycleManagementScript()); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = CodeHelpers.emptyToNull(base.getSwImageDesc()); + this._vdu = CodeHelpers.emptyToNull(base.getVdu()); + this._version = base.getVersion(); + this._virtualComputeDesc = CodeHelpers.emptyToNull(base.getVirtualComputeDesc()); + this._virtualStorageDesc = CodeHelpers.emptyToNull(base.getVirtualStorageDesc()); + this._vnfmInfo = base.getVnfmInfo(); + } + + public VnfdImpl(){ + this( new VnfdBuilder() ); + } + + @Override + public VnfdKey key() { + return key; + } + + @Override + public List getAutoScale() { + return _autoScale; + } + + @Override + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + @Override + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + public Map setDf(final List values) { + return _df = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public Map getElementGroup() { + return _elementGroup; + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getIndicator() { + return _indicator; + } + + @Override + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + @Override + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + @Override + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + @Override + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + @Override + public String getProductInfoDescription() { + return _productInfoDescription; + } + + @Override + public String getProductInfoName() { + return _productInfoName; + } + + @Override + public String getProductName() { + return _productName; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getSoftwareVersion() { + return _softwareVersion; + } + + @Override + public Map getSwImageDesc() { + return _swImageDesc; + } + + public Map setVdu(final List values) { + return _vdu = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getVdu() { + return _vdu; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + @JsonSetter("virtual-compute-desc") + public Map setVirtualComputeDesc(final List values) { + return _virtualComputeDesc = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + @JsonSetter("virtual-storage-desc") + public Map setVirtualStorageDesc(final List values) { + return _virtualStorageDesc = CodeHelpers.compatMap(values) ; + } + + @Override + public List getVnfmInfo() { + return _vnfmInfo; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_autoScale); + result = prime * result + Objects.hashCode(_configurableProperties); + result = prime * result + Objects.hashCode(_defaultLocalizationLanguage); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_elementGroup); + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_indicator); + result = prime * result + Objects.hashCode(_intVirtualLinkDesc); + result = prime * result + Objects.hashCode(_lifecycleManagementScript); + result = prime * result + Objects.hashCode(_localizationLanguage); + result = prime * result + Objects.hashCode(_modifiableAttributes); + result = prime * result + Objects.hashCode(_productInfoDescription); + result = prime * result + Objects.hashCode(_productInfoName); + result = prime * result + Objects.hashCode(_productName); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_softwareVersion); + result = prime * result + Objects.hashCode(_swImageDesc); + result = prime * result + Objects.hashCode(_vdu); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(_virtualComputeDesc); + result = prime * result + Objects.hashCode(_virtualStorageDesc); + result = prime * result + Objects.hashCode(_vnfmInfo); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnfd other = (Vnfd)obj; + if (!Objects.equals(_autoScale, other.getAutoScale())) { + return false; + } + if (!Objects.equals(_configurableProperties, other.getConfigurableProperties())) { + return false; + } + if (!Objects.equals(_defaultLocalizationLanguage, other.getDefaultLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_elementGroup, other.getElementGroup())) { + return false; + } + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_indicator, other.getIndicator())) { + return false; + } + if (!Objects.equals(_intVirtualLinkDesc, other.getIntVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_lifecycleManagementScript, other.getLifecycleManagementScript())) { + return false; + } + if (!Objects.equals(_localizationLanguage, other.getLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_modifiableAttributes, other.getModifiableAttributes())) { + return false; + } + if (!Objects.equals(_productInfoDescription, other.getProductInfoDescription())) { + return false; + } + if (!Objects.equals(_productInfoName, other.getProductInfoName())) { + return false; + } + if (!Objects.equals(_productName, other.getProductName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_softwareVersion, other.getSoftwareVersion())) { + return false; + } + if (!Objects.equals(_swImageDesc, other.getSwImageDesc())) { + return false; + } + if (!Objects.equals(_vdu, other.getVdu())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (!Objects.equals(_virtualComputeDesc, other.getVirtualComputeDesc())) { + return false; + } + if (!Objects.equals(_virtualStorageDesc, other.getVirtualStorageDesc())) { + return false; + } + if (!Objects.equals(_vnfmInfo, other.getVnfmInfo())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfdImpl otherImpl = (VnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnfd"); + CodeHelpers.appendValue(helper, "_autoScale", _autoScale); + CodeHelpers.appendValue(helper, "_configurableProperties", _configurableProperties); + CodeHelpers.appendValue(helper, "_defaultLocalizationLanguage", _defaultLocalizationLanguage); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_elementGroup", _elementGroup); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_indicator", _indicator); + CodeHelpers.appendValue(helper, "_intVirtualLinkDesc", _intVirtualLinkDesc); + CodeHelpers.appendValue(helper, "_lifecycleManagementScript", _lifecycleManagementScript); + CodeHelpers.appendValue(helper, "_localizationLanguage", _localizationLanguage); + CodeHelpers.appendValue(helper, "_modifiableAttributes", _modifiableAttributes); + CodeHelpers.appendValue(helper, "_productInfoDescription", _productInfoDescription); + CodeHelpers.appendValue(helper, "_productInfoName", _productInfoName); + CodeHelpers.appendValue(helper, "_productName", _productName); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_softwareVersion", _softwareVersion); + CodeHelpers.appendValue(helper, "_swImageDesc", _swImageDesc); + CodeHelpers.appendValue(helper, "_vdu", _vdu); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "_virtualComputeDesc", _virtualComputeDesc); + CodeHelpers.appendValue(helper, "_virtualStorageDesc", _virtualStorageDesc); + CodeHelpers.appendValue(helper, "_vnfmInfo", _vnfmInfo); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdKey.java new file mode 100644 index 0000000..9f16c3a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VnfdKey + implements Identifier { + private static final long serialVersionUID = -7003982558180291733L; + private final String _id; + + + public VnfdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VnfdKey(VnfdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VnfdKey)) { + return false; + } + final VnfdKey other = (VnfdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VnfdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Df.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Df.java new file mode 100644 index 0000000..cecbb56 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Df.java @@ -0,0 +1,610 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.DfBuilder.DfImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.DependenciesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfoKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevelKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspect; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspectKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfileKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Identifies a DF within the scope of an NSD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list df {
+ *   min-elements 1;
+ *   must "default-instantiation-level or count(ns-instantiation-level) = 1" {
+ *     error-message
+ *       "default-instantiation-level must be present if there multiple instantion-level";
+ *   }
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf flavour-key {
+ *     type leafref {
+ *       path ../monitored-info/id;
+ *     }
+ *   }
+ *   list vnf-profile {
+ *     must "min-number-of-instances <= max-number-of-instances";
+ *     must boolean(../../vnfd-id[.=current()/vnfd-id]) {
+ *       error-message
+ *         "VNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *     }
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf vnfd-id {
+ *       type leafref {
+ *         path ../../../../vnfd/id;
+ *       }
+ *     }
+ *     leaf flavour-id {
+ *       type leafref {
+ *         path deref(../vnfd-id)/../df/id;
+ *       }
+ *     }
+ *     leaf instantiation-level {
+ *       type leafref {
+ *         path deref(../flavour-id)/../instantiation-level/id;
+ *       }
+ *     }
+ *     leaf min-number-of-instances {
+ *       default 1;
+ *       type uint16;
+ *     }
+ *     leaf max-number-of-instances {
+ *       default 1;
+ *       type uint16;
+ *     }
+ *     uses local-affinity-or-anti-affinity-rule;
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-connectivity {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       list constituent-cpd-id {
+ *         key constituent-base-element-id;
+ *         leaf constituent-base-element-id {
+ *           type leafref {
+ *             path ../../../id;
+ *           }
+ *         }
+ *         leaf constituent-cpd-id {
+ *           type leafref {
+ *             path deref(../../../vnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list pnf-profile {
+ *     key id;
+ *     must boolean(../../pnfd-id[.=current()/pnfd-id]) {
+ *       error-message
+ *         "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *     }
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf pnfd-id {
+ *       type leafref {
+ *         path ../../../../pnfd/id;
+ *       }
+ *     }
+ *     list virtual-link-connectivity {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       list constituent-cpd-id {
+ *         key constituent-base-element-id;
+ *         leaf constituent-base-element-id {
+ *           type leafref {
+ *             path ../../../id;
+ *           }
+ *         }
+ *         leaf constituent-cpd-id {
+ *           type leafref {
+ *             path deref(../../../pnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-profile {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf virtual-link-desc-id {
+ *       type leafref {
+ *         path ../../../virtual-link-desc/id;
+ *       }
+ *     }
+ *     leaf flavour-id {
+ *       type leafref {
+ *         path deref(../virtual-link-desc-id)/../df/id;
+ *       }
+ *     }
+ *     uses local-affinity-or-anti-affinity-rule;
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *     container max-bitrate-requirements {
+ *       uses link-bitrate-requirements;
+ *     }
+ *     container min-bitrate-requirements {
+ *       uses link-bitrate-requirements;
+ *     }
+ *   }
+ *   list scaling-aspect {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf scaling-level {
+ *       type leafref {
+ *         path ../../ns-instantiation-level/id;
+ *       }
+ *     }
+ *   }
+ *   list affinity-or-anti-affinity-group {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf type {
+ *       type affinity-type;
+ *     }
+ *     leaf scope {
+ *       type affinity-scope;
+ *     }
+ *   }
+ *   list ns-instantiation-level {
+ *     min-elements 1;
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list vnf-to-level-mapping {
+ *       key vnf-profile-id;
+ *       leaf vnf-profile-id {
+ *         type leafref {
+ *           path ../../../vnf-profile/id;
+ *         }
+ *       }
+ *       leaf number-of-instances {
+ *         default 1;
+ *         type uint32;
+ *       }
+ *     }
+ *     list virtual-link-to-level-mapping {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       uses link-bitrate-requirements;
+ *     }
+ *     list ns-to-level-mapping {
+ *       key ns-profile-id;
+ *       leaf ns-profile-id {
+ *         type leafref {
+ *           path ../../../ns-profile/id;
+ *         }
+ *       }
+ *       leaf number-of-instances {
+ *         default 1;
+ *         type uint32;
+ *       }
+ *     }
+ *     must "(count(vnf-to-level-mapping) + count(virtual-link-to-level-mapping) + count(ns-to-level-mapping)) > 0" {
+ *       error-message
+ *         "At least one attribute between vnf-to-level-mapping, virtual-link-to-level-mapping and ns-to-level-mapping shall be present.";
+ *     }
+ *   }
+ *   leaf default-instantiation-level {
+ *     type leafref {
+ *       path ../ns-instantiation-level/id;
+ *     }
+ *   }
+ *   list ns-profile {
+ *     must "min-number-of-instances <= max-number-of-instances" {
+ *       error-message
+ *         "min-number-of-instances has to be less than or equalmax-number-of-instances.";
+ *     }
+ *     must boolean(../../nested-nsd-id[.=current()/nsd-id]) {
+ *       error-message
+ *         "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *     }
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf nsd-id {
+ *       type leafref {
+ *         path ../../../../nsd/id;
+ *       }
+ *     }
+ *     leaf ns-df-id {
+ *       type leafref {
+ *         path deref(../nsd-id)/../df/id;
+ *       }
+ *     }
+ *     leaf instantiation-level-id {
+ *       type leafref {
+ *         path deref(../ns-df-id)/../ns-instantiation-level/id;
+ *       }
+ *     }
+ *     leaf min-number-of-instances {
+ *       type uint16;
+ *       default 1;
+ *     }
+ *     leaf max-number-of-instances {
+ *       type uint16;
+ *       default 1;
+ *     }
+ *     list affinity-or-anti-affinity-group-id {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-connectivity {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       list constituent-cpd-id {
+ *         key constituent-base-element-id;
+ *         leaf constituent-base-element-id {
+ *           type leafref {
+ *             path ../../../id;
+ *           }
+ *         }
+ *         leaf constituent-cpd-id {
+ *           type leafref {
+ *             path deref(../../../nsd-id)/../sapd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list dependencies {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     choice primary-id {
+ *       case primary-vnf-profile {
+ *         leaf primary-vnf-profile {
+ *           type leafref {
+ *             path ../../vnf-profile/vnfd-id;
+ *           }
+ *         }
+ *       }
+ *       case primary-ns-profile {
+ *         leaf primary-ns-profile {
+ *           type leafref {
+ *             path ../../ns-profile/nsd-id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     choice secondary-id {
+ *       case secondary-vnf-profile {
+ *         leaf secondary-vnf-profile {
+ *           type leafref {
+ *             path ../../vnf-profile/vnfd-id;
+ *           }
+ *         }
+ *       }
+ *       case secondary-ns-profile {
+ *         leaf secondary-ns-profile {
+ *           type leafref {
+ *             path ../../ns-profile/nsd-id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list monitored-info {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     container vnf-indicator-info {
+ *       leaf vnfd-id {
+ *         type leafref {
+ *           path ../../../../../vnfd/id;
+ *         }
+ *       }
+ *       leaf vnf-indicator {
+ *         type leafref {
+ *           path deref(../vnfd-id)/../indicator/id;
+ *         }
+ *       }
+ *     }
+ *     container monitoring-parameter {
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf performance-metric {
+ *         type string;
+ *       }
+ *       leaf collection-period {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df + * + *

To create instances of this class use {@link DfBuilder}. + * @see DfBuilder + * @see DfKey + * + */ +@JsonDeserialize(as = DfImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface Df + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("df"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df.class; + } + + /** + * Identifies this NsDf information element. It identifies a NS DF within the NSD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Assurance parameter against which this flavour is being described. The key can + * be a combination of multiple assurance parameters with a logical relationship + * between them. The parameters should be present as a monitoredInfo attribute in + * the NSD. + * + * + * + * @return java.lang.String flavourKey, or null if not present + */ + @Nullable String getFlavourKey(); + + /** + * VNF profile to be used for the NS flavour. + * + * + * + * @return java.util.Map vnfProfile, or null if not present + */ + @Nullable Map getVnfProfile(); + + /** + * @return java.util.Map vnfProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullVnfProfile() { + return CodeHelpers.nonnull(getVnfProfile()); + } + + /** + * @return java.util.Map pnfProfile, or null if not present + */ + @Nullable Map getPnfProfile(); + + /** + * @return java.util.Map pnfProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullPnfProfile() { + return CodeHelpers.nonnull(getPnfProfile()); + } + + /** + * VL profile to be used for the NS flavour. + * + * + * + * @return java.util.Map virtualLinkProfile, or null if not present + */ + @Nullable Map getVirtualLinkProfile(); + + /** + * @return java.util.Map virtualLinkProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkProfile() { + return CodeHelpers.nonnull(getVirtualLinkProfile()); + } + + /** + * The scaling aspects supported by this DF of the NS. + * + * + * + * @return java.util.Map scalingAspect, or null if not present + */ + @Nullable Map getScalingAspect(); + + /** + * @return java.util.Map scalingAspect, or an empty list if it is not present + */ + default @NonNull Map nonnullScalingAspect() { + return CodeHelpers.nonnull(getScalingAspect()); + } + + /** + * Specifies affinity or anti-affinity relationship applicable between the VNF + * instances created using different VNFDs, the Virtual Link instances created + * using different NsVirtualLinkDescs or the nested NS instances created using + * different NSDs in the same affinity or anti-affinity group. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroup, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroup(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroup() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroup()); + } + + /** + * Describes the details of an NS level. + * + * + * + * @return java.util.Map nsInstantiationLevel, or null if not present + */ + @Nullable Map getNsInstantiationLevel(); + + /** + * @return java.util.Map nsInstantiationLevel, or an empty list if it is not present + */ + default @NonNull Map nonnullNsInstantiationLevel() { + return CodeHelpers.nonnull(getNsInstantiationLevel()); + } + + /** + * Identifies the NS level which represents the default NS instantiation level for + * this DF. It shall be present if there are multiple 'nsIinstantiationLevel' + * entries. + * + * + * + * @return java.lang.String defaultInstantiationLevel, or null if not present + */ + @Nullable String getDefaultInstantiationLevel(); + + /** + * Specifies a NS Profile supported by this NS DF. + * + * + * + * @return java.util.Map nsProfile, or null if not present + */ + @Nullable Map getNsProfile(); + + /** + * @return java.util.Map nsProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullNsProfile() { + return CodeHelpers.nonnull(getNsProfile()); + } + + /** + * Specifies the order in which instances of the VNFs and/or nested NSs have to be + * created. + * + * + * + * @return java.util.Map dependencies, or null if not present + */ + @Nullable Map getDependencies(); + + /** + * @return java.util.Map dependencies, or an empty list if it is not present + */ + default @NonNull Map nonnullDependencies() { + return CodeHelpers.nonnull(getDependencies()); + } + + /** + * @return java.util.Map monitoredInfo, or null if not present + */ + @Nullable Map getMonitoredInfo(); + + /** + * @return java.util.Map monitoredInfo, or an empty list if it is not present + */ + default @NonNull Map nonnullMonitoredInfo() { + return CodeHelpers.nonnull(getMonitoredInfo()); + } + + @Override + DfKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfBuilder.java new file mode 100644 index 0000000..5997986 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfBuilder.java @@ -0,0 +1,705 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.DependenciesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfoKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevelKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspect; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspectKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfileBuilder.VnfProfileImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfileKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link DfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DfBuilder + * @see Builder + * + */ +public class DfBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroup; + private String _defaultInstantiationLevel; + private Map _dependencies; + private String _flavourKey; + private String _id; + private Map _monitoredInfo; + private Map _nsInstantiationLevel; + private Map _nsProfile; + private Map _pnfProfile; + private Map _scalingAspect; + private Map _virtualLinkProfile; + private Map _vnfProfile; + private DfKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DfBuilder() { + } + + public DfBuilder(Df base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroup = base.getAffinityOrAntiAffinityGroup(); + this._defaultInstantiationLevel = base.getDefaultInstantiationLevel(); + this._dependencies = base.getDependencies(); + this._flavourKey = base.getFlavourKey(); + this._monitoredInfo = base.getMonitoredInfo(); + this._nsInstantiationLevel = base.getNsInstantiationLevel(); + this._nsProfile = base.getNsProfile(); + this._pnfProfile = base.getPnfProfile(); + this._scalingAspect = base.getScalingAspect(); + this._virtualLinkProfile = base.getVirtualLinkProfile(); + this._vnfProfile = base.getVnfProfile(); + } + + + public DfKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + public String getDefaultInstantiationLevel() { + return _defaultInstantiationLevel; + } + + public Map getDependencies() { + return _dependencies; + } + + public String getFlavourKey() { + return _flavourKey; + } + + public String getId() { + return _id; + } + + public Map getMonitoredInfo() { + return _monitoredInfo; + } + + public Map getNsInstantiationLevel() { + return _nsInstantiationLevel; + } + + public Map getNsProfile() { + return _nsProfile; + } + + public Map getPnfProfile() { + return _pnfProfile; + } + + public Map getScalingAspect() { + return _scalingAspect; + } + + public Map getVirtualLinkProfile() { + return _virtualLinkProfile; + } + + public Map getVnfProfile() { + return _vnfProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public DfBuilder withKey(final DfKey key) { + this.key = key; + return this; + } + public DfBuilder setAffinityOrAntiAffinityGroup(final Map values) { + this._affinityOrAntiAffinityGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setAffinityOrAntiAffinityGroup(final List values) { + return setAffinityOrAntiAffinityGroup(CodeHelpers.compatMap(values)); + } + + public DfBuilder setDefaultInstantiationLevel(final String value) { + this._defaultInstantiationLevel = value; + return this; + } + public DfBuilder setDependencies(final Map values) { + this._dependencies = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDependencies(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setDependencies(final List values) { + return setDependencies(CodeHelpers.compatMap(values)); + } + + public DfBuilder setFlavourKey(final String value) { + this._flavourKey = value; + return this; + } + + public DfBuilder setId(final String value) { + this._id = value; + return this; + } + public DfBuilder setMonitoredInfo(final Map values) { + this._monitoredInfo = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setMonitoredInfo(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setMonitoredInfo(final List values) { + return setMonitoredInfo(CodeHelpers.compatMap(values)); + } + public DfBuilder setNsInstantiationLevel(final Map values) { + this._nsInstantiationLevel = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsInstantiationLevel(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setNsInstantiationLevel(final List values) { + return setNsInstantiationLevel(CodeHelpers.compatMap(values)); + } + public DfBuilder setNsProfile(final Map values) { + this._nsProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setNsProfile(final List values) { + return setNsProfile(CodeHelpers.compatMap(values)); + } + public DfBuilder setPnfProfile(final Map values) { + this._pnfProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setPnfProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setPnfProfile(final List values) { + return setPnfProfile(CodeHelpers.compatMap(values)); + } + public DfBuilder setScalingAspect(final Map values) { + this._scalingAspect = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setScalingAspect(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setScalingAspect(final List values) { + return setScalingAspect(CodeHelpers.compatMap(values)); + } + public DfBuilder setVirtualLinkProfile(final Map values) { + this._virtualLinkProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setVirtualLinkProfile(final List values) { + return setVirtualLinkProfile(CodeHelpers.compatMap(values)); + } + public DfBuilder setVnfProfile(final Map values) { + this._vnfProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnfProfile(Map)} instead. + */ + + @Deprecated(forRemoval = true) + public DfBuilder setVnfProfile(final List values) { + return setVnfProfile(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Df build() { + return new DfImpl(this); + } + + public static final class DfImpl + extends AbstractAugmentable + implements Df { + + private final Map _affinityOrAntiAffinityGroup; + private final String _defaultInstantiationLevel; + private final Map _dependencies; + private final String _flavourKey; + @JsonProperty("id") + private final String _id; + private final Map _monitoredInfo; + private final Map _nsInstantiationLevel; + private final Map _nsProfile; + private final Map _pnfProfile; + private final Map _scalingAspect; + private final Map _virtualLinkProfile; + private Map _vnfProfile; + private final DfKey key; + + DfImpl(DfBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new DfKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroup = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroup()); + this._defaultInstantiationLevel = base.getDefaultInstantiationLevel(); + this._dependencies = CodeHelpers.emptyToNull(base.getDependencies()); + this._flavourKey = base.getFlavourKey(); + this._monitoredInfo = CodeHelpers.emptyToNull(base.getMonitoredInfo()); + this._nsInstantiationLevel = CodeHelpers.emptyToNull(base.getNsInstantiationLevel()); + this._nsProfile = CodeHelpers.emptyToNull(base.getNsProfile()); + this._pnfProfile = CodeHelpers.emptyToNull(base.getPnfProfile()); + this._scalingAspect = CodeHelpers.emptyToNull(base.getScalingAspect()); + this._virtualLinkProfile = CodeHelpers.emptyToNull(base.getVirtualLinkProfile()); + this._vnfProfile = CodeHelpers.emptyToNull(base.getVnfProfile()); + } + + public DfImpl() { + this( new DfBuilder()); + } + +// public Map setVnfProfile(final List values) { +// return _vnfProfile = CodeHelpers.compatMap(values) ; +// } + + @JsonSetter("vnf-profile") + public Map setVnfProfile(final List values) { + if(values==null) + return null; + if(values.isEmpty()) + return null; + else + { + Map result = new HashMap<>(); + for(VnfProfile value:values) { + result.put(new VnfProfileKey(value.getId()),value); + } + this._vnfProfile=result; + return result; + } + } + + @Override + public DfKey key() { + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + @Override + public String getDefaultInstantiationLevel() { + return _defaultInstantiationLevel; + } + + @Override + public Map getDependencies() { + return _dependencies; + } + + @Override + public String getFlavourKey() { + return _flavourKey; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getMonitoredInfo() { + return _monitoredInfo; + } + + @Override + public Map getNsInstantiationLevel() { + return _nsInstantiationLevel; + } + + @Override + public Map getNsProfile() { + return _nsProfile; + } + + @Override + public Map getPnfProfile() { + return _pnfProfile; + } + + @Override + public Map getScalingAspect() { + return _scalingAspect; + } + + @Override + public Map getVirtualLinkProfile() { + return _virtualLinkProfile; + } + + @Override + public Map getVnfProfile() { + return _vnfProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroup); + result = prime * result + Objects.hashCode(_defaultInstantiationLevel); + result = prime * result + Objects.hashCode(_dependencies); + result = prime * result + Objects.hashCode(_flavourKey); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_monitoredInfo); + result = prime * result + Objects.hashCode(_nsInstantiationLevel); + result = prime * result + Objects.hashCode(_nsProfile); + result = prime * result + Objects.hashCode(_pnfProfile); + result = prime * result + Objects.hashCode(_scalingAspect); + result = prime * result + Objects.hashCode(_virtualLinkProfile); + result = prime * result + Objects.hashCode(_vnfProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Df.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Df other = (Df)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroup, other.getAffinityOrAntiAffinityGroup())) { + return false; + } + if (!Objects.equals(_defaultInstantiationLevel, other.getDefaultInstantiationLevel())) { + return false; + } + if (!Objects.equals(_dependencies, other.getDependencies())) { + return false; + } + if (!Objects.equals(_flavourKey, other.getFlavourKey())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_monitoredInfo, other.getMonitoredInfo())) { + return false; + } + if (!Objects.equals(_nsInstantiationLevel, other.getNsInstantiationLevel())) { + return false; + } + if (!Objects.equals(_nsProfile, other.getNsProfile())) { + return false; + } + if (!Objects.equals(_pnfProfile, other.getPnfProfile())) { + return false; + } + if (!Objects.equals(_scalingAspect, other.getScalingAspect())) { + return false; + } + if (!Objects.equals(_virtualLinkProfile, other.getVirtualLinkProfile())) { + return false; + } + if (!Objects.equals(_vnfProfile, other.getVnfProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DfImpl otherImpl = (DfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Df"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroup", _affinityOrAntiAffinityGroup); + CodeHelpers.appendValue(helper, "_defaultInstantiationLevel", _defaultInstantiationLevel); + CodeHelpers.appendValue(helper, "_dependencies", _dependencies); + CodeHelpers.appendValue(helper, "_flavourKey", _flavourKey); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_monitoredInfo", _monitoredInfo); + CodeHelpers.appendValue(helper, "_nsInstantiationLevel", _nsInstantiationLevel); + CodeHelpers.appendValue(helper, "_nsProfile", _nsProfile); + CodeHelpers.appendValue(helper, "_pnfProfile", _pnfProfile); + CodeHelpers.appendValue(helper, "_scalingAspect", _scalingAspect); + CodeHelpers.appendValue(helper, "_virtualLinkProfile", _virtualLinkProfile); + CodeHelpers.appendValue(helper, "_vnfProfile", _vnfProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfKey.java new file mode 100644 index 0000000..598abf2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class DfKey + implements Identifier { + private static final long serialVersionUID = 4083286612161956839L; + private final String _id; + + + public DfKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public DfKey(DfKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DfKey)) { + return false; + } + final DfKey other = (DfKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(DfKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScript.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScript.java new file mode 100644 index 0000000..02d7935 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScript.java @@ -0,0 +1,66 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list lifecycle-management-script {
+ *   key event;
+ *   leaf event {
+ *     type string;
+ *   }
+ *   leaf script {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/lifecycle-management-script + * + *

To create instances of this class use {@link LifecycleManagementScriptBuilder}. + * @see LifecycleManagementScriptBuilder + * @see LifecycleManagementScriptKey + * + */ +public interface LifecycleManagementScript + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("lifecycle-management-script"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScript.class; + } + + /** + * @return java.lang.String event, or null if not present + */ + @Nullable String getEvent(); + + /** + * @return java.lang.String script, or null if not present + */ + @Nullable String getScript(); + + @Override + LifecycleManagementScriptKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptBuilder.java new file mode 100644 index 0000000..d34e6b9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link LifecycleManagementScriptBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     LifecycleManagementScriptBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new LifecycleManagementScriptBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of LifecycleManagementScriptBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see LifecycleManagementScriptBuilder + * @see Builder + * + */ +public class LifecycleManagementScriptBuilder implements Builder { + + private String _event; + private String _script; + private LifecycleManagementScriptKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public LifecycleManagementScriptBuilder() { + } + + public LifecycleManagementScriptBuilder(LifecycleManagementScript base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._event = base.getEvent(); + this._script = base.getScript(); + } + + + public LifecycleManagementScriptKey key() { + return key; + } + + public String getEvent() { + return _event; + } + + public String getScript() { + return _script; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public LifecycleManagementScriptBuilder withKey(final LifecycleManagementScriptKey key) { + this.key = key; + return this; + } + + public LifecycleManagementScriptBuilder setEvent(final String value) { + this._event = value; + return this; + } + + public LifecycleManagementScriptBuilder setScript(final String value) { + this._script = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public LifecycleManagementScriptBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public LifecycleManagementScriptBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public LifecycleManagementScriptBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private LifecycleManagementScriptBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public LifecycleManagementScript build() { + return new LifecycleManagementScriptImpl(this); + } + + private static final class LifecycleManagementScriptImpl + extends AbstractAugmentable + implements LifecycleManagementScript { + + private final String _event; + private final String _script; + private final LifecycleManagementScriptKey key; + + LifecycleManagementScriptImpl(LifecycleManagementScriptBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new LifecycleManagementScriptKey(base.getEvent()); + } + this._event = key.getEvent(); + this._script = base.getScript(); + } + + @Override + public LifecycleManagementScriptKey key() { + return key; + } + + @Override + public String getEvent() { + return _event; + } + + @Override + public String getScript() { + return _script; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_event); + result = prime * result + Objects.hashCode(_script); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!LifecycleManagementScript.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + LifecycleManagementScript other = (LifecycleManagementScript)obj; + if (!Objects.equals(_event, other.getEvent())) { + return false; + } + if (!Objects.equals(_script, other.getScript())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + LifecycleManagementScriptImpl otherImpl = (LifecycleManagementScriptImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LifecycleManagementScript"); + CodeHelpers.appendValue(helper, "_event", _event); + CodeHelpers.appendValue(helper, "_script", _script); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptKey.java new file mode 100644 index 0000000..db00eee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class LifecycleManagementScriptKey + implements Identifier { + private static final long serialVersionUID = -7557130487871185497L; + private final String _event; + + + public LifecycleManagementScriptKey(String _event) { + + this._event = _event; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public LifecycleManagementScriptKey(LifecycleManagementScriptKey source) { + this._event = source._event; + } + + + public String getEvent() { + return _event; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_event); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LifecycleManagementScriptKey)) { + return false; + } + final LifecycleManagementScriptKey other = (LifecycleManagementScriptKey) obj; + if (!Objects.equals(_event, other._event)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(LifecycleManagementScriptKey.class); + CodeHelpers.appendValue(helper, "_event", _event); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Sapd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Sapd.java new file mode 100644 index 0000000..3a1bd29 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Sapd.java @@ -0,0 +1,139 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the descriptor of a service access point of the network service. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list sapd {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf address-assignment {
+ *     type boolean;
+ *   }
+ *   choice cpd-or-virtual-link {
+ *     case virtual-link-desc {
+ *       leaf virtual-link-desc {
+ *         type leafref {
+ *           path ../../virtual-link-desc/id;
+ *         }
+ *       }
+ *     }
+ *     case vnf {
+ *       container vnf {
+ *         leaf vnfd-id {
+ *           type leafref {
+ *             path ../../../../vnfd/id;
+ *           }
+ *           must boolean(../../../vnfd-id[.=current()]);
+ *         }
+ *         leaf ext-cpd-id {
+ *           type leafref {
+ *             path deref(../vnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case pnf {
+ *       container pnf {
+ *         leaf pnfd-id {
+ *           type leafref {
+ *             path ../../../../pnfd/id;
+ *           }
+ *           must boolean(../pnfd-id[.=current()]);
+ *         }
+ *         leaf ext-cpd-id {
+ *           type leafref {
+ *             path deref(../pnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case ns {
+ *       container ns {
+ *         leaf nsd-id {
+ *           type leafref {
+ *             path ../../../../nsd/id;
+ *           }
+ *           must boolean(../nsd-id[.=current()]);
+ *         }
+ *         leaf ext-cpd-id {
+ *           type leafref {
+ *             path deref(../nsd-id)/../sapd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/sapd + * + *

To create instances of this class use {@link SapdBuilder}. + * @see SapdBuilder + * @see SapdKey + * + */ +public interface Sapd + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sapd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd.class; + } + + /** + * Identifier of this Cpd information element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Specify whether the SAP address assignment is under the responsibility of + * management and orchestration functions or not. If it is set to True, management + * and orchestration functions are responsible for assigning addresses to the + * access points instantiated from this SAPD. + * + * + * + * @return java.lang.Boolean addressAssignment, or null if not present + */ + @Nullable Boolean isAddressAssignment(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink cpdOrVirtualLink, or null if not present + */ + @Nullable CpdOrVirtualLink getCpdOrVirtualLink(); + + @Override + SapdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdBuilder.java new file mode 100644 index 0000000..7b13074 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link SapdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SapdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SapdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SapdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SapdBuilder + * @see Builder + * + */ +public class SapdBuilder implements Builder { + + private CpdOrVirtualLink _cpdOrVirtualLink; + private String _id; + private Boolean _addressAssignment; + private SapdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SapdBuilder() { + } + + public SapdBuilder(Sapd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._cpdOrVirtualLink = base.getCpdOrVirtualLink(); + this._addressAssignment = base.isAddressAssignment(); + } + + + public SapdKey key() { + return key; + } + + public CpdOrVirtualLink getCpdOrVirtualLink() { + return _cpdOrVirtualLink; + } + + public String getId() { + return _id; + } + + public Boolean isAddressAssignment() { + return _addressAssignment; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public SapdBuilder withKey(final SapdKey key) { + this.key = key; + return this; + } + + public SapdBuilder setCpdOrVirtualLink(final CpdOrVirtualLink value) { + this._cpdOrVirtualLink = value; + return this; + } + + public SapdBuilder setId(final String value) { + this._id = value; + return this; + } + + public SapdBuilder setAddressAssignment(final Boolean value) { + this._addressAssignment = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SapdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SapdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SapdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SapdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Sapd build() { + return new SapdImpl(this); + } + + private static final class SapdImpl + extends AbstractAugmentable + implements Sapd { + + private final CpdOrVirtualLink _cpdOrVirtualLink; + private final String _id; + private final Boolean _addressAssignment; + private final SapdKey key; + + SapdImpl(SapdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new SapdKey(base.getId()); + } + this._id = key.getId(); + this._cpdOrVirtualLink = base.getCpdOrVirtualLink(); + this._addressAssignment = base.isAddressAssignment(); + } + + @Override + public SapdKey key() { + return key; + } + + @Override + public CpdOrVirtualLink getCpdOrVirtualLink() { + return _cpdOrVirtualLink; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Boolean isAddressAssignment() { + return _addressAssignment; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpdOrVirtualLink); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_addressAssignment); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Sapd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Sapd other = (Sapd)obj; + if (!Objects.equals(_cpdOrVirtualLink, other.getCpdOrVirtualLink())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_addressAssignment, other.isAddressAssignment())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SapdImpl otherImpl = (SapdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Sapd"); + CodeHelpers.appendValue(helper, "_cpdOrVirtualLink", _cpdOrVirtualLink); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_addressAssignment", _addressAssignment); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdKey.java new file mode 100644 index 0000000..2fcbbca --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class SapdKey + implements Identifier { + private static final long serialVersionUID = 7153644156739384387L; + private final String _id; + + + public SapdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public SapdKey(SapdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SapdKey)) { + return false; + } + final SapdKey other = (SapdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(SapdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDesc.java new file mode 100644 index 0000000..710edcd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDesc.java @@ -0,0 +1,221 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.DfKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the constituent VLDs. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-desc {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   uses connectivity-type;
+ *   list df {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     container qos {
+ *       presence "VL QoS parameters";
+ *       leaf latency {
+ *         type uint32;
+ *         units ms;
+ *       }
+ *       leaf packet-delay-variation {
+ *         type uint32;
+ *         units ms;
+ *       }
+ *       leaf packet-loss-ratio {
+ *         type decimal64 {
+ *           fraction-digits 2;
+ *           range 0..1.00;
+ *         }
+ *       }
+ *       leaf priority {
+ *         type uint32;
+ *       }
+ *     }
+ *     leaf service-availability-level {
+ *       type enumeration {
+ *         enum level-1;
+ *         enum level-2;
+ *         enum level-3;
+ *       }
+ *     }
+ *   }
+ *   leaf test-access {
+ *     type enumeration {
+ *       enum none;
+ *       enum passive-monitoring;
+ *       enum active;
+ *     }
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   uses security-parameters;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/virtual-link-desc + * + *

To create instances of this class use {@link VirtualLinkDescBuilder}. + * @see VirtualLinkDescBuilder + * @see VirtualLinkDescKey + * + */ +public interface VirtualLinkDesc + extends + ChildOf, + Augmentable, + ConnectivityType, + SecurityParameters, + Identifiable +{ + + + public enum TestAccess implements Enumeration { + None(0, "none"), + + PassiveMonitoring(1, "passive-monitoring"), + + Active(2, "active") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (TestAccess enumItem : TestAccess.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private TestAccess(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding TestAccess item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding TestAccess item, or null if no such item exists + */ + public static TestAccess forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc.class; + } + + /** + * Identifier of the NsVirtualLinkDesc information element. It uniquely identifies + * a VLD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The VirtualLinkDf information element specifies properties for instantiating a + * VL according to a specific flavour. + * + * + * + * @return java.util.Map df, or null if not present + */ + @Nullable Map getDf(); + + /** + * @return java.util.Map df, or an empty list if it is not present + */ + default @NonNull Map nonnullDf() { + return CodeHelpers.nonnull(getDf()); + } + + /** + * Specifies test access facilities expected on the VL. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc.TestAccess testAccess, or null if not present + */ + @Nullable TestAccess getTestAccess(); + + /** + * Provides human-readable information on the purpose of the virtual link (e.g. VL + * for control plane traffic). + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + @Override + VirtualLinkDescKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescBuilder.java new file mode 100644 index 0000000..fe1e746 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescBuilder.java @@ -0,0 +1,464 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.ConnectivityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.DfKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkDescBuilder + * @see Builder + * + */ +public class VirtualLinkDescBuilder implements Builder { + + private String _algorithm; + private String _certificate; + private ConnectivityType _connectivityType; + private String _description; + private Map _df; + private String _id; + private String _signature; + private VirtualLinkDesc.TestAccess _testAccess; + private VirtualLinkDescKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkDescBuilder() { + } + public VirtualLinkDescBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType arg) { + this._connectivityType = arg.getConnectivityType(); + } + public VirtualLinkDescBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters arg) { + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + + public VirtualLinkDescBuilder(VirtualLinkDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._algorithm = base.getAlgorithm(); + this._certificate = base.getCertificate(); + this._connectivityType = base.getConnectivityType(); + this._description = base.getDescription(); + this._df = base.getDf(); + this._signature = base.getSignature(); + this._testAccess = base.getTestAccess(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType) { + this._connectivityType = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType)arg).getConnectivityType(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters) { + this._signature = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getSignature(); + this._algorithm = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getAlgorithm(); + this._certificate = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getCertificate(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters]"); + } + + public VirtualLinkDescKey key() { + return key; + } + + public String getAlgorithm() { + return _algorithm; + } + + public String getCertificate() { + return _certificate; + } + + public ConnectivityType getConnectivityType() { + return _connectivityType; + } + + public String getDescription() { + return _description; + } + + public Map getDf() { + return _df; + } + + public String getId() { + return _id; + } + + public String getSignature() { + return _signature; + } + + public VirtualLinkDesc.TestAccess getTestAccess() { + return _testAccess; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkDescBuilder withKey(final VirtualLinkDescKey key) { + this.key = key; + return this; + } + + public VirtualLinkDescBuilder setAlgorithm(final String value) { + this._algorithm = value; + return this; + } + + public VirtualLinkDescBuilder setCertificate(final String value) { + this._certificate = value; + return this; + } + + public VirtualLinkDescBuilder setConnectivityType(final ConnectivityType value) { + this._connectivityType = value; + return this; + } + + public VirtualLinkDescBuilder setDescription(final String value) { + this._description = value; + return this; + } + public VirtualLinkDescBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public VirtualLinkDescBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + + public VirtualLinkDescBuilder setId(final String value) { + this._id = value; + return this; + } + + public VirtualLinkDescBuilder setSignature(final String value) { + this._signature = value; + return this; + } + + public VirtualLinkDescBuilder setTestAccess(final VirtualLinkDesc.TestAccess value) { + this._testAccess = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkDesc build() { + return new VirtualLinkDescImpl(this); + } + + private static final class VirtualLinkDescImpl + extends AbstractAugmentable + implements VirtualLinkDesc { + + private final String _algorithm; + private final String _certificate; + private final ConnectivityType _connectivityType; + private final String _description; + private final Map _df; + private final String _id; + private final String _signature; + private final VirtualLinkDesc.TestAccess _testAccess; + private final VirtualLinkDescKey key; + + VirtualLinkDescImpl(VirtualLinkDescBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkDescKey(base.getId()); + } + this._id = key.getId(); + this._algorithm = base.getAlgorithm(); + this._certificate = base.getCertificate(); + this._connectivityType = base.getConnectivityType(); + this._description = base.getDescription(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._signature = base.getSignature(); + this._testAccess = base.getTestAccess(); + } + + @Override + public VirtualLinkDescKey key() { + return key; + } + + @Override + public String getAlgorithm() { + return _algorithm; + } + + @Override + public String getCertificate() { + return _certificate; + } + + @Override + public ConnectivityType getConnectivityType() { + return _connectivityType; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getSignature() { + return _signature; + } + + @Override + public VirtualLinkDesc.TestAccess getTestAccess() { + return _testAccess; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_algorithm); + result = prime * result + Objects.hashCode(_certificate); + result = prime * result + Objects.hashCode(_connectivityType); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_signature); + result = prime * result + Objects.hashCode(_testAccess); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkDesc other = (VirtualLinkDesc)obj; + if (!Objects.equals(_algorithm, other.getAlgorithm())) { + return false; + } + if (!Objects.equals(_certificate, other.getCertificate())) { + return false; + } + if (!Objects.equals(_connectivityType, other.getConnectivityType())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_signature, other.getSignature())) { + return false; + } + if (!Objects.equals(_testAccess, other.getTestAccess())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkDescImpl otherImpl = (VirtualLinkDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkDesc"); + CodeHelpers.appendValue(helper, "_algorithm", _algorithm); + CodeHelpers.appendValue(helper, "_certificate", _certificate); + CodeHelpers.appendValue(helper, "_connectivityType", _connectivityType); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_signature", _signature); + CodeHelpers.appendValue(helper, "_testAccess", _testAccess); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescKey.java new file mode 100644 index 0000000..c6d324d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkDescKey + implements Identifier { + private static final long serialVersionUID = 6490584508262845370L; + private final String _id; + + + public VirtualLinkDescKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkDescKey(VirtualLinkDescKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkDescKey)) { + return false; + } + final VirtualLinkDescKey other = (VirtualLinkDescKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkDescKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Vnffgd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Vnffgd.java new file mode 100644 index 0000000..0995e82 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Vnffgd.java @@ -0,0 +1,269 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPoolKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.Nfpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.NfpdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the descriptors of the applicable forwarding graphs. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vnffgd {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf-list vnf-profile-id {
+ *     type leafref {
+ *       path ../../df/vnf-profile/id;
+ *     }
+ *   }
+ *   leaf-list pnf-profile-id {
+ *     type leafref {
+ *       path ../../df/pnf-profile/id;
+ *     }
+ *   }
+ *   leaf-list nested-ns-profile-id {
+ *     type leafref {
+ *       path ../../df/ns-profile/id;
+ *     }
+ *   }
+ *   leaf virtual-link-profile-id {
+ *     type leafref {
+ *       path ../../df/virtual-link-profile/id;
+ *     }
+ *   }
+ *   list cpd-pool {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     choice constituent-base-element-id {
+ *       case vnf-profile {
+ *         container vnf-profile {
+ *           leaf vnf-profile-id {
+ *             type leafref {
+ *               path ../../../../../nsd/df/vnf-profile/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case pnf-profile {
+ *         container pnf-profile {
+ *           leaf pnf-profile-id {
+ *             type leafref {
+ *               path ../../../../../nsd/df/pnf-profile/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case ns-profile {
+ *         container ns-profile {
+ *           leaf ns-profile-id {
+ *             type leafref {
+ *               path ../../../../../nsd/df/ns-profile/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     choice constituent-cpd-id {
+ *       case vnf {
+ *         container vnf {
+ *           leaf vnfd-id {
+ *             type leafref {
+ *               path ../../../../../vnfd/id;
+ *             }
+ *           }
+ *           leaf cpd-id {
+ *             type leafref {
+ *               path deref(../vnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case pnf {
+ *         container pnf {
+ *           leaf pnfd-id {
+ *             type leafref {
+ *               path ../../../../../pnfd/id;
+ *             }
+ *           }
+ *           leaf pnf-cpd-id {
+ *             type leafref {
+ *               path deref(../pnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case ns {
+ *         container ns {
+ *           leaf nsd-id {
+ *             type leafref {
+ *               path ../../../../../nsd/id;
+ *             }
+ *           }
+ *           leaf sap-cpd-id {
+ *             type leafref {
+ *               path deref(../nsd-id)/../sapd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list nfpd {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf rule {
+ *       type string;
+ *     }
+ *     list position-desc-id {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       list cp-profile-id {
+ *         key id;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         list constituent-profile-elements {
+ *           key id;
+ *           leaf id {
+ *             type string;
+ *           }
+ *           leaf cpd-id {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd + * + *

To create instances of this class use {@link VnffgdBuilder}. + * @see VnffgdBuilder + * @see VnffgdKey + * + */ +public interface Vnffgd + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnffgd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd.class; + } + + /** + * Identifier of this Vnffgd information element. It uniquely identifies a VNFFGD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References the VnfProfile of a constituent VNF. + * + * + * + * @return java.util.List vnfProfileId, or null if not present + */ + @Nullable List getVnfProfileId(); + + /** + * References the PnfProfile of a constituent PNF. + * + * + * + * @return java.util.List pnfProfileId, or null if not present + */ + @Nullable List getPnfProfileId(); + + /** + * References the NsProfile of a nestedNS. + * + * + * + * @return java.util.List nestedNsProfileId, or null if not present + */ + @Nullable List getNestedNsProfileId(); + + /** + * References the Virtual Link Profile of a constituent VL. + * + * + * + * @return java.lang.String virtualLinkProfileId, or null if not present + */ + @Nullable String getVirtualLinkProfileId(); + + /** + * Describes a pool of descriptors of connection points attached to one of the + * constituent VNFs and PNFs and/or one of the SAPs of the parent NS or of a nested + * NS. + * + * + * + * @return java.util.Map cpdPool, or null if not present + */ + @Nullable Map getCpdPool(); + + /** + * @return java.util.Map cpdPool, or an empty list if it is not present + */ + default @NonNull Map nonnullCpdPool() { + return CodeHelpers.nonnull(getCpdPool()); + } + + /** + * The network forwarding path associated to the VNFFG. + * + * + * + * @return java.util.Map nfpd, or null if not present + */ + @Nullable Map getNfpd(); + + /** + * @return java.util.Map nfpd, or an empty list if it is not present + */ + default @NonNull Map nonnullNfpd() { + return CodeHelpers.nonnull(getNfpd()); + } + + @Override + VnffgdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdBuilder.java new file mode 100644 index 0000000..86c4024 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdBuilder.java @@ -0,0 +1,425 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPoolKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.Nfpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.NfpdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnffgdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnffgdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnffgdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnffgdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnffgdBuilder + * @see Builder + * + */ +public class VnffgdBuilder implements Builder { + + private Map _cpdPool; + private String _id; + private List _nestedNsProfileId; + private Map _nfpd; + private List _pnfProfileId; + private String _virtualLinkProfileId; + private List _vnfProfileId; + private VnffgdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnffgdBuilder() { + } + + public VnffgdBuilder(Vnffgd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._cpdPool = base.getCpdPool(); + this._nestedNsProfileId = base.getNestedNsProfileId(); + this._nfpd = base.getNfpd(); + this._pnfProfileId = base.getPnfProfileId(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._vnfProfileId = base.getVnfProfileId(); + } + + + public VnffgdKey key() { + return key; + } + + public Map getCpdPool() { + return _cpdPool; + } + + public String getId() { + return _id; + } + + public List getNestedNsProfileId() { + return _nestedNsProfileId; + } + + public Map getNfpd() { + return _nfpd; + } + + public List getPnfProfileId() { + return _pnfProfileId; + } + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + public List getVnfProfileId() { + return _vnfProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnffgdBuilder withKey(final VnffgdKey key) { + this.key = key; + return this; + } + public VnffgdBuilder setCpdPool(final Map values) { + this._cpdPool = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setCpdPool(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnffgdBuilder setCpdPool(final List values) { + return setCpdPool(CodeHelpers.compatMap(values)); + } + + public VnffgdBuilder setId(final String value) { + this._id = value; + return this; + } + public VnffgdBuilder setNestedNsProfileId(final List values) { + this._nestedNsProfileId = values; + return this; + } + + public VnffgdBuilder setNfpd(final Map values) { + this._nfpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNfpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnffgdBuilder setNfpd(final List values) { + return setNfpd(CodeHelpers.compatMap(values)); + } + public VnffgdBuilder setPnfProfileId(final List values) { + this._pnfProfileId = values; + return this; + } + + + public VnffgdBuilder setVirtualLinkProfileId(final String value) { + this._virtualLinkProfileId = value; + return this; + } + public VnffgdBuilder setVnfProfileId(final List values) { + this._vnfProfileId = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnffgdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnffgdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnffgdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnffgdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnffgd build() { + return new VnffgdImpl(this); + } + + private static final class VnffgdImpl + extends AbstractAugmentable + implements Vnffgd { + + private final Map _cpdPool; + private final String _id; + private final List _nestedNsProfileId; + private final Map _nfpd; + private final List _pnfProfileId; + private final String _virtualLinkProfileId; + private final List _vnfProfileId; + private final VnffgdKey key; + + VnffgdImpl(VnffgdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VnffgdKey(base.getId()); + } + this._id = key.getId(); + this._cpdPool = CodeHelpers.emptyToNull(base.getCpdPool()); + this._nestedNsProfileId = base.getNestedNsProfileId(); + this._nfpd = CodeHelpers.emptyToNull(base.getNfpd()); + this._pnfProfileId = base.getPnfProfileId(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._vnfProfileId = base.getVnfProfileId(); + } + + @Override + public VnffgdKey key() { + return key; + } + + @Override + public Map getCpdPool() { + return _cpdPool; + } + + @Override + public String getId() { + return _id; + } + + @Override + public List getNestedNsProfileId() { + return _nestedNsProfileId; + } + + @Override + public Map getNfpd() { + return _nfpd; + } + + @Override + public List getPnfProfileId() { + return _pnfProfileId; + } + + @Override + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + @Override + public List getVnfProfileId() { + return _vnfProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpdPool); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_nestedNsProfileId); + result = prime * result + Objects.hashCode(_nfpd); + result = prime * result + Objects.hashCode(_pnfProfileId); + result = prime * result + Objects.hashCode(_virtualLinkProfileId); + result = prime * result + Objects.hashCode(_vnfProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnffgd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnffgd other = (Vnffgd)obj; + if (!Objects.equals(_cpdPool, other.getCpdPool())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_nestedNsProfileId, other.getNestedNsProfileId())) { + return false; + } + if (!Objects.equals(_nfpd, other.getNfpd())) { + return false; + } + if (!Objects.equals(_pnfProfileId, other.getPnfProfileId())) { + return false; + } + if (!Objects.equals(_virtualLinkProfileId, other.getVirtualLinkProfileId())) { + return false; + } + if (!Objects.equals(_vnfProfileId, other.getVnfProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnffgdImpl otherImpl = (VnffgdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnffgd"); + CodeHelpers.appendValue(helper, "_cpdPool", _cpdPool); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_nestedNsProfileId", _nestedNsProfileId); + CodeHelpers.appendValue(helper, "_nfpd", _nfpd); + CodeHelpers.appendValue(helper, "_pnfProfileId", _pnfProfileId); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + CodeHelpers.appendValue(helper, "_vnfProfileId", _vnfProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdKey.java new file mode 100644 index 0000000..c41f4d3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VnffgdKey + implements Identifier { + private static final long serialVersionUID = -1143939609367754999L; + private final String _id; + + + public VnffgdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VnffgdKey(VnffgdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VnffgdKey)) { + return false; + } + final VnffgdKey other = (VnffgdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VnffgdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroup.java new file mode 100644 index 0000000..35b8b33 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroup.java @@ -0,0 +1,95 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies affinity or anti-affinity relationship applicable between the VNF + * instances created using different VNFDs, the Virtual Link instances created + * using different NsVirtualLinkDescs or the nested NS instances created using + * different NSDs in the same affinity or anti-affinity group. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf type {
+ *     type affinity-type;
+ *   }
+ *   leaf scope {
+ *     type affinity-scope;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/affinity-or-anti-affinity-group + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupBuilder}. + * @see AffinityOrAntiAffinityGroupBuilder + * @see AffinityOrAntiAffinityGroupKey + * + */ +public interface AffinityOrAntiAffinityGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroup.class; + } + + /** + * Identifier of Identifier of this AffinityOrAntiAffinityGroup information + * element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Specifies the type of relationship that the members of the group have: + * 'affinity' or 'anti-affinity.' + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType type, or null if not present + */ + @Nullable AffinityType getType(); + + /** + * Specifies the scope of the affinity or anti-affinity relationship e.g. a NFVI + * node, an NFVI PoP, etc. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope scope, or null if not present + */ + @Nullable AffinityScope getScope(); + + @Override + AffinityOrAntiAffinityGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupBuilder.java new file mode 100644 index 0000000..3df383c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupBuilder implements Builder { + + private String _id; + private AffinityScope _scope; + private AffinityType _type; + private AffinityOrAntiAffinityGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupBuilder() { + } + + public AffinityOrAntiAffinityGroupBuilder(AffinityOrAntiAffinityGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._scope = base.getScope(); + this._type = base.getType(); + } + + + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + public String getId() { + return _id; + } + + public AffinityScope getScope() { + return _scope; + } + + public AffinityType getType() { + return _type; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupBuilder withKey(final AffinityOrAntiAffinityGroupKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setId(final String value) { + this._id = value; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setScope(final AffinityScope value) { + this._scope = value; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setType(final AffinityType value) { + this._type = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroup build() { + return new AffinityOrAntiAffinityGroupImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroup { + + private final String _id; + private final AffinityScope _scope; + private final AffinityType _type; + private final AffinityOrAntiAffinityGroupKey key; + + AffinityOrAntiAffinityGroupImpl(AffinityOrAntiAffinityGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupKey(base.getId()); + } + this._id = key.getId(); + this._scope = base.getScope(); + this._type = base.getType(); + } + + @Override + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public AffinityScope getScope() { + return _scope; + } + + @Override + public AffinityType getType() { + return _type; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_scope); + result = prime * result + Objects.hashCode(_type); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroup other = (AffinityOrAntiAffinityGroup)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_scope, other.getScope())) { + return false; + } + if (!Objects.equals(_type, other.getType())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupImpl otherImpl = (AffinityOrAntiAffinityGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroup"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_scope", _scope); + CodeHelpers.appendValue(helper, "_type", _type); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupKey.java new file mode 100644 index 0000000..392a584 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupKey + implements Identifier { + private static final long serialVersionUID = -4909084403753675647L; + private final String _id; + + + public AffinityOrAntiAffinityGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupKey(AffinityOrAntiAffinityGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupKey)) { + return false; + } + final AffinityOrAntiAffinityGroupKey other = (AffinityOrAntiAffinityGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/Dependencies.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/Dependencies.java new file mode 100644 index 0000000..3cb4870 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/Dependencies.java @@ -0,0 +1,112 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the order in which instances of the VNFs and/or nested NSs have to be + * created. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list dependencies {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   choice primary-id {
+ *     case primary-vnf-profile {
+ *       leaf primary-vnf-profile {
+ *         type leafref {
+ *           path ../../vnf-profile/vnfd-id;
+ *         }
+ *       }
+ *     }
+ *     case primary-ns-profile {
+ *       leaf primary-ns-profile {
+ *         type leafref {
+ *           path ../../ns-profile/nsd-id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   choice secondary-id {
+ *     case secondary-vnf-profile {
+ *       leaf secondary-vnf-profile {
+ *         type leafref {
+ *           path ../../vnf-profile/vnfd-id;
+ *         }
+ *       }
+ *     }
+ *     case secondary-ns-profile {
+ *       leaf secondary-ns-profile {
+ *         type leafref {
+ *           path ../../ns-profile/nsd-id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/dependencies + * + *

To create instances of this class use {@link DependenciesBuilder}. + * @see DependenciesBuilder + * @see DependenciesKey + * + */ +public interface Dependencies + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("dependencies"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References a VnfProfile or NsProfile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId primaryId, or null if not present + */ + @Nullable PrimaryId getPrimaryId(); + + /** + * References a VnfProfile or NsProfile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId secondaryId, or null if not present + */ + @Nullable SecondaryId getSecondaryId(); + + @Override + DependenciesKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesBuilder.java new file mode 100644 index 0000000..1b96db5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link DependenciesBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DependenciesBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DependenciesBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DependenciesBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DependenciesBuilder + * @see Builder + * + */ +public class DependenciesBuilder implements Builder { + + private String _id; + private PrimaryId _primaryId; + private SecondaryId _secondaryId; + private DependenciesKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DependenciesBuilder() { + } + + public DependenciesBuilder(Dependencies base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._primaryId = base.getPrimaryId(); + this._secondaryId = base.getSecondaryId(); + } + + + public DependenciesKey key() { + return key; + } + + public String getId() { + return _id; + } + + public PrimaryId getPrimaryId() { + return _primaryId; + } + + public SecondaryId getSecondaryId() { + return _secondaryId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public DependenciesBuilder withKey(final DependenciesKey key) { + this.key = key; + return this; + } + + public DependenciesBuilder setId(final String value) { + this._id = value; + return this; + } + + public DependenciesBuilder setPrimaryId(final PrimaryId value) { + this._primaryId = value; + return this; + } + + public DependenciesBuilder setSecondaryId(final SecondaryId value) { + this._secondaryId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DependenciesBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DependenciesBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DependenciesBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DependenciesBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Dependencies build() { + return new DependenciesImpl(this); + } + + private static final class DependenciesImpl + extends AbstractAugmentable + implements Dependencies { + + private final String _id; + private final PrimaryId _primaryId; + private final SecondaryId _secondaryId; + private final DependenciesKey key; + + DependenciesImpl(DependenciesBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new DependenciesKey(base.getId()); + } + this._id = key.getId(); + this._primaryId = base.getPrimaryId(); + this._secondaryId = base.getSecondaryId(); + } + + @Override + public DependenciesKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public PrimaryId getPrimaryId() { + return _primaryId; + } + + @Override + public SecondaryId getSecondaryId() { + return _secondaryId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_primaryId); + result = prime * result + Objects.hashCode(_secondaryId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Dependencies.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Dependencies other = (Dependencies)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_primaryId, other.getPrimaryId())) { + return false; + } + if (!Objects.equals(_secondaryId, other.getSecondaryId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DependenciesImpl otherImpl = (DependenciesImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Dependencies"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_primaryId", _primaryId); + CodeHelpers.appendValue(helper, "_secondaryId", _secondaryId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesKey.java new file mode 100644 index 0000000..cd0980f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class DependenciesKey + implements Identifier { + private static final long serialVersionUID = -3074614359735867865L; + private final String _id; + + + public DependenciesKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public DependenciesKey(DependenciesKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DependenciesKey)) { + return false; + } + final DependenciesKey other = (DependenciesKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(DependenciesKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfo.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfo.java new file mode 100644 index 0000000..4624b0c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfo.java @@ -0,0 +1,100 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.VnfIndicatorInfo; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list monitored-info {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   container vnf-indicator-info {
+ *     leaf vnfd-id {
+ *       type leafref {
+ *         path ../../../../../vnfd/id;
+ *       }
+ *     }
+ *     leaf vnf-indicator {
+ *       type leafref {
+ *         path deref(../vnfd-id)/../indicator/id;
+ *       }
+ *     }
+ *   }
+ *   container monitoring-parameter {
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf performance-metric {
+ *       type string;
+ *     }
+ *     leaf collection-period {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/monitored-info + * + *

To create instances of this class use {@link MonitoredInfoBuilder}. + * @see MonitoredInfoBuilder + * @see MonitoredInfoKey + * + */ +public interface MonitoredInfo + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitored-info"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Uniquely identifies this VNF Indicator information element. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.VnfIndicatorInfo vnfIndicatorInfo, or null if not present + */ + @Nullable VnfIndicatorInfo getVnfIndicatorInfo(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.MonitoringParameter monitoringParameter, or null if not present + */ + @Nullable MonitoringParameter getMonitoringParameter(); + + @Override + MonitoredInfoKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoBuilder.java new file mode 100644 index 0000000..62b2f8e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.VnfIndicatorInfo; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link MonitoredInfoBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MonitoredInfoBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MonitoredInfoBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MonitoredInfoBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MonitoredInfoBuilder + * @see Builder + * + */ +public class MonitoredInfoBuilder implements Builder { + + private String _id; + private MonitoringParameter _monitoringParameter; + private VnfIndicatorInfo _vnfIndicatorInfo; + private MonitoredInfoKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MonitoredInfoBuilder() { + } + + public MonitoredInfoBuilder(MonitoredInfo base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._monitoringParameter = base.getMonitoringParameter(); + this._vnfIndicatorInfo = base.getVnfIndicatorInfo(); + } + + + public MonitoredInfoKey key() { + return key; + } + + public String getId() { + return _id; + } + + public MonitoringParameter getMonitoringParameter() { + return _monitoringParameter; + } + + public VnfIndicatorInfo getVnfIndicatorInfo() { + return _vnfIndicatorInfo; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public MonitoredInfoBuilder withKey(final MonitoredInfoKey key) { + this.key = key; + return this; + } + + public MonitoredInfoBuilder setId(final String value) { + this._id = value; + return this; + } + + public MonitoredInfoBuilder setMonitoringParameter(final MonitoringParameter value) { + this._monitoringParameter = value; + return this; + } + + public MonitoredInfoBuilder setVnfIndicatorInfo(final VnfIndicatorInfo value) { + this._vnfIndicatorInfo = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MonitoredInfoBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoredInfoBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MonitoredInfoBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MonitoredInfoBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MonitoredInfo build() { + return new MonitoredInfoImpl(this); + } + + private static final class MonitoredInfoImpl + extends AbstractAugmentable + implements MonitoredInfo { + + private final String _id; + private final MonitoringParameter _monitoringParameter; + private final VnfIndicatorInfo _vnfIndicatorInfo; + private final MonitoredInfoKey key; + + MonitoredInfoImpl(MonitoredInfoBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new MonitoredInfoKey(base.getId()); + } + this._id = key.getId(); + this._monitoringParameter = base.getMonitoringParameter(); + this._vnfIndicatorInfo = base.getVnfIndicatorInfo(); + } + + @Override + public MonitoredInfoKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public MonitoringParameter getMonitoringParameter() { + return _monitoringParameter; + } + + @Override + public VnfIndicatorInfo getVnfIndicatorInfo() { + return _vnfIndicatorInfo; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_monitoringParameter); + result = prime * result + Objects.hashCode(_vnfIndicatorInfo); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MonitoredInfo.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MonitoredInfo other = (MonitoredInfo)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_monitoringParameter, other.getMonitoringParameter())) { + return false; + } + if (!Objects.equals(_vnfIndicatorInfo, other.getVnfIndicatorInfo())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MonitoredInfoImpl otherImpl = (MonitoredInfoImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MonitoredInfo"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_monitoringParameter", _monitoringParameter); + CodeHelpers.appendValue(helper, "_vnfIndicatorInfo", _vnfIndicatorInfo); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoKey.java new file mode 100644 index 0000000..0a9d41b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class MonitoredInfoKey + implements Identifier { + private static final long serialVersionUID = -3390894449966734843L; + private final String _id; + + + public MonitoredInfoKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public MonitoredInfoKey(MonitoredInfoKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof MonitoredInfoKey)) { + return false; + } + final MonitoredInfoKey other = (MonitoredInfoKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(MonitoredInfoKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevel.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevel.java new file mode 100644 index 0000000..3c358f7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevel.java @@ -0,0 +1,173 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMappingKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the details of an NS level. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list ns-instantiation-level {
+ *   min-elements 1;
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list vnf-to-level-mapping {
+ *     key vnf-profile-id;
+ *     leaf vnf-profile-id {
+ *       type leafref {
+ *         path ../../../vnf-profile/id;
+ *       }
+ *     }
+ *     leaf number-of-instances {
+ *       default 1;
+ *       type uint32;
+ *     }
+ *   }
+ *   list virtual-link-to-level-mapping {
+ *     key virtual-link-profile-id;
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../../virtual-link-profile/id;
+ *       }
+ *     }
+ *     uses link-bitrate-requirements;
+ *   }
+ *   list ns-to-level-mapping {
+ *     key ns-profile-id;
+ *     leaf ns-profile-id {
+ *       type leafref {
+ *         path ../../../ns-profile/id;
+ *       }
+ *     }
+ *     leaf number-of-instances {
+ *       default 1;
+ *       type uint32;
+ *     }
+ *   }
+ *   must "(count(vnf-to-level-mapping) + count(virtual-link-to-level-mapping) + count(ns-to-level-mapping)) > 0" {
+ *     error-message
+ *       "At least one attribute between vnf-to-level-mapping, virtual-link-to-level-mapping and ns-to-level-mapping shall be present.";
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-instantiation-level + * + *

To create instances of this class use {@link NsInstantiationLevelBuilder}. + * @see NsInstantiationLevelBuilder + * @see NsInstantiationLevelKey + * + */ +public interface NsInstantiationLevel + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns-instantiation-level"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel.class; + } + + /** + * Identifier of this NsLevel information element. It uniquely identifies an NS + * level within the DF. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable description of the NS level. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Specifies the profile of the VNFs involved in this NS level and, for each of + * them, the required number of instances. + * + * + * + * @return java.util.Map vnfToLevelMapping, or null if not present + */ + @Nullable Map getVnfToLevelMapping(); + + /** + * @return java.util.Map vnfToLevelMapping, or an empty list if it is not present + */ + default @NonNull Map nonnullVnfToLevelMapping() { + return CodeHelpers.nonnull(getVnfToLevelMapping()); + } + + /** + * Specifies the profile of the VLs involved in this NS level and, for each of + * them, the needed bandwidth. + * + * + * + * @return java.util.Map virtualLinkToLevelMapping, or null if not present + */ + @Nullable Map getVirtualLinkToLevelMapping(); + + /** + * @return java.util.Map virtualLinkToLevelMapping, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkToLevelMapping() { + return CodeHelpers.nonnull(getVirtualLinkToLevelMapping()); + } + + /** + * Specifies the profile of the nested NSs involved in this NS level and, for each + * of them, the required number of instances. + * + * + * + * @return java.util.Map nsToLevelMapping, or null if not present + */ + @Nullable Map getNsToLevelMapping(); + + /** + * @return java.util.Map nsToLevelMapping, or an empty list if it is not present + */ + default @NonNull Map nonnullNsToLevelMapping() { + return CodeHelpers.nonnull(getNsToLevelMapping()); + } + + @Override + NsInstantiationLevelKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelBuilder.java new file mode 100644 index 0000000..9bd20c9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelBuilder.java @@ -0,0 +1,398 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMappingKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsInstantiationLevelBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsInstantiationLevelBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsInstantiationLevelBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsInstantiationLevelBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsInstantiationLevelBuilder + * @see Builder + * + */ +public class NsInstantiationLevelBuilder implements Builder { + + private String _description; + private String _id; + private Map _nsToLevelMapping; + private Map _virtualLinkToLevelMapping; + private Map _vnfToLevelMapping; + private NsInstantiationLevelKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsInstantiationLevelBuilder() { + } + + public NsInstantiationLevelBuilder(NsInstantiationLevel base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._description = base.getDescription(); + this._nsToLevelMapping = base.getNsToLevelMapping(); + this._virtualLinkToLevelMapping = base.getVirtualLinkToLevelMapping(); + this._vnfToLevelMapping = base.getVnfToLevelMapping(); + } + + + public NsInstantiationLevelKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public Map getNsToLevelMapping() { + return _nsToLevelMapping; + } + + public Map getVirtualLinkToLevelMapping() { + return _virtualLinkToLevelMapping; + } + + public Map getVnfToLevelMapping() { + return _vnfToLevelMapping; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsInstantiationLevelBuilder withKey(final NsInstantiationLevelKey key) { + this.key = key; + return this; + } + + public NsInstantiationLevelBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public NsInstantiationLevelBuilder setId(final String value) { + this._id = value; + return this; + } + public NsInstantiationLevelBuilder setNsToLevelMapping(final Map values) { + this._nsToLevelMapping = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsToLevelMapping(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder setNsToLevelMapping(final List values) { + return setNsToLevelMapping(CodeHelpers.compatMap(values)); + } + public NsInstantiationLevelBuilder setVirtualLinkToLevelMapping(final Map values) { + this._virtualLinkToLevelMapping = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkToLevelMapping(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder setVirtualLinkToLevelMapping(final List values) { + return setVirtualLinkToLevelMapping(CodeHelpers.compatMap(values)); + } + public NsInstantiationLevelBuilder setVnfToLevelMapping(final Map values) { + this._vnfToLevelMapping = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnfToLevelMapping(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder setVnfToLevelMapping(final List values) { + return setVnfToLevelMapping(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsInstantiationLevelBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsInstantiationLevelBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsInstantiationLevelBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NsInstantiationLevel build() { + return new NsInstantiationLevelImpl(this); + } + + private static final class NsInstantiationLevelImpl + extends AbstractAugmentable + implements NsInstantiationLevel { + + private final String _description; + private final String _id; + private final Map _nsToLevelMapping; + private final Map _virtualLinkToLevelMapping; + private final Map _vnfToLevelMapping; + private final NsInstantiationLevelKey key; + + NsInstantiationLevelImpl(NsInstantiationLevelBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsInstantiationLevelKey(base.getId()); + } + this._id = key.getId(); + this._description = base.getDescription(); + this._nsToLevelMapping = CodeHelpers.emptyToNull(base.getNsToLevelMapping()); + this._virtualLinkToLevelMapping = CodeHelpers.emptyToNull(base.getVirtualLinkToLevelMapping()); + this._vnfToLevelMapping = CodeHelpers.emptyToNull(base.getVnfToLevelMapping()); + } + + @Override + public NsInstantiationLevelKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getNsToLevelMapping() { + return _nsToLevelMapping; + } + + @Override + public Map getVirtualLinkToLevelMapping() { + return _virtualLinkToLevelMapping; + } + + @Override + public Map getVnfToLevelMapping() { + return _vnfToLevelMapping; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_nsToLevelMapping); + result = prime * result + Objects.hashCode(_virtualLinkToLevelMapping); + result = prime * result + Objects.hashCode(_vnfToLevelMapping); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NsInstantiationLevel.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NsInstantiationLevel other = (NsInstantiationLevel)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_nsToLevelMapping, other.getNsToLevelMapping())) { + return false; + } + if (!Objects.equals(_virtualLinkToLevelMapping, other.getVirtualLinkToLevelMapping())) { + return false; + } + if (!Objects.equals(_vnfToLevelMapping, other.getVnfToLevelMapping())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsInstantiationLevelImpl otherImpl = (NsInstantiationLevelImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NsInstantiationLevel"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_nsToLevelMapping", _nsToLevelMapping); + CodeHelpers.appendValue(helper, "_virtualLinkToLevelMapping", _virtualLinkToLevelMapping); + CodeHelpers.appendValue(helper, "_vnfToLevelMapping", _vnfToLevelMapping); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelKey.java new file mode 100644 index 0000000..8e7bbaf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsInstantiationLevelKey + implements Identifier { + private static final long serialVersionUID = -4181296861555412040L; + private final String _id; + + + public NsInstantiationLevelKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsInstantiationLevelKey(NsInstantiationLevelKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsInstantiationLevelKey)) { + return false; + } + final NsInstantiationLevelKey other = (NsInstantiationLevelKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsInstantiationLevelKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfile.java new file mode 100644 index 0000000..d4f852c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfile.java @@ -0,0 +1,208 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupIdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Specifies a NS Profile supported by this NS DF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list ns-profile {
+ *   must "min-number-of-instances <= max-number-of-instances" {
+ *     error-message
+ *       "min-number-of-instances has to be less than or equalmax-number-of-instances.";
+ *   }
+ *   must boolean(../../nested-nsd-id[.=current()/nsd-id]) {
+ *     error-message
+ *       "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *   }
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf nsd-id {
+ *     type leafref {
+ *       path ../../../../nsd/id;
+ *     }
+ *   }
+ *   leaf ns-df-id {
+ *     type leafref {
+ *       path deref(../nsd-id)/../df/id;
+ *     }
+ *   }
+ *   leaf instantiation-level-id {
+ *     type leafref {
+ *       path deref(../ns-df-id)/../ns-instantiation-level/id;
+ *     }
+ *   }
+ *   leaf min-number-of-instances {
+ *     type uint16;
+ *     default 1;
+ *   }
+ *   leaf max-number-of-instances {
+ *     type uint16;
+ *     default 1;
+ *   }
+ *   list affinity-or-anti-affinity-group-id {
+ *     key id;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../affinity-or-anti-affinity-group/id;
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-connectivity {
+ *     key virtual-link-profile-id;
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../../virtual-link-profile/id;
+ *       }
+ *     }
+ *     list constituent-cpd-id {
+ *       key constituent-base-element-id;
+ *       leaf constituent-base-element-id {
+ *         type leafref {
+ *           path ../../../id;
+ *         }
+ *       }
+ *       leaf constituent-cpd-id {
+ *         type leafref {
+ *           path deref(../../../nsd-id)/../sapd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-profile + * + *

To create instances of this class use {@link NsProfileBuilder}. + * @see NsProfileBuilder + * @see NsProfileKey + * + */ +public interface NsProfile + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile.class; + } + + /** + * Identifies an NS profile. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Identifies the NSD applicable to NS instantiated according to this profile. + * + * + * + * @return java.lang.String nsdId, or null if not present + */ + @Nullable String getNsdId(); + + /** + * Identifies the applicable network service DF within the scope of the NSD. + * + * + * + * @return java.lang.String nsDfId, or null if not present + */ + @Nullable String getNsDfId(); + + /** + * Identifies the NS level within the referenced NS DF to be used in the context of + * the parent NS instantiation. If not present, the default NS instantiation level + * as declared in the referenced NSD shall be used. + * + * + * + * @return java.lang.String instantiationLevelId, or null if not present + */ + @Nullable String getInstantiationLevelId(); + + /** + * Minimum number of nested NS instances based on the referenced NSD that is + * permitted to exist for this NsProfile. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 minNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMinNumberOfInstances(); + + /** + * Maximum number of nested NS instances based on the referenced NSD that is + * permitted to exist for this NsProfile. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 maxNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMaxNumberOfInstances(); + + /** + * Identifies an affinity or anti-affinity group the NSs created according to this + * NsProfile belongs to. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroupId, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroupId(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroupId, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroupId() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroupId()); + } + + /** + * @return java.util.Map virtualLinkConnectivity, or null if not present + */ + @Nullable Map getVirtualLinkConnectivity(); + + /** + * @return java.util.Map virtualLinkConnectivity, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkConnectivity() { + return CodeHelpers.nonnull(getVirtualLinkConnectivity()); + } + + @Override + NsProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileBuilder.java new file mode 100644 index 0000000..c97ef61 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileBuilder.java @@ -0,0 +1,474 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupIdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link NsProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsProfileBuilder + * @see Builder + * + */ +public class NsProfileBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroupId; + private String _id; + private String _instantiationLevelId; + private Uint16 _maxNumberOfInstances; + private Uint16 _minNumberOfInstances; + private String _nsDfId; + private String _nsdId; + private Map _virtualLinkConnectivity; + private NsProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsProfileBuilder() { + } + + public NsProfileBuilder(NsProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroupId = base.getAffinityOrAntiAffinityGroupId(); + this._instantiationLevelId = base.getInstantiationLevelId(); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + this._nsDfId = base.getNsDfId(); + this._nsdId = base.getNsdId(); + this._virtualLinkConnectivity = base.getVirtualLinkConnectivity(); + } + + + public NsProfileKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroupId() { + return _affinityOrAntiAffinityGroupId; + } + + public String getId() { + return _id; + } + + public String getInstantiationLevelId() { + return _instantiationLevelId; + } + + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + public String getNsDfId() { + return _nsDfId; + } + + public String getNsdId() { + return _nsdId; + } + + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsProfileBuilder withKey(final NsProfileKey key) { + this.key = key; + return this; + } + public NsProfileBuilder setAffinityOrAntiAffinityGroupId(final Map values) { + this._affinityOrAntiAffinityGroupId = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroupId(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setAffinityOrAntiAffinityGroupId(final List values) { + return setAffinityOrAntiAffinityGroupId(CodeHelpers.compatMap(values)); + } + + public NsProfileBuilder setId(final String value) { + this._id = value; + return this; + } + + public NsProfileBuilder setInstantiationLevelId(final String value) { + this._instantiationLevelId = value; + return this; + } + + public NsProfileBuilder setMaxNumberOfInstances(final Uint16 value) { + this._maxNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMaxNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setMaxNumberOfInstances(final Integer value) { + return setMaxNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public NsProfileBuilder setMinNumberOfInstances(final Uint16 value) { + this._minNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMinNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setMinNumberOfInstances(final Integer value) { + return setMinNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public NsProfileBuilder setNsDfId(final String value) { + this._nsDfId = value; + return this; + } + + public NsProfileBuilder setNsdId(final String value) { + this._nsdId = value; + return this; + } + public NsProfileBuilder setVirtualLinkConnectivity(final Map values) { + this._virtualLinkConnectivity = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkConnectivity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setVirtualLinkConnectivity(final List values) { + return setVirtualLinkConnectivity(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NsProfile build() { + return new NsProfileImpl(this); + } + + private static final class NsProfileImpl + extends AbstractAugmentable + implements NsProfile { + + private final Map _affinityOrAntiAffinityGroupId; + private final String _id; + private final String _instantiationLevelId; + private final Uint16 _maxNumberOfInstances; + private final Uint16 _minNumberOfInstances; + private final String _nsDfId; + private final String _nsdId; + private final Map _virtualLinkConnectivity; + private final NsProfileKey key; + + NsProfileImpl(NsProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsProfileKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroupId = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroupId()); + this._instantiationLevelId = base.getInstantiationLevelId(); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + this._nsDfId = base.getNsDfId(); + this._nsdId = base.getNsdId(); + this._virtualLinkConnectivity = CodeHelpers.emptyToNull(base.getVirtualLinkConnectivity()); + } + + @Override + public NsProfileKey key() { + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroupId() { + return _affinityOrAntiAffinityGroupId; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInstantiationLevelId() { + return _instantiationLevelId; + } + + @Override + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + @Override + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + @Override + public String getNsDfId() { + return _nsDfId; + } + + @Override + public String getNsdId() { + return _nsdId; + } + + @Override + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroupId); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_instantiationLevelId); + result = prime * result + Objects.hashCode(_maxNumberOfInstances); + result = prime * result + Objects.hashCode(_minNumberOfInstances); + result = prime * result + Objects.hashCode(_nsDfId); + result = prime * result + Objects.hashCode(_nsdId); + result = prime * result + Objects.hashCode(_virtualLinkConnectivity); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NsProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NsProfile other = (NsProfile)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroupId, other.getAffinityOrAntiAffinityGroupId())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_instantiationLevelId, other.getInstantiationLevelId())) { + return false; + } + if (!Objects.equals(_maxNumberOfInstances, other.getMaxNumberOfInstances())) { + return false; + } + if (!Objects.equals(_minNumberOfInstances, other.getMinNumberOfInstances())) { + return false; + } + if (!Objects.equals(_nsDfId, other.getNsDfId())) { + return false; + } + if (!Objects.equals(_nsdId, other.getNsdId())) { + return false; + } + if (!Objects.equals(_virtualLinkConnectivity, other.getVirtualLinkConnectivity())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsProfileImpl otherImpl = (NsProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NsProfile"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroupId", _affinityOrAntiAffinityGroupId); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_instantiationLevelId", _instantiationLevelId); + CodeHelpers.appendValue(helper, "_maxNumberOfInstances", _maxNumberOfInstances); + CodeHelpers.appendValue(helper, "_minNumberOfInstances", _minNumberOfInstances); + CodeHelpers.appendValue(helper, "_nsDfId", _nsDfId); + CodeHelpers.appendValue(helper, "_nsdId", _nsdId); + CodeHelpers.appendValue(helper, "_virtualLinkConnectivity", _virtualLinkConnectivity); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileKey.java new file mode 100644 index 0000000..29c5683 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsProfileKey + implements Identifier { + private static final long serialVersionUID = 5077089461983925448L; + private final String _id; + + + public NsProfileKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsProfileKey(NsProfileKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsProfileKey)) { + return false; + } + final NsProfileKey other = (NsProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfile.java new file mode 100644 index 0000000..85b64e5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfile.java @@ -0,0 +1,123 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list pnf-profile {
+ *   key id;
+ *   must boolean(../../pnfd-id[.=current()/pnfd-id]) {
+ *     error-message
+ *       "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *   }
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf pnfd-id {
+ *     type leafref {
+ *       path ../../../../pnfd/id;
+ *     }
+ *   }
+ *   list virtual-link-connectivity {
+ *     key virtual-link-profile-id;
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../../virtual-link-profile/id;
+ *       }
+ *     }
+ *     list constituent-cpd-id {
+ *       key constituent-base-element-id;
+ *       leaf constituent-base-element-id {
+ *         type leafref {
+ *           path ../../../id;
+ *         }
+ *       }
+ *       leaf constituent-cpd-id {
+ *         type leafref {
+ *           path deref(../../../pnfd-id)/../ext-cpd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/pnf-profile + * + *

To create instances of this class use {@link PnfProfileBuilder}. + * @see PnfProfileBuilder + * @see PnfProfileKey + * + */ +public interface PnfProfile + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfile.class; + } + + /** + * Identifier of this PnfProfile information element. It uniquely identifies a + * PnfProfile. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References a PNFD. + * + * + * + * @return java.lang.String pnfdId, or null if not present + */ + @Nullable String getPnfdId(); + + /** + * Defines the connection information of the PNF, it contains connection + * relationship between a PNF connection point and a NS Virtual Link. + * + * + * + * @return java.util.Map virtualLinkConnectivity, or null if not present + */ + @Nullable Map getVirtualLinkConnectivity(); + + /** + * @return java.util.Map virtualLinkConnectivity, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkConnectivity() { + return CodeHelpers.nonnull(getVirtualLinkConnectivity()); + } + + @Override + PnfProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileBuilder.java new file mode 100644 index 0000000..e6f61b6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileBuilder.java @@ -0,0 +1,314 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfProfileBuilder + * @see Builder + * + */ +public class PnfProfileBuilder implements Builder { + + private String _id; + private String _pnfdId; + private Map _virtualLinkConnectivity; + private PnfProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfProfileBuilder() { + } + + public PnfProfileBuilder(PnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._pnfdId = base.getPnfdId(); + this._virtualLinkConnectivity = base.getVirtualLinkConnectivity(); + } + + + public PnfProfileKey key() { + return key; + } + + public String getId() { + return _id; + } + + public String getPnfdId() { + return _pnfdId; + } + + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PnfProfileBuilder withKey(final PnfProfileKey key) { + this.key = key; + return this; + } + + public PnfProfileBuilder setId(final String value) { + this._id = value; + return this; + } + + public PnfProfileBuilder setPnfdId(final String value) { + this._pnfdId = value; + return this; + } + public PnfProfileBuilder setVirtualLinkConnectivity(final Map values) { + this._virtualLinkConnectivity = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkConnectivity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfProfileBuilder setVirtualLinkConnectivity(final List values) { + return setVirtualLinkConnectivity(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PnfProfile build() { + return new PnfProfileImpl(this); + } + + private static final class PnfProfileImpl + extends AbstractAugmentable + implements PnfProfile { + + private final String _id; + private final String _pnfdId; + private final Map _virtualLinkConnectivity; + private final PnfProfileKey key; + + PnfProfileImpl(PnfProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new PnfProfileKey(base.getId()); + } + this._id = key.getId(); + this._pnfdId = base.getPnfdId(); + this._virtualLinkConnectivity = CodeHelpers.emptyToNull(base.getVirtualLinkConnectivity()); + } + + @Override + public PnfProfileKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getPnfdId() { + return _pnfdId; + } + + @Override + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_pnfdId); + result = prime * result + Objects.hashCode(_virtualLinkConnectivity); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PnfProfile other = (PnfProfile)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_pnfdId, other.getPnfdId())) { + return false; + } + if (!Objects.equals(_virtualLinkConnectivity, other.getVirtualLinkConnectivity())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfProfileImpl otherImpl = (PnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PnfProfile"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_pnfdId", _pnfdId); + CodeHelpers.appendValue(helper, "_virtualLinkConnectivity", _virtualLinkConnectivity); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileKey.java new file mode 100644 index 0000000..aaf8e8e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class PnfProfileKey + implements Identifier { + private static final long serialVersionUID = 944242176321633264L; + private final String _id; + + + public PnfProfileKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public PnfProfileKey(PnfProfileKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof PnfProfileKey)) { + return false; + } + final PnfProfileKey other = (PnfProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(PnfProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspect.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspect.java new file mode 100644 index 0000000..66f4768 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspect.java @@ -0,0 +1,102 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The scaling aspects supported by this DF of the NS. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list scaling-aspect {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   leaf scaling-level {
+ *     type leafref {
+ *       path ../../ns-instantiation-level/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/scaling-aspect + * + *

To create instances of this class use {@link ScalingAspectBuilder}. + * @see ScalingAspectBuilder + * @see ScalingAspectKey + * + */ +public interface ScalingAspect + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scaling-aspect"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspect.class; + } + + /** + * Identifier of this NsScalingAspect information element. It uniquely identifies + * the NS scaling aspect in an NSD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Provides a human readable name of the NS scaling aspect. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Provides a human readable description of the NS scaling aspect. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Describes the details of an NS level. + * + * + * + * @return java.lang.String scalingLevel, or null if not present + */ + @Nullable String getScalingLevel(); + + @Override + ScalingAspectKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectBuilder.java new file mode 100644 index 0000000..139601d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectBuilder.java @@ -0,0 +1,317 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ScalingAspectBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ScalingAspectBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ScalingAspectBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ScalingAspectBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ScalingAspectBuilder + * @see Builder + * + */ +public class ScalingAspectBuilder implements Builder { + + private String _description; + private String _id; + private String _name; + private String _scalingLevel; + private ScalingAspectKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ScalingAspectBuilder() { + } + + public ScalingAspectBuilder(ScalingAspect base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._description = base.getDescription(); + this._name = base.getName(); + this._scalingLevel = base.getScalingLevel(); + } + + + public ScalingAspectKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public String getName() { + return _name; + } + + public String getScalingLevel() { + return _scalingLevel; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ScalingAspectBuilder withKey(final ScalingAspectKey key) { + this.key = key; + return this; + } + + public ScalingAspectBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public ScalingAspectBuilder setId(final String value) { + this._id = value; + return this; + } + + public ScalingAspectBuilder setName(final String value) { + this._name = value; + return this; + } + + public ScalingAspectBuilder setScalingLevel(final String value) { + this._scalingLevel = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ScalingAspectBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ScalingAspectBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ScalingAspectBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ScalingAspectBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ScalingAspect build() { + return new ScalingAspectImpl(this); + } + + private static final class ScalingAspectImpl + extends AbstractAugmentable + implements ScalingAspect { + + private final String _description; + private final String _id; + private final String _name; + private final String _scalingLevel; + private final ScalingAspectKey key; + + ScalingAspectImpl(ScalingAspectBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ScalingAspectKey(base.getId()); + } + this._id = key.getId(); + this._description = base.getDescription(); + this._name = base.getName(); + this._scalingLevel = base.getScalingLevel(); + } + + @Override + public ScalingAspectKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getScalingLevel() { + return _scalingLevel; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_scalingLevel); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ScalingAspect.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ScalingAspect other = (ScalingAspect)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_scalingLevel, other.getScalingLevel())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ScalingAspectImpl otherImpl = (ScalingAspectImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ScalingAspect"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_scalingLevel", _scalingLevel); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectKey.java new file mode 100644 index 0000000..f82c6b4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ScalingAspectKey + implements Identifier { + private static final long serialVersionUID = 2014464420224184770L; + private final String _id; + + + public ScalingAspectKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ScalingAspectKey(ScalingAspectKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ScalingAspectKey)) { + return false; + } + final ScalingAspectKey other = (ScalingAspectKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ScalingAspectKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfile.java new file mode 100644 index 0000000..01cf3f9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfile.java @@ -0,0 +1,151 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MaxBitrateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MinBitrateRequirements; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * VL profile to be used for the NS flavour. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-profile {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf virtual-link-desc-id {
+ *     type leafref {
+ *       path ../../../virtual-link-desc/id;
+ *     }
+ *   }
+ *   leaf flavour-id {
+ *     type leafref {
+ *       path deref(../virtual-link-desc-id)/../df/id;
+ *     }
+ *   }
+ *   uses local-affinity-or-anti-affinity-rule;
+ *   list affinity-or-anti-affinity-group {
+ *     key id;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../affinity-or-anti-affinity-group/id;
+ *       }
+ *     }
+ *   }
+ *   container max-bitrate-requirements {
+ *     uses link-bitrate-requirements;
+ *   }
+ *   container min-bitrate-requirements {
+ *     uses link-bitrate-requirements;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/virtual-link-profile + * + *

To create instances of this class use {@link VirtualLinkProfileBuilder}. + * @see VirtualLinkProfileBuilder + * @see VirtualLinkProfileKey + * + */ +public interface VirtualLinkProfile + extends + ChildOf, + Augmentable, + LocalAffinityOrAntiAffinityRule, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile.class; + } + + /** + * Uniquely identifies this VirtualLinkProfile information element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Uniquely references a VLD. + * + * + * + * @return java.lang.String virtualLinkDescId, or null if not present + */ + @Nullable String getVirtualLinkDescId(); + + /** + * Identifies a flavour within the VLD. + * + * + * + * @return java.lang.String flavourId, or null if not present + */ + @Nullable String getFlavourId(); + + /** + * Identifies an affinity or anti-affinity group the VLs instantiated according to + * the VlProfile belong to. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroup, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroup(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroup() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroup()); + } + + /** + * Specifies the maximum bitrate requirements for a VL instantiated according to + * this profile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MaxBitrateRequirements maxBitrateRequirements, or null if not present + */ + @Nullable MaxBitrateRequirements getMaxBitrateRequirements(); + + /** + * Specifies the minimum bitrate requirements for a VL instantiated according to + * this profile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MinBitrateRequirements minBitrateRequirements, or null if not present + */ + @Nullable MinBitrateRequirements getMinBitrateRequirements(); + + @Override + VirtualLinkProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileBuilder.java new file mode 100644 index 0000000..670a9ee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileBuilder.java @@ -0,0 +1,447 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MaxBitrateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MinBitrateRequirements; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkProfileBuilder + * @see Builder + * + */ +public class VirtualLinkProfileBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroup; + private String _flavourId; + private String _id; + private Map _localAffinityOrAntiAffinityRule; + private MaxBitrateRequirements _maxBitrateRequirements; + private MinBitrateRequirements _minBitrateRequirements; + private String _virtualLinkDescId; + private VirtualLinkProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkProfileBuilder() { + } + public VirtualLinkProfileBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule arg) { + this._localAffinityOrAntiAffinityRule = arg.getLocalAffinityOrAntiAffinityRule(); + } + + public VirtualLinkProfileBuilder(VirtualLinkProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroup = base.getAffinityOrAntiAffinityGroup(); + this._flavourId = base.getFlavourId(); + this._localAffinityOrAntiAffinityRule = base.getLocalAffinityOrAntiAffinityRule(); + this._maxBitrateRequirements = base.getMaxBitrateRequirements(); + this._minBitrateRequirements = base.getMinBitrateRequirements(); + this._virtualLinkDescId = base.getVirtualLinkDescId(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule) { + this._localAffinityOrAntiAffinityRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule)arg).getLocalAffinityOrAntiAffinityRule(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule]"); + } + + public VirtualLinkProfileKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + public String getFlavourId() { + return _flavourId; + } + + public String getId() { + return _id; + } + + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + public MaxBitrateRequirements getMaxBitrateRequirements() { + return _maxBitrateRequirements; + } + + public MinBitrateRequirements getMinBitrateRequirements() { + return _minBitrateRequirements; + } + + public String getVirtualLinkDescId() { + return _virtualLinkDescId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkProfileBuilder withKey(final VirtualLinkProfileKey key) { + this.key = key; + return this; + } + public VirtualLinkProfileBuilder setAffinityOrAntiAffinityGroup(final Map values) { + this._affinityOrAntiAffinityGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProfileBuilder setAffinityOrAntiAffinityGroup(final List values) { + return setAffinityOrAntiAffinityGroup(CodeHelpers.compatMap(values)); + } + + public VirtualLinkProfileBuilder setFlavourId(final String value) { + this._flavourId = value; + return this; + } + + public VirtualLinkProfileBuilder setId(final String value) { + this._id = value; + return this; + } + public VirtualLinkProfileBuilder setLocalAffinityOrAntiAffinityRule(final Map values) { + this._localAffinityOrAntiAffinityRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLocalAffinityOrAntiAffinityRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProfileBuilder setLocalAffinityOrAntiAffinityRule(final List values) { + return setLocalAffinityOrAntiAffinityRule(CodeHelpers.compatMap(values)); + } + + public VirtualLinkProfileBuilder setMaxBitrateRequirements(final MaxBitrateRequirements value) { + this._maxBitrateRequirements = value; + return this; + } + + public VirtualLinkProfileBuilder setMinBitrateRequirements(final MinBitrateRequirements value) { + this._minBitrateRequirements = value; + return this; + } + + public VirtualLinkProfileBuilder setVirtualLinkDescId(final String value) { + this._virtualLinkDescId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkProfile build() { + return new VirtualLinkProfileImpl(this); + } + + private static final class VirtualLinkProfileImpl + extends AbstractAugmentable + implements VirtualLinkProfile { + + private final Map _affinityOrAntiAffinityGroup; + private final String _flavourId; + private final String _id; + private final Map _localAffinityOrAntiAffinityRule; + private final MaxBitrateRequirements _maxBitrateRequirements; + private final MinBitrateRequirements _minBitrateRequirements; + private final String _virtualLinkDescId; + private final VirtualLinkProfileKey key; + + VirtualLinkProfileImpl(VirtualLinkProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkProfileKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroup = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroup()); + this._flavourId = base.getFlavourId(); + this._localAffinityOrAntiAffinityRule = CodeHelpers.emptyToNull(base.getLocalAffinityOrAntiAffinityRule()); + this._maxBitrateRequirements = base.getMaxBitrateRequirements(); + this._minBitrateRequirements = base.getMinBitrateRequirements(); + this._virtualLinkDescId = base.getVirtualLinkDescId(); + } + + @Override + public VirtualLinkProfileKey key() { + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + @Override + public String getFlavourId() { + return _flavourId; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + @Override + public MaxBitrateRequirements getMaxBitrateRequirements() { + return _maxBitrateRequirements; + } + + @Override + public MinBitrateRequirements getMinBitrateRequirements() { + return _minBitrateRequirements; + } + + @Override + public String getVirtualLinkDescId() { + return _virtualLinkDescId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroup); + result = prime * result + Objects.hashCode(_flavourId); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_localAffinityOrAntiAffinityRule); + result = prime * result + Objects.hashCode(_maxBitrateRequirements); + result = prime * result + Objects.hashCode(_minBitrateRequirements); + result = prime * result + Objects.hashCode(_virtualLinkDescId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkProfile other = (VirtualLinkProfile)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroup, other.getAffinityOrAntiAffinityGroup())) { + return false; + } + if (!Objects.equals(_flavourId, other.getFlavourId())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_localAffinityOrAntiAffinityRule, other.getLocalAffinityOrAntiAffinityRule())) { + return false; + } + if (!Objects.equals(_maxBitrateRequirements, other.getMaxBitrateRequirements())) { + return false; + } + if (!Objects.equals(_minBitrateRequirements, other.getMinBitrateRequirements())) { + return false; + } + if (!Objects.equals(_virtualLinkDescId, other.getVirtualLinkDescId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkProfileImpl otherImpl = (VirtualLinkProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkProfile"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroup", _affinityOrAntiAffinityGroup); + CodeHelpers.appendValue(helper, "_flavourId", _flavourId); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_localAffinityOrAntiAffinityRule", _localAffinityOrAntiAffinityRule); + CodeHelpers.appendValue(helper, "_maxBitrateRequirements", _maxBitrateRequirements); + CodeHelpers.appendValue(helper, "_minBitrateRequirements", _minBitrateRequirements); + CodeHelpers.appendValue(helper, "_virtualLinkDescId", _virtualLinkDescId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileKey.java new file mode 100644 index 0000000..5740e6f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VirtualLinkProfileKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkProfileKey + implements Identifier { + private static final long serialVersionUID = 148998297787905589L; + private final String _id; + + + public VirtualLinkProfileKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkProfileKey(VirtualLinkProfileKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkProfileKey)) { + return false; + } + final VirtualLinkProfileKey other = (VirtualLinkProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfile.java new file mode 100644 index 0000000..bd849a0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfile.java @@ -0,0 +1,222 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdBuilder.NsdImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfileBuilder.VnfProfileImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * VNF profile to be used for the NS flavour. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vnf-profile {
+ *   must "min-number-of-instances <= max-number-of-instances";
+ *   must boolean(../../vnfd-id[.=current()/vnfd-id]) {
+ *     error-message
+ *       "VNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *   }
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf vnfd-id {
+ *     type leafref {
+ *       path ../../../../vnfd/id;
+ *     }
+ *   }
+ *   leaf flavour-id {
+ *     type leafref {
+ *       path deref(../vnfd-id)/../df/id;
+ *     }
+ *   }
+ *   leaf instantiation-level {
+ *     type leafref {
+ *       path deref(../flavour-id)/../instantiation-level/id;
+ *     }
+ *   }
+ *   leaf min-number-of-instances {
+ *     default 1;
+ *     type uint16;
+ *   }
+ *   leaf max-number-of-instances {
+ *     default 1;
+ *     type uint16;
+ *   }
+ *   uses local-affinity-or-anti-affinity-rule;
+ *   list affinity-or-anti-affinity-group {
+ *     key id;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../affinity-or-anti-affinity-group/id;
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-connectivity {
+ *     key virtual-link-profile-id;
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../../virtual-link-profile/id;
+ *       }
+ *     }
+ *     list constituent-cpd-id {
+ *       key constituent-base-element-id;
+ *       leaf constituent-base-element-id {
+ *         type leafref {
+ *           path ../../../id;
+ *         }
+ *       }
+ *       leaf constituent-cpd-id {
+ *         type leafref {
+ *           path deref(../../../vnfd-id)/../ext-cpd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/vnf-profile + * + *

To create instances of this class use {@link VnfProfileBuilder}. + * @see VnfProfileBuilder + * @see VnfProfileKey + * + */ +@JsonDeserialize(as = VnfProfileImpl.class) +@JsonIgnoreProperties(value = {"localAffinityOrAntiAffinityRule"}, ignoreUnknown = true) +//@JsonIgnoreProperties(value= {"virtualStorageDesc","extCpd","securityGroupRule","indicator","swImageDesc"}, ignoreUnknown = true) +public interface VnfProfile + extends + ChildOf, + Augmentable, + LocalAffinityOrAntiAffinityRule, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile.class; + } + + /** + * Identifier of this vnfProfile information element. It uniquely identifies a + * VnfProfile. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References a VNFD. + * + * + * + * @return java.lang.String vnfdId, or null if not present + */ + @Nullable String getVnfdId(); + + /** + * Identifies a flavour within the VNFD. + * + * + * + * @return java.lang.String flavourId, or null if not present + */ + @Nullable String getFlavourId(); + + /** + * Identifier of the instantiation level of the VNF DF to be used for + * instantiation. If not present, the default instantiation level as declared in + * the VNFD shall be used. + * + * + * + * @return java.lang.String instantiationLevel, or null if not present + */ + @Nullable String getInstantiationLevel(); + + /** + * Minimum number of instances of the VNF based on this VNFD that is permitted to + * exist for this VnfProfile. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 minNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMinNumberOfInstances(); + + /** + * Maximum number of instances of the VNF based on this VNFD that is permitted to + * exist for this VnfProfile. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 maxNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMaxNumberOfInstances(); + + /** + * Identifier(s) of the affinity or anti-affinity group(s) the VnfProfile belongs + * to. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroup, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroup(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroup() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroup()); + } + + /** + * Defines the connection information of the VNF, it contains connection + * relationship between a VNF connection point and a NS Virtual Link. + * + * + * + * @return java.util.Map virtualLinkConnectivity, or null if not present + */ + @Nullable Map getVirtualLinkConnectivity(); + + /** + * @return java.util.Map virtualLinkConnectivity, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkConnectivity() { + return CodeHelpers.nonnull(getVirtualLinkConnectivity()); + } + + @Override + VnfProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileBuilder.java new file mode 100644 index 0000000..f778bc0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileBuilder.java @@ -0,0 +1,545 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdBuilder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link VnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfProfileBuilder + * @see Builder + * + */ +public class VnfProfileBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroup; + private String _flavourId; + private String _id; + private String _instantiationLevel; + private Map _localAffinityOrAntiAffinityRule; + private Uint16 _maxNumberOfInstances; + private Uint16 _minNumberOfInstances; + private Map _virtualLinkConnectivity; + private String _vnfdId; + private VnfProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfProfileBuilder() { + } + public VnfProfileBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule arg) { + this._localAffinityOrAntiAffinityRule = arg.getLocalAffinityOrAntiAffinityRule(); + } + + public VnfProfileBuilder(VnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroup = base.getAffinityOrAntiAffinityGroup(); + this._flavourId = base.getFlavourId(); + this._instantiationLevel = base.getInstantiationLevel(); + this._localAffinityOrAntiAffinityRule = base.getLocalAffinityOrAntiAffinityRule(); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + this._virtualLinkConnectivity = base.getVirtualLinkConnectivity(); + this._vnfdId = base.getVnfdId(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule) { + this._localAffinityOrAntiAffinityRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule)arg).getLocalAffinityOrAntiAffinityRule(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule]"); + } + + public VnfProfileKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + public String getFlavourId() { + return _flavourId; + } + + public String getId() { + return _id; + } + + public String getInstantiationLevel() { + return _instantiationLevel; + } + + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + public String getVnfdId() { + return _vnfdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnfProfileBuilder withKey(final VnfProfileKey key) { + this.key = key; + return this; + } + public VnfProfileBuilder setAffinityOrAntiAffinityGroup(final Map values) { + this._affinityOrAntiAffinityGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder setAffinityOrAntiAffinityGroup(final List values) { + return setAffinityOrAntiAffinityGroup(CodeHelpers.compatMap(values)); + } + + public VnfProfileBuilder setFlavourId(final String value) { + this._flavourId = value; + return this; + } + + public VnfProfileBuilder setId(final String value) { + this._id = value; + return this; + } + + public VnfProfileBuilder setInstantiationLevel(final String value) { + this._instantiationLevel = value; + return this; + } + public VnfProfileBuilder setLocalAffinityOrAntiAffinityRule(final Map values) { + this._localAffinityOrAntiAffinityRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLocalAffinityOrAntiAffinityRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder setLocalAffinityOrAntiAffinityRule(final List values) { + return setLocalAffinityOrAntiAffinityRule(CodeHelpers.compatMap(values)); + } + + public VnfProfileBuilder setMaxNumberOfInstances(final Uint16 value) { + this._maxNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMaxNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder setMaxNumberOfInstances(final Integer value) { + return setMaxNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public VnfProfileBuilder setMinNumberOfInstances(final Uint16 value) { + this._minNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMinNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder setMinNumberOfInstances(final Integer value) { + return setMinNumberOfInstances(CodeHelpers.compatUint(value)); + } + public VnfProfileBuilder setVirtualLinkConnectivity(final Map values) { + this._virtualLinkConnectivity = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkConnectivity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder setVirtualLinkConnectivity(final List values) { + return setVirtualLinkConnectivity(CodeHelpers.compatMap(values)); + } + + public VnfProfileBuilder setVnfdId(final String value) { + this._vnfdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VnfProfile build() { + return new VnfProfileImpl(this); + } + + public static final class VnfProfileImpl + extends AbstractAugmentable + implements VnfProfile { + + private final Map _affinityOrAntiAffinityGroup; + private final String _flavourId; + @JsonProperty("id") + private final String _id; + private final String _instantiationLevel; + private final Map _localAffinityOrAntiAffinityRule; + private final Uint16 _maxNumberOfInstances; + private final Uint16 _minNumberOfInstances; + private final Map _virtualLinkConnectivity; + @JsonProperty("vnfd-id") + private final String _vnfdId; + private VnfProfileKey key; + + VnfProfileImpl(VnfProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VnfProfileKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroup = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroup()); + this._flavourId = base.getFlavourId(); + this._instantiationLevel = base.getInstantiationLevel(); + this._localAffinityOrAntiAffinityRule = CodeHelpers.emptyToNull(base.getLocalAffinityOrAntiAffinityRule()); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + this._virtualLinkConnectivity = CodeHelpers.emptyToNull(base.getVirtualLinkConnectivity()); + this._vnfdId = base.getVnfdId(); + } + + public VnfProfileImpl(){ + this( new VnfProfileBuilder() ); + } + + @Override + public VnfProfileKey key() { + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + @Override + public String getFlavourId() { + return _flavourId; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInstantiationLevel() { + return _instantiationLevel; + } + + @Override + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + @Override + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + @Override + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + @Override + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + @Override + public String getVnfdId() { + return _vnfdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroup); + result = prime * result + Objects.hashCode(_flavourId); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_instantiationLevel); + result = prime * result + Objects.hashCode(_localAffinityOrAntiAffinityRule); + result = prime * result + Objects.hashCode(_maxNumberOfInstances); + result = prime * result + Objects.hashCode(_minNumberOfInstances); + result = prime * result + Objects.hashCode(_virtualLinkConnectivity); + result = prime * result + Objects.hashCode(_vnfdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VnfProfile other = (VnfProfile)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroup, other.getAffinityOrAntiAffinityGroup())) { + return false; + } + if (!Objects.equals(_flavourId, other.getFlavourId())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_instantiationLevel, other.getInstantiationLevel())) { + return false; + } + if (!Objects.equals(_localAffinityOrAntiAffinityRule, other.getLocalAffinityOrAntiAffinityRule())) { + return false; + } + if (!Objects.equals(_maxNumberOfInstances, other.getMaxNumberOfInstances())) { + return false; + } + if (!Objects.equals(_minNumberOfInstances, other.getMinNumberOfInstances())) { + return false; + } + if (!Objects.equals(_virtualLinkConnectivity, other.getVirtualLinkConnectivity())) { + return false; + } + if (!Objects.equals(_vnfdId, other.getVnfdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfProfileImpl otherImpl = (VnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VnfProfile"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroup", _affinityOrAntiAffinityGroup); + CodeHelpers.appendValue(helper, "_flavourId", _flavourId); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_instantiationLevel", _instantiationLevel); + CodeHelpers.appendValue(helper, "_localAffinityOrAntiAffinityRule", _localAffinityOrAntiAffinityRule); + CodeHelpers.appendValue(helper, "_maxNumberOfInstances", _maxNumberOfInstances); + CodeHelpers.appendValue(helper, "_minNumberOfInstances", _minNumberOfInstances); + CodeHelpers.appendValue(helper, "_virtualLinkConnectivity", _virtualLinkConnectivity); + CodeHelpers.appendValue(helper, "_vnfdId", _vnfdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileKey.java new file mode 100644 index 0000000..52388b1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/VnfProfileKey.java @@ -0,0 +1,76 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.KeyDeserializer; +import com.google.common.base.MoreObjects; + +import java.io.IOException; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VnfProfileKey extends KeyDeserializer + implements Identifier { + private static final long serialVersionUID = -691004659524246111L; + private final String _id; + + public VnfProfileKey() { + // This might be also null, or not id/flavor not final. + this._id = ""; + } + + public VnfProfileKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VnfProfileKey(VnfProfileKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VnfProfileKey)) { + return false; + } + final VnfProfileKey other = (VnfProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VnfProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } + + @Override + public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException { + // TODO Auto-generated method stub + return this.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/PrimaryId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/PrimaryId.java new file mode 100644 index 0000000..7543985 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/PrimaryId.java @@ -0,0 +1,45 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * References a VnfProfile or NsProfile. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * choice primary-id {
+ *   case primary-vnf-profile {
+ *     leaf primary-vnf-profile {
+ *       type leafref {
+ *         path ../../vnf-profile/vnfd-id;
+ *       }
+ *     }
+ *   }
+ *   case primary-ns-profile {
+ *     leaf primary-ns-profile {
+ *       type leafref {
+ *         path ../../ns-profile/nsd-id;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/dependencies/primary-id + * + */ +public interface PrimaryId + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("primary-id"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/SecondaryId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/SecondaryId.java new file mode 100644 index 0000000..b702fde --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/SecondaryId.java @@ -0,0 +1,45 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * References a VnfProfile or NsProfile. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * choice secondary-id {
+ *   case secondary-vnf-profile {
+ *     leaf secondary-vnf-profile {
+ *       type leafref {
+ *         path ../../vnf-profile/vnfd-id;
+ *       }
+ *     }
+ *   }
+ *   case secondary-ns-profile {
+ *     leaf secondary-ns-profile {
+ *       type leafref {
+ *         path ../../ns-profile/nsd-id;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/dependencies/secondary-id + * + */ +public interface SecondaryId + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("secondary-id"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfile.java new file mode 100644 index 0000000..fbf11c0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfile.java @@ -0,0 +1,35 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.primary.id; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface PrimaryNsProfile + extends + DataObject, + Augmentable, + PrimaryId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("primary-ns-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.primary.id.PrimaryNsProfile.class; + } + + /** + * @return java.lang.String primaryNsProfile, or null if not present + */ + @Nullable String getPrimaryNsProfile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfileBuilder.java new file mode 100644 index 0000000..8fee129 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryNsProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.primary.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PrimaryNsProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PrimaryNsProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PrimaryNsProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PrimaryNsProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PrimaryNsProfileBuilder + * @see Builder + * + */ +public class PrimaryNsProfileBuilder implements Builder { + + private String _primaryNsProfile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PrimaryNsProfileBuilder() { + } + + public PrimaryNsProfileBuilder(PrimaryNsProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._primaryNsProfile = base.getPrimaryNsProfile(); + } + + + public String getPrimaryNsProfile() { + return _primaryNsProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PrimaryNsProfileBuilder setPrimaryNsProfile(final String value) { + this._primaryNsProfile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PrimaryNsProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PrimaryNsProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PrimaryNsProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PrimaryNsProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PrimaryNsProfile build() { + return new PrimaryNsProfileImpl(this); + } + + private static final class PrimaryNsProfileImpl + extends AbstractAugmentable + implements PrimaryNsProfile { + + private final String _primaryNsProfile; + + PrimaryNsProfileImpl(PrimaryNsProfileBuilder base) { + super(base.augmentation); + this._primaryNsProfile = base.getPrimaryNsProfile(); + } + + @Override + public String getPrimaryNsProfile() { + return _primaryNsProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_primaryNsProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PrimaryNsProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PrimaryNsProfile other = (PrimaryNsProfile)obj; + if (!Objects.equals(_primaryNsProfile, other.getPrimaryNsProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PrimaryNsProfileImpl otherImpl = (PrimaryNsProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PrimaryNsProfile"); + CodeHelpers.appendValue(helper, "_primaryNsProfile", _primaryNsProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfile.java new file mode 100644 index 0000000..41ade67 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfile.java @@ -0,0 +1,35 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.primary.id; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface PrimaryVnfProfile + extends + DataObject, + Augmentable, + PrimaryId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("primary-vnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.primary.id.PrimaryVnfProfile.class; + } + + /** + * @return java.lang.String primaryVnfProfile, or null if not present + */ + @Nullable String getPrimaryVnfProfile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfileBuilder.java new file mode 100644 index 0000000..daad791 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/primary/id/PrimaryVnfProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.primary.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PrimaryVnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PrimaryVnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PrimaryVnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PrimaryVnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PrimaryVnfProfileBuilder + * @see Builder + * + */ +public class PrimaryVnfProfileBuilder implements Builder { + + private String _primaryVnfProfile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PrimaryVnfProfileBuilder() { + } + + public PrimaryVnfProfileBuilder(PrimaryVnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._primaryVnfProfile = base.getPrimaryVnfProfile(); + } + + + public String getPrimaryVnfProfile() { + return _primaryVnfProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PrimaryVnfProfileBuilder setPrimaryVnfProfile(final String value) { + this._primaryVnfProfile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PrimaryVnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PrimaryVnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PrimaryVnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PrimaryVnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PrimaryVnfProfile build() { + return new PrimaryVnfProfileImpl(this); + } + + private static final class PrimaryVnfProfileImpl + extends AbstractAugmentable + implements PrimaryVnfProfile { + + private final String _primaryVnfProfile; + + PrimaryVnfProfileImpl(PrimaryVnfProfileBuilder base) { + super(base.augmentation); + this._primaryVnfProfile = base.getPrimaryVnfProfile(); + } + + @Override + public String getPrimaryVnfProfile() { + return _primaryVnfProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_primaryVnfProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PrimaryVnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PrimaryVnfProfile other = (PrimaryVnfProfile)obj; + if (!Objects.equals(_primaryVnfProfile, other.getPrimaryVnfProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PrimaryVnfProfileImpl otherImpl = (PrimaryVnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PrimaryVnfProfile"); + CodeHelpers.appendValue(helper, "_primaryVnfProfile", _primaryVnfProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfile.java new file mode 100644 index 0000000..c81477f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfile.java @@ -0,0 +1,35 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.secondary.id; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface SecondaryNsProfile + extends + DataObject, + Augmentable, + SecondaryId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("secondary-ns-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.secondary.id.SecondaryNsProfile.class; + } + + /** + * @return java.lang.String secondaryNsProfile, or null if not present + */ + @Nullable String getSecondaryNsProfile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfileBuilder.java new file mode 100644 index 0000000..a08a7de --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryNsProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.secondary.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link SecondaryNsProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SecondaryNsProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SecondaryNsProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SecondaryNsProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SecondaryNsProfileBuilder + * @see Builder + * + */ +public class SecondaryNsProfileBuilder implements Builder { + + private String _secondaryNsProfile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SecondaryNsProfileBuilder() { + } + + public SecondaryNsProfileBuilder(SecondaryNsProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._secondaryNsProfile = base.getSecondaryNsProfile(); + } + + + public String getSecondaryNsProfile() { + return _secondaryNsProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public SecondaryNsProfileBuilder setSecondaryNsProfile(final String value) { + this._secondaryNsProfile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SecondaryNsProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SecondaryNsProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SecondaryNsProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SecondaryNsProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public SecondaryNsProfile build() { + return new SecondaryNsProfileImpl(this); + } + + private static final class SecondaryNsProfileImpl + extends AbstractAugmentable + implements SecondaryNsProfile { + + private final String _secondaryNsProfile; + + SecondaryNsProfileImpl(SecondaryNsProfileBuilder base) { + super(base.augmentation); + this._secondaryNsProfile = base.getSecondaryNsProfile(); + } + + @Override + public String getSecondaryNsProfile() { + return _secondaryNsProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_secondaryNsProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!SecondaryNsProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + SecondaryNsProfile other = (SecondaryNsProfile)obj; + if (!Objects.equals(_secondaryNsProfile, other.getSecondaryNsProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SecondaryNsProfileImpl otherImpl = (SecondaryNsProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("SecondaryNsProfile"); + CodeHelpers.appendValue(helper, "_secondaryNsProfile", _secondaryNsProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfile.java new file mode 100644 index 0000000..6742ded --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfile.java @@ -0,0 +1,35 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.secondary.id; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface SecondaryVnfProfile + extends + DataObject, + Augmentable, + SecondaryId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("secondary-vnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.secondary.id.SecondaryVnfProfile.class; + } + + /** + * @return java.lang.String secondaryVnfProfile, or null if not present + */ + @Nullable String getSecondaryVnfProfile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfileBuilder.java new file mode 100644 index 0000000..7084d29 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/dependencies/secondary/id/SecondaryVnfProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.secondary.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link SecondaryVnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SecondaryVnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SecondaryVnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SecondaryVnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SecondaryVnfProfileBuilder + * @see Builder + * + */ +public class SecondaryVnfProfileBuilder implements Builder { + + private String _secondaryVnfProfile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SecondaryVnfProfileBuilder() { + } + + public SecondaryVnfProfileBuilder(SecondaryVnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._secondaryVnfProfile = base.getSecondaryVnfProfile(); + } + + + public String getSecondaryVnfProfile() { + return _secondaryVnfProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public SecondaryVnfProfileBuilder setSecondaryVnfProfile(final String value) { + this._secondaryVnfProfile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SecondaryVnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SecondaryVnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SecondaryVnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SecondaryVnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public SecondaryVnfProfile build() { + return new SecondaryVnfProfileImpl(this); + } + + private static final class SecondaryVnfProfileImpl + extends AbstractAugmentable + implements SecondaryVnfProfile { + + private final String _secondaryVnfProfile; + + SecondaryVnfProfileImpl(SecondaryVnfProfileBuilder base) { + super(base.augmentation); + this._secondaryVnfProfile = base.getSecondaryVnfProfile(); + } + + @Override + public String getSecondaryVnfProfile() { + return _secondaryVnfProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_secondaryVnfProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!SecondaryVnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + SecondaryVnfProfile other = (SecondaryVnfProfile)obj; + if (!Objects.equals(_secondaryVnfProfile, other.getSecondaryVnfProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SecondaryVnfProfileImpl otherImpl = (SecondaryVnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("SecondaryVnfProfile"); + CodeHelpers.appendValue(helper, "_secondaryVnfProfile", _secondaryVnfProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameter.java new file mode 100644 index 0000000..919144f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameter.java @@ -0,0 +1,92 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container monitoring-parameter {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf performance-metric {
+ *     type string;
+ *   }
+ *   leaf collection-period {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/monitored-info/monitoring-parameter + * + *

To create instances of this class use {@link MonitoringParameterBuilder}. + * @see MonitoringParameterBuilder + * + */ +public interface MonitoringParameter + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitoring-parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.MonitoringParameter.class; + } + + /** + * Unique identifier of this monitoring parameter information element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable name of the monitoring parameter. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Defines the virtualised resource-related performance metric. + * + * + * + * @return java.lang.String performanceMetric, or null if not present + */ + @Nullable String getPerformanceMetric(); + + /** + * An attribute that describes the periodicity at which to collect the performance + * information. + * + * + * + * @return java.lang.String collectionPeriod, or null if not present + */ + @Nullable String getCollectionPeriod(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameterBuilder.java new file mode 100644 index 0000000..604f4a4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/MonitoringParameterBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link MonitoringParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MonitoringParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MonitoringParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MonitoringParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MonitoringParameterBuilder + * @see Builder + * + */ +public class MonitoringParameterBuilder implements Builder { + + private String _collectionPeriod; + private String _id; + private String _name; + private String _performanceMetric; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MonitoringParameterBuilder() { + } + + public MonitoringParameterBuilder(MonitoringParameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._collectionPeriod = base.getCollectionPeriod(); + this._id = base.getId(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + + public String getCollectionPeriod() { + return _collectionPeriod; + } + + public String getId() { + return _id; + } + + public String getName() { + return _name; + } + + public String getPerformanceMetric() { + return _performanceMetric; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public MonitoringParameterBuilder setCollectionPeriod(final String value) { + this._collectionPeriod = value; + return this; + } + + public MonitoringParameterBuilder setId(final String value) { + this._id = value; + return this; + } + + public MonitoringParameterBuilder setName(final String value) { + this._name = value; + return this; + } + + public MonitoringParameterBuilder setPerformanceMetric(final String value) { + this._performanceMetric = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MonitoringParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoringParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MonitoringParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MonitoringParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MonitoringParameter build() { + return new MonitoringParameterImpl(this); + } + + private static final class MonitoringParameterImpl + extends AbstractAugmentable + implements MonitoringParameter { + + private final String _collectionPeriod; + private final String _id; + private final String _name; + private final String _performanceMetric; + + MonitoringParameterImpl(MonitoringParameterBuilder base) { + super(base.augmentation); + this._collectionPeriod = base.getCollectionPeriod(); + this._id = base.getId(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + @Override + public String getCollectionPeriod() { + return _collectionPeriod; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getPerformanceMetric() { + return _performanceMetric; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_collectionPeriod); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_performanceMetric); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MonitoringParameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MonitoringParameter other = (MonitoringParameter)obj; + if (!Objects.equals(_collectionPeriod, other.getCollectionPeriod())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_performanceMetric, other.getPerformanceMetric())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MonitoringParameterImpl otherImpl = (MonitoringParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MonitoringParameter"); + CodeHelpers.appendValue(helper, "_collectionPeriod", _collectionPeriod); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_performanceMetric", _performanceMetric); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfo.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfo.java new file mode 100644 index 0000000..df5855f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfo.java @@ -0,0 +1,72 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Uniquely identifies this VNF Indicator information element. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container vnf-indicator-info {
+ *   leaf vnfd-id {
+ *     type leafref {
+ *       path ../../../../../vnfd/id;
+ *     }
+ *   }
+ *   leaf vnf-indicator {
+ *     type leafref {
+ *       path deref(../vnfd-id)/../indicator/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/monitored-info/vnf-indicator-info + * + *

To create instances of this class use {@link VnfIndicatorInfoBuilder}. + * @see VnfIndicatorInfoBuilder + * + */ +public interface VnfIndicatorInfo + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf-indicator-info"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.VnfIndicatorInfo.class; + } + + /** + * Identifies a VNFD. + * + * + * + * @return java.lang.String vnfdId, or null if not present + */ + @Nullable String getVnfdId(); + + /** + * Identifies a VNF indicator within the VNFD. + * + * + * + * @return java.lang.String vnfIndicator, or null if not present + */ + @Nullable String getVnfIndicator(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfoBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfoBuilder.java new file mode 100644 index 0000000..a9ad45b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/monitored/info/VnfIndicatorInfoBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfIndicatorInfoBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfIndicatorInfoBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfIndicatorInfoBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfIndicatorInfoBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfIndicatorInfoBuilder + * @see Builder + * + */ +public class VnfIndicatorInfoBuilder implements Builder { + + private String _vnfIndicator; + private String _vnfdId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfIndicatorInfoBuilder() { + } + + public VnfIndicatorInfoBuilder(VnfIndicatorInfo base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._vnfIndicator = base.getVnfIndicator(); + this._vnfdId = base.getVnfdId(); + } + + + public String getVnfIndicator() { + return _vnfIndicator; + } + + public String getVnfdId() { + return _vnfdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VnfIndicatorInfoBuilder setVnfIndicator(final String value) { + this._vnfIndicator = value; + return this; + } + + public VnfIndicatorInfoBuilder setVnfdId(final String value) { + this._vnfdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfIndicatorInfoBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfIndicatorInfoBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfIndicatorInfoBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfIndicatorInfoBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VnfIndicatorInfo build() { + return new VnfIndicatorInfoImpl(this); + } + + private static final class VnfIndicatorInfoImpl + extends AbstractAugmentable + implements VnfIndicatorInfo { + + private final String _vnfIndicator; + private final String _vnfdId; + + VnfIndicatorInfoImpl(VnfIndicatorInfoBuilder base) { + super(base.augmentation); + this._vnfIndicator = base.getVnfIndicator(); + this._vnfdId = base.getVnfdId(); + } + + @Override + public String getVnfIndicator() { + return _vnfIndicator; + } + + @Override + public String getVnfdId() { + return _vnfdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_vnfIndicator); + result = prime * result + Objects.hashCode(_vnfdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VnfIndicatorInfo.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VnfIndicatorInfo other = (VnfIndicatorInfo)obj; + if (!Objects.equals(_vnfIndicator, other.getVnfIndicator())) { + return false; + } + if (!Objects.equals(_vnfdId, other.getVnfdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfIndicatorInfoImpl otherImpl = (VnfIndicatorInfoImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VnfIndicatorInfo"); + CodeHelpers.appendValue(helper, "_vnfIndicator", _vnfIndicator); + CodeHelpers.appendValue(helper, "_vnfdId", _vnfdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMapping.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMapping.java new file mode 100644 index 0000000..54d5b17 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMapping.java @@ -0,0 +1,80 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Specifies the profile of the nested NSs involved in this NS level and, for each + * of them, the required number of instances. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list ns-to-level-mapping {
+ *   key ns-profile-id;
+ *   leaf ns-profile-id {
+ *     type leafref {
+ *       path ../../../ns-profile/id;
+ *     }
+ *   }
+ *   leaf number-of-instances {
+ *     default 1;
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-instantiation-level/ns-to-level-mapping + * + *

To create instances of this class use {@link NsToLevelMappingBuilder}. + * @see NsToLevelMappingBuilder + * @see NsToLevelMappingKey + * + */ +public interface NsToLevelMapping + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns-to-level-mapping"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMapping.class; + } + + /** + * Identifies the profile to be used for a nested NS involved in the NS level. + * + * + * + * @return java.lang.String nsProfileId, or null if not present + */ + @Nullable String getNsProfileId(); + + /** + * Specifies the number of nested NS instances required for the NS scale level. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 numberOfInstances, or null if not present + */ + @Nullable Uint32 getNumberOfInstances(); + + @Override + NsToLevelMappingKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingBuilder.java new file mode 100644 index 0000000..91e228f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingBuilder.java @@ -0,0 +1,285 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link NsToLevelMappingBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsToLevelMappingBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsToLevelMappingBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsToLevelMappingBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsToLevelMappingBuilder + * @see Builder + * + */ +public class NsToLevelMappingBuilder implements Builder { + + private String _nsProfileId; + private Uint32 _numberOfInstances; + private NsToLevelMappingKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsToLevelMappingBuilder() { + } + + public NsToLevelMappingBuilder(NsToLevelMapping base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._nsProfileId = base.getNsProfileId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + + public NsToLevelMappingKey key() { + return key; + } + + public String getNsProfileId() { + return _nsProfileId; + } + + public Uint32 getNumberOfInstances() { + return _numberOfInstances; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsToLevelMappingBuilder withKey(final NsToLevelMappingKey key) { + this.key = key; + return this; + } + + public NsToLevelMappingBuilder setNsProfileId(final String value) { + this._nsProfileId = value; + return this; + } + + public NsToLevelMappingBuilder setNumberOfInstances(final Uint32 value) { + this._numberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumberOfInstances(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public NsToLevelMappingBuilder setNumberOfInstances(final Long value) { + return setNumberOfInstances(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsToLevelMappingBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsToLevelMappingBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsToLevelMappingBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsToLevelMappingBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NsToLevelMapping build() { + return new NsToLevelMappingImpl(this); + } + + private static final class NsToLevelMappingImpl + extends AbstractAugmentable + implements NsToLevelMapping { + + private final String _nsProfileId; + private final Uint32 _numberOfInstances; + private final NsToLevelMappingKey key; + + NsToLevelMappingImpl(NsToLevelMappingBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsToLevelMappingKey(base.getNsProfileId()); + } + this._nsProfileId = key.getNsProfileId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + @Override + public NsToLevelMappingKey key() { + return key; + } + + @Override + public String getNsProfileId() { + return _nsProfileId; + } + + @Override + public Uint32 getNumberOfInstances() { + return _numberOfInstances; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_nsProfileId); + result = prime * result + Objects.hashCode(_numberOfInstances); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NsToLevelMapping.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NsToLevelMapping other = (NsToLevelMapping)obj; + if (!Objects.equals(_nsProfileId, other.getNsProfileId())) { + return false; + } + if (!Objects.equals(_numberOfInstances, other.getNumberOfInstances())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsToLevelMappingImpl otherImpl = (NsToLevelMappingImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NsToLevelMapping"); + CodeHelpers.appendValue(helper, "_nsProfileId", _nsProfileId); + CodeHelpers.appendValue(helper, "_numberOfInstances", _numberOfInstances); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingKey.java new file mode 100644 index 0000000..a91d807 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/NsToLevelMappingKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsToLevelMappingKey + implements Identifier { + private static final long serialVersionUID = -4492263105637618798L; + private final String _nsProfileId; + + + public NsToLevelMappingKey(String _nsProfileId) { + + this._nsProfileId = _nsProfileId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsToLevelMappingKey(NsToLevelMappingKey source) { + this._nsProfileId = source._nsProfileId; + } + + + public String getNsProfileId() { + return _nsProfileId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_nsProfileId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsToLevelMappingKey)) { + return false; + } + final NsToLevelMappingKey other = (NsToLevelMappingKey) obj; + if (!Objects.equals(_nsProfileId, other._nsProfileId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsToLevelMappingKey.class); + CodeHelpers.appendValue(helper, "_nsProfileId", _nsProfileId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMapping.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMapping.java new file mode 100644 index 0000000..e3a84b4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMapping.java @@ -0,0 +1,69 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the profile of the VLs involved in this NS level and, for each of + * them, the needed bandwidth. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-to-level-mapping {
+ *   key virtual-link-profile-id;
+ *   leaf virtual-link-profile-id {
+ *     type leafref {
+ *       path ../../../virtual-link-profile/id;
+ *     }
+ *   }
+ *   uses link-bitrate-requirements;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-instantiation-level/virtual-link-to-level-mapping + * + *

To create instances of this class use {@link VirtualLinkToLevelMappingBuilder}. + * @see VirtualLinkToLevelMappingBuilder + * @see VirtualLinkToLevelMappingKey + * + */ +public interface VirtualLinkToLevelMapping + extends + ChildOf, + Augmentable, + LinkBitrateRequirements, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-to-level-mapping"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMapping.class; + } + + /** + * Identifies the profile to be used for a VL involved in an NS level. + * + * + * + * @return java.lang.String virtualLinkProfileId, or null if not present + */ + @Nullable String getVirtualLinkProfileId(); + + @Override + VirtualLinkToLevelMappingKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingBuilder.java new file mode 100644 index 0000000..41530f9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingBuilder.java @@ -0,0 +1,342 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link VirtualLinkToLevelMappingBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkToLevelMappingBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkToLevelMappingBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkToLevelMappingBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkToLevelMappingBuilder + * @see Builder + * + */ +public class VirtualLinkToLevelMappingBuilder implements Builder { + + private Uint64 _leaf; + private Uint64 _root; + private String _virtualLinkProfileId; + private VirtualLinkToLevelMappingKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkToLevelMappingBuilder() { + } + public VirtualLinkToLevelMappingBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements arg) { + this._root = arg.getRoot(); + this._leaf = arg.getLeaf(); + } + + public VirtualLinkToLevelMappingBuilder(VirtualLinkToLevelMapping base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements) { + this._root = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements)arg).getRoot(); + this._leaf = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements)arg).getLeaf(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements]"); + } + + public VirtualLinkToLevelMappingKey key() { + return key; + } + + public Uint64 getLeaf() { + return _leaf; + } + + public Uint64 getRoot() { + return _root; + } + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkToLevelMappingBuilder withKey(final VirtualLinkToLevelMappingKey key) { + this.key = key; + return this; + } + + public VirtualLinkToLevelMappingBuilder setLeaf(final Uint64 value) { + this._leaf = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLeaf(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkToLevelMappingBuilder setLeaf(final BigInteger value) { + return setLeaf(CodeHelpers.compatUint(value)); + } + + public VirtualLinkToLevelMappingBuilder setRoot(final Uint64 value) { + this._root = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setRoot(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkToLevelMappingBuilder setRoot(final BigInteger value) { + return setRoot(CodeHelpers.compatUint(value)); + } + + public VirtualLinkToLevelMappingBuilder setVirtualLinkProfileId(final String value) { + this._virtualLinkProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkToLevelMappingBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkToLevelMappingBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkToLevelMappingBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkToLevelMappingBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkToLevelMapping build() { + return new VirtualLinkToLevelMappingImpl(this); + } + + private static final class VirtualLinkToLevelMappingImpl + extends AbstractAugmentable + implements VirtualLinkToLevelMapping { + + private final Uint64 _leaf; + private final Uint64 _root; + private final String _virtualLinkProfileId; + private final VirtualLinkToLevelMappingKey key; + + VirtualLinkToLevelMappingImpl(VirtualLinkToLevelMappingBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkToLevelMappingKey(base.getVirtualLinkProfileId()); + } + this._virtualLinkProfileId = key.getVirtualLinkProfileId(); + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + @Override + public VirtualLinkToLevelMappingKey key() { + return key; + } + + @Override + public Uint64 getLeaf() { + return _leaf; + } + + @Override + public Uint64 getRoot() { + return _root; + } + + @Override + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_leaf); + result = prime * result + Objects.hashCode(_root); + result = prime * result + Objects.hashCode(_virtualLinkProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkToLevelMapping.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkToLevelMapping other = (VirtualLinkToLevelMapping)obj; + if (!Objects.equals(_leaf, other.getLeaf())) { + return false; + } + if (!Objects.equals(_root, other.getRoot())) { + return false; + } + if (!Objects.equals(_virtualLinkProfileId, other.getVirtualLinkProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkToLevelMappingImpl otherImpl = (VirtualLinkToLevelMappingImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkToLevelMapping"); + CodeHelpers.appendValue(helper, "_leaf", _leaf); + CodeHelpers.appendValue(helper, "_root", _root); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingKey.java new file mode 100644 index 0000000..87eb0f9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VirtualLinkToLevelMappingKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkToLevelMappingKey + implements Identifier { + private static final long serialVersionUID = 4146079255761774930L; + private final String _virtualLinkProfileId; + + + public VirtualLinkToLevelMappingKey(String _virtualLinkProfileId) { + + this._virtualLinkProfileId = _virtualLinkProfileId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkToLevelMappingKey(VirtualLinkToLevelMappingKey source) { + this._virtualLinkProfileId = source._virtualLinkProfileId; + } + + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_virtualLinkProfileId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkToLevelMappingKey)) { + return false; + } + final VirtualLinkToLevelMappingKey other = (VirtualLinkToLevelMappingKey) obj; + if (!Objects.equals(_virtualLinkProfileId, other._virtualLinkProfileId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkToLevelMappingKey.class); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMapping.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMapping.java new file mode 100644 index 0000000..0c6d028 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMapping.java @@ -0,0 +1,80 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Specifies the profile of the VNFs involved in this NS level and, for each of + * them, the required number of instances. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vnf-to-level-mapping {
+ *   key vnf-profile-id;
+ *   leaf vnf-profile-id {
+ *     type leafref {
+ *       path ../../../vnf-profile/id;
+ *     }
+ *   }
+ *   leaf number-of-instances {
+ *     default 1;
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-instantiation-level/vnf-to-level-mapping + * + *

To create instances of this class use {@link VnfToLevelMappingBuilder}. + * @see VnfToLevelMappingBuilder + * @see VnfToLevelMappingKey + * + */ +public interface VnfToLevelMapping + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf-to-level-mapping"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMapping.class; + } + + /** + * Identifies the profile to be used for a VNF involved in an NS level. + * + * + * + * @return java.lang.String vnfProfileId, or null if not present + */ + @Nullable String getVnfProfileId(); + + /** + * Specifies the number of VNF instances required for an NS level. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 numberOfInstances, or null if not present + */ + @Nullable Uint32 getNumberOfInstances(); + + @Override + VnfToLevelMappingKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingBuilder.java new file mode 100644 index 0000000..ad6c01b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingBuilder.java @@ -0,0 +1,285 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link VnfToLevelMappingBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfToLevelMappingBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfToLevelMappingBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfToLevelMappingBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfToLevelMappingBuilder + * @see Builder + * + */ +public class VnfToLevelMappingBuilder implements Builder { + + private Uint32 _numberOfInstances; + private String _vnfProfileId; + private VnfToLevelMappingKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfToLevelMappingBuilder() { + } + + public VnfToLevelMappingBuilder(VnfToLevelMapping base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._vnfProfileId = base.getVnfProfileId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + + public VnfToLevelMappingKey key() { + return key; + } + + public Uint32 getNumberOfInstances() { + return _numberOfInstances; + } + + public String getVnfProfileId() { + return _vnfProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnfToLevelMappingBuilder withKey(final VnfToLevelMappingKey key) { + this.key = key; + return this; + } + + public VnfToLevelMappingBuilder setNumberOfInstances(final Uint32 value) { + this._numberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumberOfInstances(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public VnfToLevelMappingBuilder setNumberOfInstances(final Long value) { + return setNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public VnfToLevelMappingBuilder setVnfProfileId(final String value) { + this._vnfProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfToLevelMappingBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfToLevelMappingBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfToLevelMappingBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfToLevelMappingBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VnfToLevelMapping build() { + return new VnfToLevelMappingImpl(this); + } + + private static final class VnfToLevelMappingImpl + extends AbstractAugmentable + implements VnfToLevelMapping { + + private final Uint32 _numberOfInstances; + private final String _vnfProfileId; + private final VnfToLevelMappingKey key; + + VnfToLevelMappingImpl(VnfToLevelMappingBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VnfToLevelMappingKey(base.getVnfProfileId()); + } + this._vnfProfileId = key.getVnfProfileId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + @Override + public VnfToLevelMappingKey key() { + return key; + } + + @Override + public Uint32 getNumberOfInstances() { + return _numberOfInstances; + } + + @Override + public String getVnfProfileId() { + return _vnfProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_numberOfInstances); + result = prime * result + Objects.hashCode(_vnfProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VnfToLevelMapping.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VnfToLevelMapping other = (VnfToLevelMapping)obj; + if (!Objects.equals(_numberOfInstances, other.getNumberOfInstances())) { + return false; + } + if (!Objects.equals(_vnfProfileId, other.getVnfProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfToLevelMappingImpl otherImpl = (VnfToLevelMappingImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VnfToLevelMapping"); + CodeHelpers.appendValue(helper, "_numberOfInstances", _numberOfInstances); + CodeHelpers.appendValue(helper, "_vnfProfileId", _vnfProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingKey.java new file mode 100644 index 0000000..64cf325 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/instantiation/level/VnfToLevelMappingKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VnfToLevelMappingKey + implements Identifier { + private static final long serialVersionUID = -4936475184729003839L; + private final String _vnfProfileId; + + + public VnfToLevelMappingKey(String _vnfProfileId) { + + this._vnfProfileId = _vnfProfileId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VnfToLevelMappingKey(VnfToLevelMappingKey source) { + this._vnfProfileId = source._vnfProfileId; + } + + + public String getVnfProfileId() { + return _vnfProfileId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_vnfProfileId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VnfToLevelMappingKey)) { + return false; + } + final VnfToLevelMappingKey other = (VnfToLevelMappingKey) obj; + if (!Objects.equals(_vnfProfileId, other._vnfProfileId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VnfToLevelMappingKey.class); + CodeHelpers.appendValue(helper, "_vnfProfileId", _vnfProfileId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupId.java new file mode 100644 index 0000000..b3b1df8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupId.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies an affinity or anti-affinity group the NSs created according to this + * NsProfile belongs to. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group-id {
+ *   key id;
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../affinity-or-anti-affinity-group/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-profile/affinity-or-anti-affinity-group-id + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupIdBuilder}. + * @see AffinityOrAntiAffinityGroupIdBuilder + * @see AffinityOrAntiAffinityGroupIdKey + * + */ +public interface AffinityOrAntiAffinityGroupId + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group-id"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupId.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + AffinityOrAntiAffinityGroupIdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdBuilder.java new file mode 100644 index 0000000..e3a8b36 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupIdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupIdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupIdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupIdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupIdBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupIdBuilder implements Builder { + + private String _id; + private AffinityOrAntiAffinityGroupIdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupIdBuilder() { + } + + public AffinityOrAntiAffinityGroupIdBuilder(AffinityOrAntiAffinityGroupId base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + } + + + public AffinityOrAntiAffinityGroupIdKey key() { + return key; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupIdBuilder withKey(final AffinityOrAntiAffinityGroupIdKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupIdBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupIdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupIdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupIdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupIdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroupId build() { + return new AffinityOrAntiAffinityGroupIdImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupIdImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroupId { + + private final String _id; + private final AffinityOrAntiAffinityGroupIdKey key; + + AffinityOrAntiAffinityGroupIdImpl(AffinityOrAntiAffinityGroupIdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupIdKey(base.getId()); + } + this._id = key.getId(); + } + + @Override + public AffinityOrAntiAffinityGroupIdKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroupId.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroupId other = (AffinityOrAntiAffinityGroupId)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupIdImpl otherImpl = (AffinityOrAntiAffinityGroupIdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroupId"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdKey.java new file mode 100644 index 0000000..a95fbea --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/AffinityOrAntiAffinityGroupIdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupIdKey + implements Identifier { + private static final long serialVersionUID = 3909093279935746030L; + private final String _id; + + + public AffinityOrAntiAffinityGroupIdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupIdKey(AffinityOrAntiAffinityGroupIdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupIdKey)) { + return false; + } + final AffinityOrAntiAffinityGroupIdKey other = (AffinityOrAntiAffinityGroupIdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupIdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivity.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivity.java new file mode 100644 index 0000000..644d24f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivity.java @@ -0,0 +1,99 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity.ConstituentCpdId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity.ConstituentCpdIdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-connectivity {
+ *   key virtual-link-profile-id;
+ *   leaf virtual-link-profile-id {
+ *     type leafref {
+ *       path ../../../virtual-link-profile/id;
+ *     }
+ *   }
+ *   list constituent-cpd-id {
+ *     key constituent-base-element-id;
+ *     leaf constituent-base-element-id {
+ *       type leafref {
+ *         path ../../../id;
+ *       }
+ *     }
+ *     leaf constituent-cpd-id {
+ *       type leafref {
+ *         path deref(../../../nsd-id)/../sapd/id;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-profile/virtual-link-connectivity + * + *

To create instances of this class use {@link VirtualLinkConnectivityBuilder}. + * @see VirtualLinkConnectivityBuilder + * @see VirtualLinkConnectivityKey + * + */ +public interface VirtualLinkConnectivity + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-connectivity"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivity.class; + } + + /** + * Reference an NS VL profile. + * + * + * + * @return java.lang.String virtualLinkProfileId, or null if not present + */ + @Nullable String getVirtualLinkProfileId(); + + /** + * Describes a connection point on a VNF/PNF or a SAP which connects to virtual + * links instantiated from the profile identified in the virtualLinkProfileId + * attribute. + * + * + * + * @return java.util.Map constituentCpdId, or null if not present + */ + @Nullable Map getConstituentCpdId(); + + /** + * @return java.util.Map constituentCpdId, or an empty list if it is not present + */ + default @NonNull Map nonnullConstituentCpdId() { + return CodeHelpers.nonnull(getConstituentCpdId()); + } + + @Override + VirtualLinkConnectivityKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityBuilder.java new file mode 100644 index 0000000..8d20d24 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityBuilder.java @@ -0,0 +1,291 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity.ConstituentCpdId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity.ConstituentCpdIdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkConnectivityBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkConnectivityBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkConnectivityBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkConnectivityBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkConnectivityBuilder + * @see Builder + * + */ +public class VirtualLinkConnectivityBuilder implements Builder { + + private Map _constituentCpdId; + private String _virtualLinkProfileId; + private VirtualLinkConnectivityKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkConnectivityBuilder() { + } + + public VirtualLinkConnectivityBuilder(VirtualLinkConnectivity base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + + public VirtualLinkConnectivityKey key() { + return key; + } + + public Map getConstituentCpdId() { + return _constituentCpdId; + } + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkConnectivityBuilder withKey(final VirtualLinkConnectivityKey key) { + this.key = key; + return this; + } + public VirtualLinkConnectivityBuilder setConstituentCpdId(final Map values) { + this._constituentCpdId = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setConstituentCpdId(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkConnectivityBuilder setConstituentCpdId(final List values) { + return setConstituentCpdId(CodeHelpers.compatMap(values)); + } + + public VirtualLinkConnectivityBuilder setVirtualLinkProfileId(final String value) { + this._virtualLinkProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkConnectivityBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkConnectivityBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkConnectivityBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkConnectivityBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkConnectivity build() { + return new VirtualLinkConnectivityImpl(this); + } + + private static final class VirtualLinkConnectivityImpl + extends AbstractAugmentable + implements VirtualLinkConnectivity { + + private final Map _constituentCpdId; + private final String _virtualLinkProfileId; + private final VirtualLinkConnectivityKey key; + + VirtualLinkConnectivityImpl(VirtualLinkConnectivityBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkConnectivityKey(base.getVirtualLinkProfileId()); + } + this._virtualLinkProfileId = key.getVirtualLinkProfileId(); + this._constituentCpdId = CodeHelpers.emptyToNull(base.getConstituentCpdId()); + } + + @Override + public VirtualLinkConnectivityKey key() { + return key; + } + + @Override + public Map getConstituentCpdId() { + return _constituentCpdId; + } + + @Override + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentCpdId); + result = prime * result + Objects.hashCode(_virtualLinkProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkConnectivity.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkConnectivity other = (VirtualLinkConnectivity)obj; + if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { + return false; + } + if (!Objects.equals(_virtualLinkProfileId, other.getVirtualLinkProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkConnectivityImpl otherImpl = (VirtualLinkConnectivityImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkConnectivity"); + CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityKey.java new file mode 100644 index 0000000..31ef211 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/VirtualLinkConnectivityKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkConnectivityKey + implements Identifier { + private static final long serialVersionUID = -1012322664145801683L; + private final String _virtualLinkProfileId; + + + public VirtualLinkConnectivityKey(String _virtualLinkProfileId) { + + this._virtualLinkProfileId = _virtualLinkProfileId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkConnectivityKey(VirtualLinkConnectivityKey source) { + this._virtualLinkProfileId = source._virtualLinkProfileId; + } + + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_virtualLinkProfileId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkConnectivityKey)) { + return false; + } + final VirtualLinkConnectivityKey other = (VirtualLinkConnectivityKey) obj; + if (!Objects.equals(_virtualLinkProfileId, other._virtualLinkProfileId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkConnectivityKey.class); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdId.java new file mode 100644 index 0000000..7200693 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdId.java @@ -0,0 +1,83 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity; +import java.lang.Class; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivity; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes a connection point on a VNF/PNF or a SAP which connects to virtual + * links instantiated from the profile identified in the virtualLinkProfileId + * attribute. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list constituent-cpd-id {
+ *   key constituent-base-element-id;
+ *   leaf constituent-base-element-id {
+ *     type leafref {
+ *       path ../../../id;
+ *     }
+ *   }
+ *   leaf constituent-cpd-id {
+ *     type leafref {
+ *       path deref(../../../nsd-id)/../sapd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-profile/virtual-link-connectivity/constituent-cpd-id + * + *

To create instances of this class use {@link ConstituentCpdIdBuilder}. + * @see ConstituentCpdIdBuilder + * @see ConstituentCpdIdKey + * + */ +public interface ConstituentCpdId + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("constituent-cpd-id"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity.ConstituentCpdId.class; + } + + /** + * Reference to the profile of an NS constituent. + * + * + * + * @return java.lang.String constituentBaseElementId, or null if not present + */ + @Nullable String getConstituentBaseElementId(); + + /** + * A reference to the descriptor of a connection point attached to one of the + * constituent VNFs and PNFs or to the descriptor of a NS SAP. + * + * + * + * @return java.lang.Object constituentCpdId, or null if not present + */ + @Nullable Object getConstituentCpdId(); + + @Override + ConstituentCpdIdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java new file mode 100644 index 0000000..917b0a1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConstituentCpdIdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConstituentCpdIdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConstituentCpdIdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConstituentCpdIdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConstituentCpdIdBuilder + * @see Builder + * + */ +public class ConstituentCpdIdBuilder implements Builder { + + private String _constituentBaseElementId; + private Object _constituentCpdId; + private ConstituentCpdIdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConstituentCpdIdBuilder() { + } + + public ConstituentCpdIdBuilder(ConstituentCpdId base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._constituentBaseElementId = base.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + + public ConstituentCpdIdKey key() { + return key; + } + + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + public Object getConstituentCpdId() { + return _constituentCpdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ConstituentCpdIdBuilder withKey(final ConstituentCpdIdKey key) { + this.key = key; + return this; + } + + public ConstituentCpdIdBuilder setConstituentBaseElementId(final String value) { + this._constituentBaseElementId = value; + return this; + } + + public ConstituentCpdIdBuilder setConstituentCpdId(final Object value) { + this._constituentCpdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConstituentCpdIdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConstituentCpdIdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConstituentCpdIdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConstituentCpdIdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConstituentCpdId build() { + return new ConstituentCpdIdImpl(this); + } + + private static final class ConstituentCpdIdImpl + extends AbstractAugmentable + implements ConstituentCpdId { + + private final String _constituentBaseElementId; + private final Object _constituentCpdId; + private final ConstituentCpdIdKey key; + + ConstituentCpdIdImpl(ConstituentCpdIdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ConstituentCpdIdKey(base.getConstituentBaseElementId()); + } + this._constituentBaseElementId = key.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + @Override + public ConstituentCpdIdKey key() { + return key; + } + + @Override + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + @Override + public Object getConstituentCpdId() { + return _constituentCpdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentBaseElementId); + result = prime * result + Objects.hashCode(_constituentCpdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConstituentCpdId.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConstituentCpdId other = (ConstituentCpdId)obj; + if (!Objects.equals(_constituentBaseElementId, other.getConstituentBaseElementId())) { + return false; + } + if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConstituentCpdIdImpl otherImpl = (ConstituentCpdIdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConstituentCpdId"); + CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); + CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdKey.java new file mode 100644 index 0000000..3b19b8a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ns/profile/virtual/link/connectivity/ConstituentCpdIdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.virtual.link.connectivity; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ConstituentCpdIdKey + implements Identifier { + private static final long serialVersionUID = -6015428103661446636L; + private final String _constituentBaseElementId; + + + public ConstituentCpdIdKey(String _constituentBaseElementId) { + + this._constituentBaseElementId = _constituentBaseElementId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ConstituentCpdIdKey(ConstituentCpdIdKey source) { + this._constituentBaseElementId = source._constituentBaseElementId; + } + + + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_constituentBaseElementId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ConstituentCpdIdKey)) { + return false; + } + final ConstituentCpdIdKey other = (ConstituentCpdIdKey) obj; + if (!Objects.equals(_constituentBaseElementId, other._constituentBaseElementId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ConstituentCpdIdKey.class); + CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivity.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivity.java new file mode 100644 index 0000000..61ba61c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivity.java @@ -0,0 +1,101 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity.ConstituentCpdId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity.ConstituentCpdIdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Defines the connection information of the PNF, it contains connection + * relationship between a PNF connection point and a NS Virtual Link. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-connectivity {
+ *   key virtual-link-profile-id;
+ *   leaf virtual-link-profile-id {
+ *     type leafref {
+ *       path ../../../virtual-link-profile/id;
+ *     }
+ *   }
+ *   list constituent-cpd-id {
+ *     key constituent-base-element-id;
+ *     leaf constituent-base-element-id {
+ *       type leafref {
+ *         path ../../../id;
+ *       }
+ *     }
+ *     leaf constituent-cpd-id {
+ *       type leafref {
+ *         path deref(../../../pnfd-id)/../ext-cpd/id;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/pnf-profile/virtual-link-connectivity + * + *

To create instances of this class use {@link VirtualLinkConnectivityBuilder}. + * @see VirtualLinkConnectivityBuilder + * @see VirtualLinkConnectivityKey + * + */ +public interface VirtualLinkConnectivity + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-connectivity"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivity.class; + } + + /** + * Reference an NS VL profile. + * + * + * + * @return java.lang.String virtualLinkProfileId, or null if not present + */ + @Nullable String getVirtualLinkProfileId(); + + /** + * Describes a connection point on a VNF/PNF or a SAP which connects to virtual + * links instantiated from the profile identified in the virtualLinkProfileId + * attribute. + * + * + * + * @return java.util.Map constituentCpdId, or null if not present + */ + @Nullable Map getConstituentCpdId(); + + /** + * @return java.util.Map constituentCpdId, or an empty list if it is not present + */ + default @NonNull Map nonnullConstituentCpdId() { + return CodeHelpers.nonnull(getConstituentCpdId()); + } + + @Override + VirtualLinkConnectivityKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityBuilder.java new file mode 100644 index 0000000..fde5885 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityBuilder.java @@ -0,0 +1,291 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity.ConstituentCpdId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity.ConstituentCpdIdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkConnectivityBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkConnectivityBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkConnectivityBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkConnectivityBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkConnectivityBuilder + * @see Builder + * + */ +public class VirtualLinkConnectivityBuilder implements Builder { + + private Map _constituentCpdId; + private String _virtualLinkProfileId; + private VirtualLinkConnectivityKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkConnectivityBuilder() { + } + + public VirtualLinkConnectivityBuilder(VirtualLinkConnectivity base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + + public VirtualLinkConnectivityKey key() { + return key; + } + + public Map getConstituentCpdId() { + return _constituentCpdId; + } + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkConnectivityBuilder withKey(final VirtualLinkConnectivityKey key) { + this.key = key; + return this; + } + public VirtualLinkConnectivityBuilder setConstituentCpdId(final Map values) { + this._constituentCpdId = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setConstituentCpdId(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkConnectivityBuilder setConstituentCpdId(final List values) { + return setConstituentCpdId(CodeHelpers.compatMap(values)); + } + + public VirtualLinkConnectivityBuilder setVirtualLinkProfileId(final String value) { + this._virtualLinkProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkConnectivityBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkConnectivityBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkConnectivityBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkConnectivityBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkConnectivity build() { + return new VirtualLinkConnectivityImpl(this); + } + + private static final class VirtualLinkConnectivityImpl + extends AbstractAugmentable + implements VirtualLinkConnectivity { + + private final Map _constituentCpdId; + private final String _virtualLinkProfileId; + private final VirtualLinkConnectivityKey key; + + VirtualLinkConnectivityImpl(VirtualLinkConnectivityBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkConnectivityKey(base.getVirtualLinkProfileId()); + } + this._virtualLinkProfileId = key.getVirtualLinkProfileId(); + this._constituentCpdId = CodeHelpers.emptyToNull(base.getConstituentCpdId()); + } + + @Override + public VirtualLinkConnectivityKey key() { + return key; + } + + @Override + public Map getConstituentCpdId() { + return _constituentCpdId; + } + + @Override + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentCpdId); + result = prime * result + Objects.hashCode(_virtualLinkProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkConnectivity.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkConnectivity other = (VirtualLinkConnectivity)obj; + if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { + return false; + } + if (!Objects.equals(_virtualLinkProfileId, other.getVirtualLinkProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkConnectivityImpl otherImpl = (VirtualLinkConnectivityImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkConnectivity"); + CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityKey.java new file mode 100644 index 0000000..1d19559 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/VirtualLinkConnectivityKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkConnectivityKey + implements Identifier { + private static final long serialVersionUID = -1012322664145801683L; + private final String _virtualLinkProfileId; + + + public VirtualLinkConnectivityKey(String _virtualLinkProfileId) { + + this._virtualLinkProfileId = _virtualLinkProfileId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkConnectivityKey(VirtualLinkConnectivityKey source) { + this._virtualLinkProfileId = source._virtualLinkProfileId; + } + + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_virtualLinkProfileId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkConnectivityKey)) { + return false; + } + final VirtualLinkConnectivityKey other = (VirtualLinkConnectivityKey) obj; + if (!Objects.equals(_virtualLinkProfileId, other._virtualLinkProfileId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkConnectivityKey.class); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdId.java new file mode 100644 index 0000000..afa88cd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdId.java @@ -0,0 +1,83 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity; +import java.lang.Class; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes a connection point on a VNF/PNF or a SAP which connects to virtual + * links instantiated from the profile identified in the virtualLinkProfileId + * attribute. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list constituent-cpd-id {
+ *   key constituent-base-element-id;
+ *   leaf constituent-base-element-id {
+ *     type leafref {
+ *       path ../../../id;
+ *     }
+ *   }
+ *   leaf constituent-cpd-id {
+ *     type leafref {
+ *       path deref(../../../pnfd-id)/../ext-cpd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/pnf-profile/virtual-link-connectivity/constituent-cpd-id + * + *

To create instances of this class use {@link ConstituentCpdIdBuilder}. + * @see ConstituentCpdIdBuilder + * @see ConstituentCpdIdKey + * + */ +public interface ConstituentCpdId + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("constituent-cpd-id"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity.ConstituentCpdId.class; + } + + /** + * Reference to the profile of an NS constituent. + * + * + * + * @return java.lang.String constituentBaseElementId, or null if not present + */ + @Nullable String getConstituentBaseElementId(); + + /** + * A reference to the descriptor of a connection point attached to one of the + * constituent VNFs and PNFs or to the descriptor of a NS SAP. + * + * + * + * @return java.lang.Object constituentCpdId, or null if not present + */ + @Nullable Object getConstituentCpdId(); + + @Override + ConstituentCpdIdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java new file mode 100644 index 0000000..af4183f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConstituentCpdIdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConstituentCpdIdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConstituentCpdIdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConstituentCpdIdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConstituentCpdIdBuilder + * @see Builder + * + */ +public class ConstituentCpdIdBuilder implements Builder { + + private String _constituentBaseElementId; + private Object _constituentCpdId; + private ConstituentCpdIdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConstituentCpdIdBuilder() { + } + + public ConstituentCpdIdBuilder(ConstituentCpdId base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._constituentBaseElementId = base.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + + public ConstituentCpdIdKey key() { + return key; + } + + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + public Object getConstituentCpdId() { + return _constituentCpdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ConstituentCpdIdBuilder withKey(final ConstituentCpdIdKey key) { + this.key = key; + return this; + } + + public ConstituentCpdIdBuilder setConstituentBaseElementId(final String value) { + this._constituentBaseElementId = value; + return this; + } + + public ConstituentCpdIdBuilder setConstituentCpdId(final Object value) { + this._constituentCpdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConstituentCpdIdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConstituentCpdIdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConstituentCpdIdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConstituentCpdIdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConstituentCpdId build() { + return new ConstituentCpdIdImpl(this); + } + + private static final class ConstituentCpdIdImpl + extends AbstractAugmentable + implements ConstituentCpdId { + + private final String _constituentBaseElementId; + private final Object _constituentCpdId; + private final ConstituentCpdIdKey key; + + ConstituentCpdIdImpl(ConstituentCpdIdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ConstituentCpdIdKey(base.getConstituentBaseElementId()); + } + this._constituentBaseElementId = key.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + @Override + public ConstituentCpdIdKey key() { + return key; + } + + @Override + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + @Override + public Object getConstituentCpdId() { + return _constituentCpdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentBaseElementId); + result = prime * result + Objects.hashCode(_constituentCpdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConstituentCpdId.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConstituentCpdId other = (ConstituentCpdId)obj; + if (!Objects.equals(_constituentBaseElementId, other.getConstituentBaseElementId())) { + return false; + } + if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConstituentCpdIdImpl otherImpl = (ConstituentCpdIdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConstituentCpdId"); + CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); + CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java new file mode 100644 index 0000000..53dfd32 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/pnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.virtual.link.connectivity; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ConstituentCpdIdKey + implements Identifier { + private static final long serialVersionUID = -6015428103661446636L; + private final String _constituentBaseElementId; + + + public ConstituentCpdIdKey(String _constituentBaseElementId) { + + this._constituentBaseElementId = _constituentBaseElementId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ConstituentCpdIdKey(ConstituentCpdIdKey source) { + this._constituentBaseElementId = source._constituentBaseElementId; + } + + + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_constituentBaseElementId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ConstituentCpdIdKey)) { + return false; + } + final ConstituentCpdIdKey other = (ConstituentCpdIdKey) obj; + if (!Objects.equals(_constituentBaseElementId, other._constituentBaseElementId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ConstituentCpdIdKey.class); + CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java new file mode 100644 index 0000000..cff94cf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies an affinity or anti-affinity group the VLs instantiated according to + * the VlProfile belong to. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group {
+ *   key id;
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../affinity-or-anti-affinity-group/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/virtual-link-profile/affinity-or-anti-affinity-group + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupBuilder}. + * @see AffinityOrAntiAffinityGroupBuilder + * @see AffinityOrAntiAffinityGroupKey + * + */ +public interface AffinityOrAntiAffinityGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.AffinityOrAntiAffinityGroup.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + AffinityOrAntiAffinityGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java new file mode 100644 index 0000000..65a5584 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupBuilder implements Builder { + + private String _id; + private AffinityOrAntiAffinityGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupBuilder() { + } + + public AffinityOrAntiAffinityGroupBuilder(AffinityOrAntiAffinityGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + } + + + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupBuilder withKey(final AffinityOrAntiAffinityGroupKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroup build() { + return new AffinityOrAntiAffinityGroupImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroup { + + private final String _id; + private final AffinityOrAntiAffinityGroupKey key; + + AffinityOrAntiAffinityGroupImpl(AffinityOrAntiAffinityGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupKey(base.getId()); + } + this._id = key.getId(); + } + + @Override + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroup other = (AffinityOrAntiAffinityGroup)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupImpl otherImpl = (AffinityOrAntiAffinityGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroup"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java new file mode 100644 index 0000000..e9d4fab --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupKey + implements Identifier { + private static final long serialVersionUID = -4909084403753675647L; + private final String _id; + + + public AffinityOrAntiAffinityGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupKey(AffinityOrAntiAffinityGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupKey)) { + return false; + } + final AffinityOrAntiAffinityGroupKey other = (AffinityOrAntiAffinityGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirements.java new file mode 100644 index 0000000..8887249 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirements.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the maximum bitrate requirements for a VL instantiated according to + * this profile. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container max-bitrate-requirements {
+ *   uses link-bitrate-requirements;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/virtual-link-profile/max-bitrate-requirements + * + *

To create instances of this class use {@link MaxBitrateRequirementsBuilder}. + * @see MaxBitrateRequirementsBuilder + * + */ +public interface MaxBitrateRequirements + extends + ChildOf, + Augmentable, + LinkBitrateRequirements +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("max-bitrate-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MaxBitrateRequirements.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirementsBuilder.java new file mode 100644 index 0000000..4bd5304 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MaxBitrateRequirementsBuilder.java @@ -0,0 +1,298 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link MaxBitrateRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MaxBitrateRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MaxBitrateRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MaxBitrateRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MaxBitrateRequirementsBuilder + * @see Builder + * + */ +public class MaxBitrateRequirementsBuilder implements Builder { + + private Uint64 _leaf; + private Uint64 _root; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MaxBitrateRequirementsBuilder() { + } + public MaxBitrateRequirementsBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements arg) { + this._root = arg.getRoot(); + this._leaf = arg.getLeaf(); + } + + public MaxBitrateRequirementsBuilder(MaxBitrateRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements) { + this._root = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements)arg).getRoot(); + this._leaf = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements)arg).getLeaf(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements]"); + } + + public Uint64 getLeaf() { + return _leaf; + } + + public Uint64 getRoot() { + return _root; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public MaxBitrateRequirementsBuilder setLeaf(final Uint64 value) { + this._leaf = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLeaf(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MaxBitrateRequirementsBuilder setLeaf(final BigInteger value) { + return setLeaf(CodeHelpers.compatUint(value)); + } + + public MaxBitrateRequirementsBuilder setRoot(final Uint64 value) { + this._root = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setRoot(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MaxBitrateRequirementsBuilder setRoot(final BigInteger value) { + return setRoot(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MaxBitrateRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MaxBitrateRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MaxBitrateRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MaxBitrateRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MaxBitrateRequirements build() { + return new MaxBitrateRequirementsImpl(this); + } + + private static final class MaxBitrateRequirementsImpl + extends AbstractAugmentable + implements MaxBitrateRequirements { + + private final Uint64 _leaf; + private final Uint64 _root; + + MaxBitrateRequirementsImpl(MaxBitrateRequirementsBuilder base) { + super(base.augmentation); + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + @Override + public Uint64 getLeaf() { + return _leaf; + } + + @Override + public Uint64 getRoot() { + return _root; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_leaf); + result = prime * result + Objects.hashCode(_root); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MaxBitrateRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MaxBitrateRequirements other = (MaxBitrateRequirements)obj; + if (!Objects.equals(_leaf, other.getLeaf())) { + return false; + } + if (!Objects.equals(_root, other.getRoot())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MaxBitrateRequirementsImpl otherImpl = (MaxBitrateRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MaxBitrateRequirements"); + CodeHelpers.appendValue(helper, "_leaf", _leaf); + CodeHelpers.appendValue(helper, "_root", _root); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirements.java new file mode 100644 index 0000000..687c7bf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirements.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the minimum bitrate requirements for a VL instantiated according to + * this profile. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container min-bitrate-requirements {
+ *   uses link-bitrate-requirements;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/virtual-link-profile/min-bitrate-requirements + * + *

To create instances of this class use {@link MinBitrateRequirementsBuilder}. + * @see MinBitrateRequirementsBuilder + * + */ +public interface MinBitrateRequirements + extends + ChildOf, + Augmentable, + LinkBitrateRequirements +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("min-bitrate-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile.MinBitrateRequirements.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirementsBuilder.java new file mode 100644 index 0000000..c10fe43 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/virtual/link/profile/MinBitrateRequirementsBuilder.java @@ -0,0 +1,298 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link MinBitrateRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MinBitrateRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MinBitrateRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MinBitrateRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MinBitrateRequirementsBuilder + * @see Builder + * + */ +public class MinBitrateRequirementsBuilder implements Builder { + + private Uint64 _leaf; + private Uint64 _root; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MinBitrateRequirementsBuilder() { + } + public MinBitrateRequirementsBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements arg) { + this._root = arg.getRoot(); + this._leaf = arg.getLeaf(); + } + + public MinBitrateRequirementsBuilder(MinBitrateRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements) { + this._root = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements)arg).getRoot(); + this._leaf = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements)arg).getLeaf(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LinkBitrateRequirements]"); + } + + public Uint64 getLeaf() { + return _leaf; + } + + public Uint64 getRoot() { + return _root; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public MinBitrateRequirementsBuilder setLeaf(final Uint64 value) { + this._leaf = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLeaf(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MinBitrateRequirementsBuilder setLeaf(final BigInteger value) { + return setLeaf(CodeHelpers.compatUint(value)); + } + + public MinBitrateRequirementsBuilder setRoot(final Uint64 value) { + this._root = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setRoot(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MinBitrateRequirementsBuilder setRoot(final BigInteger value) { + return setRoot(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MinBitrateRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MinBitrateRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MinBitrateRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MinBitrateRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MinBitrateRequirements build() { + return new MinBitrateRequirementsImpl(this); + } + + private static final class MinBitrateRequirementsImpl + extends AbstractAugmentable + implements MinBitrateRequirements { + + private final Uint64 _leaf; + private final Uint64 _root; + + MinBitrateRequirementsImpl(MinBitrateRequirementsBuilder base) { + super(base.augmentation); + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + @Override + public Uint64 getLeaf() { + return _leaf; + } + + @Override + public Uint64 getRoot() { + return _root; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_leaf); + result = prime * result + Objects.hashCode(_root); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MinBitrateRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MinBitrateRequirements other = (MinBitrateRequirements)obj; + if (!Objects.equals(_leaf, other.getLeaf())) { + return false; + } + if (!Objects.equals(_root, other.getRoot())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MinBitrateRequirementsImpl otherImpl = (MinBitrateRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MinBitrateRequirements"); + CodeHelpers.appendValue(helper, "_leaf", _leaf); + CodeHelpers.appendValue(helper, "_root", _root); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroup.java new file mode 100644 index 0000000..1599970 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroup.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifier(s) of the affinity or anti-affinity group(s) the VnfProfile belongs + * to. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group {
+ *   key id;
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../affinity-or-anti-affinity-group/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/vnf-profile/affinity-or-anti-affinity-group + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupBuilder}. + * @see AffinityOrAntiAffinityGroupBuilder + * @see AffinityOrAntiAffinityGroupKey + * + */ +public interface AffinityOrAntiAffinityGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.AffinityOrAntiAffinityGroup.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + AffinityOrAntiAffinityGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupBuilder.java new file mode 100644 index 0000000..d17abd3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupBuilder implements Builder { + + private String _id; + private AffinityOrAntiAffinityGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupBuilder() { + } + + public AffinityOrAntiAffinityGroupBuilder(AffinityOrAntiAffinityGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + } + + + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupBuilder withKey(final AffinityOrAntiAffinityGroupKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroup build() { + return new AffinityOrAntiAffinityGroupImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroup { + + private final String _id; + private final AffinityOrAntiAffinityGroupKey key; + + AffinityOrAntiAffinityGroupImpl(AffinityOrAntiAffinityGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupKey(base.getId()); + } + this._id = key.getId(); + } + + @Override + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroup other = (AffinityOrAntiAffinityGroup)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupImpl otherImpl = (AffinityOrAntiAffinityGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroup"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupKey.java new file mode 100644 index 0000000..092bb9d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/AffinityOrAntiAffinityGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupKey + implements Identifier { + private static final long serialVersionUID = -4909084403753675647L; + private final String _id; + + + public AffinityOrAntiAffinityGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupKey(AffinityOrAntiAffinityGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupKey)) { + return false; + } + final AffinityOrAntiAffinityGroupKey other = (AffinityOrAntiAffinityGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivity.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivity.java new file mode 100644 index 0000000..6fac8b1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivity.java @@ -0,0 +1,101 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity.ConstituentCpdId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity.ConstituentCpdIdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Defines the connection information of the VNF, it contains connection + * relationship between a VNF connection point and a NS Virtual Link. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-connectivity {
+ *   key virtual-link-profile-id;
+ *   leaf virtual-link-profile-id {
+ *     type leafref {
+ *       path ../../../virtual-link-profile/id;
+ *     }
+ *   }
+ *   list constituent-cpd-id {
+ *     key constituent-base-element-id;
+ *     leaf constituent-base-element-id {
+ *       type leafref {
+ *         path ../../../id;
+ *       }
+ *     }
+ *     leaf constituent-cpd-id {
+ *       type leafref {
+ *         path deref(../../../vnfd-id)/../ext-cpd/id;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/vnf-profile/virtual-link-connectivity + * + *

To create instances of this class use {@link VirtualLinkConnectivityBuilder}. + * @see VirtualLinkConnectivityBuilder + * @see VirtualLinkConnectivityKey + * + */ +public interface VirtualLinkConnectivity + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-connectivity"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.VirtualLinkConnectivity.class; + } + + /** + * Reference an NS VL profile. + * + * + * + * @return java.lang.String virtualLinkProfileId, or null if not present + */ + @Nullable String getVirtualLinkProfileId(); + + /** + * Describes a connection point on a VNF/PNF or a SAP which connects to virtual + * links instantiated from the profile identified in the virtualLinkProfileId + * attribute. + * + * + * + * @return java.util.Map constituentCpdId, or null if not present + */ + @Nullable Map getConstituentCpdId(); + + /** + * @return java.util.Map constituentCpdId, or an empty list if it is not present + */ + default @NonNull Map nonnullConstituentCpdId() { + return CodeHelpers.nonnull(getConstituentCpdId()); + } + + @Override + VirtualLinkConnectivityKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityBuilder.java new file mode 100644 index 0000000..17e5506 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityBuilder.java @@ -0,0 +1,291 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity.ConstituentCpdId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity.ConstituentCpdIdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkConnectivityBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkConnectivityBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkConnectivityBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkConnectivityBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkConnectivityBuilder + * @see Builder + * + */ +public class VirtualLinkConnectivityBuilder implements Builder { + + private Map _constituentCpdId; + private String _virtualLinkProfileId; + private VirtualLinkConnectivityKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkConnectivityBuilder() { + } + + public VirtualLinkConnectivityBuilder(VirtualLinkConnectivity base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + + public VirtualLinkConnectivityKey key() { + return key; + } + + public Map getConstituentCpdId() { + return _constituentCpdId; + } + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkConnectivityBuilder withKey(final VirtualLinkConnectivityKey key) { + this.key = key; + return this; + } + public VirtualLinkConnectivityBuilder setConstituentCpdId(final Map values) { + this._constituentCpdId = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setConstituentCpdId(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkConnectivityBuilder setConstituentCpdId(final List values) { + return setConstituentCpdId(CodeHelpers.compatMap(values)); + } + + public VirtualLinkConnectivityBuilder setVirtualLinkProfileId(final String value) { + this._virtualLinkProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkConnectivityBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkConnectivityBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkConnectivityBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkConnectivityBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkConnectivity build() { + return new VirtualLinkConnectivityImpl(this); + } + + private static final class VirtualLinkConnectivityImpl + extends AbstractAugmentable + implements VirtualLinkConnectivity { + + private final Map _constituentCpdId; + private final String _virtualLinkProfileId; + private final VirtualLinkConnectivityKey key; + + VirtualLinkConnectivityImpl(VirtualLinkConnectivityBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkConnectivityKey(base.getVirtualLinkProfileId()); + } + this._virtualLinkProfileId = key.getVirtualLinkProfileId(); + this._constituentCpdId = CodeHelpers.emptyToNull(base.getConstituentCpdId()); + } + + @Override + public VirtualLinkConnectivityKey key() { + return key; + } + + @Override + public Map getConstituentCpdId() { + return _constituentCpdId; + } + + @Override + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentCpdId); + result = prime * result + Objects.hashCode(_virtualLinkProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkConnectivity.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkConnectivity other = (VirtualLinkConnectivity)obj; + if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { + return false; + } + if (!Objects.equals(_virtualLinkProfileId, other.getVirtualLinkProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkConnectivityImpl otherImpl = (VirtualLinkConnectivityImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkConnectivity"); + CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityKey.java new file mode 100644 index 0000000..4d1b23f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/VirtualLinkConnectivityKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkConnectivityKey + implements Identifier { + private static final long serialVersionUID = -1012322664145801683L; + private final String _virtualLinkProfileId; + + + public VirtualLinkConnectivityKey(String _virtualLinkProfileId) { + + this._virtualLinkProfileId = _virtualLinkProfileId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkConnectivityKey(VirtualLinkConnectivityKey source) { + this._virtualLinkProfileId = source._virtualLinkProfileId; + } + + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_virtualLinkProfileId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkConnectivityKey)) { + return false; + } + final VirtualLinkConnectivityKey other = (VirtualLinkConnectivityKey) obj; + if (!Objects.equals(_virtualLinkProfileId, other._virtualLinkProfileId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkConnectivityKey.class); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdId.java new file mode 100644 index 0000000..1863111 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdId.java @@ -0,0 +1,83 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity; +import java.lang.Class; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes a connection point on a VNF/PNF or a SAP which connects to virtual + * links instantiated from the profile identified in the virtualLinkProfileId + * attribute. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list constituent-cpd-id {
+ *   key constituent-base-element-id;
+ *   leaf constituent-base-element-id {
+ *     type leafref {
+ *       path ../../../id;
+ *     }
+ *   }
+ *   leaf constituent-cpd-id {
+ *     type leafref {
+ *       path deref(../../../vnfd-id)/../ext-cpd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/vnf-profile/virtual-link-connectivity/constituent-cpd-id + * + *

To create instances of this class use {@link ConstituentCpdIdBuilder}. + * @see ConstituentCpdIdBuilder + * @see ConstituentCpdIdKey + * + */ +public interface ConstituentCpdId + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("constituent-cpd-id"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity.ConstituentCpdId.class; + } + + /** + * Reference to the profile of an NS constituent. + * + * + * + * @return java.lang.String constituentBaseElementId, or null if not present + */ + @Nullable String getConstituentBaseElementId(); + + /** + * A reference to the descriptor of a connection point attached to one of the + * constituent VNFs and PNFs or to the descriptor of a NS SAP. + * + * + * + * @return java.lang.Object constituentCpdId, or null if not present + */ + @Nullable Object getConstituentCpdId(); + + @Override + ConstituentCpdIdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java new file mode 100644 index 0000000..e929a16 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConstituentCpdIdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConstituentCpdIdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConstituentCpdIdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConstituentCpdIdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConstituentCpdIdBuilder + * @see Builder + * + */ +public class ConstituentCpdIdBuilder implements Builder { + + private String _constituentBaseElementId; + private Object _constituentCpdId; + private ConstituentCpdIdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConstituentCpdIdBuilder() { + } + + public ConstituentCpdIdBuilder(ConstituentCpdId base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._constituentBaseElementId = base.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + + public ConstituentCpdIdKey key() { + return key; + } + + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + public Object getConstituentCpdId() { + return _constituentCpdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ConstituentCpdIdBuilder withKey(final ConstituentCpdIdKey key) { + this.key = key; + return this; + } + + public ConstituentCpdIdBuilder setConstituentBaseElementId(final String value) { + this._constituentBaseElementId = value; + return this; + } + + public ConstituentCpdIdBuilder setConstituentCpdId(final Object value) { + this._constituentCpdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConstituentCpdIdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConstituentCpdIdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConstituentCpdIdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConstituentCpdIdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConstituentCpdId build() { + return new ConstituentCpdIdImpl(this); + } + + private static final class ConstituentCpdIdImpl + extends AbstractAugmentable + implements ConstituentCpdId { + + private final String _constituentBaseElementId; + private final Object _constituentCpdId; + private final ConstituentCpdIdKey key; + + ConstituentCpdIdImpl(ConstituentCpdIdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ConstituentCpdIdKey(base.getConstituentBaseElementId()); + } + this._constituentBaseElementId = key.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + @Override + public ConstituentCpdIdKey key() { + return key; + } + + @Override + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + @Override + public Object getConstituentCpdId() { + return _constituentCpdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentBaseElementId); + result = prime * result + Objects.hashCode(_constituentCpdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConstituentCpdId.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConstituentCpdId other = (ConstituentCpdId)obj; + if (!Objects.equals(_constituentBaseElementId, other.getConstituentBaseElementId())) { + return false; + } + if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConstituentCpdIdImpl otherImpl = (ConstituentCpdIdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConstituentCpdId"); + CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); + CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java new file mode 100644 index 0000000..3487c06 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/vnf/profile/virtual/link/connectivity/ConstituentCpdIdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.vnf.profile.virtual.link.connectivity; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ConstituentCpdIdKey + implements Identifier { + private static final long serialVersionUID = -6015428103661446636L; + private final String _constituentBaseElementId; + + + public ConstituentCpdIdKey(String _constituentBaseElementId) { + + this._constituentBaseElementId = _constituentBaseElementId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ConstituentCpdIdKey(ConstituentCpdIdKey source) { + this._constituentBaseElementId = source._constituentBaseElementId; + } + + + public String getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_constituentBaseElementId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ConstituentCpdIdKey)) { + return false; + } + final ConstituentCpdIdKey other = (ConstituentCpdIdKey) obj; + if (!Objects.equals(_constituentBaseElementId, other._constituentBaseElementId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ConstituentCpdIdKey.class); + CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/CpdOrVirtualLink.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/CpdOrVirtualLink.java new file mode 100644 index 0000000..46232d0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/CpdOrVirtualLink.java @@ -0,0 +1,82 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * choice cpd-or-virtual-link {
+ *   case virtual-link-desc {
+ *     leaf virtual-link-desc {
+ *       type leafref {
+ *         path ../../virtual-link-desc/id;
+ *       }
+ *     }
+ *   }
+ *   case vnf {
+ *     container vnf {
+ *       leaf vnfd-id {
+ *         type leafref {
+ *           path ../../../../vnfd/id;
+ *         }
+ *         must boolean(../../../vnfd-id[.=current()]);
+ *       }
+ *       leaf ext-cpd-id {
+ *         type leafref {
+ *           path deref(../vnfd-id)/../ext-cpd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case pnf {
+ *     container pnf {
+ *       leaf pnfd-id {
+ *         type leafref {
+ *           path ../../../../pnfd/id;
+ *         }
+ *         must boolean(../pnfd-id[.=current()]);
+ *       }
+ *       leaf ext-cpd-id {
+ *         type leafref {
+ *           path deref(../pnfd-id)/../ext-cpd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case ns {
+ *     container ns {
+ *       leaf nsd-id {
+ *         type leafref {
+ *           path ../../../../nsd/id;
+ *         }
+ *         must boolean(../nsd-id[.=current()]);
+ *       }
+ *       leaf ext-cpd-id {
+ *         type leafref {
+ *           path deref(../nsd-id)/../sapd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/sapd/cpd-or-virtual-link + * + */ +public interface CpdOrVirtualLink + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cpd-or-virtual-link"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Ns.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Ns.java new file mode 100644 index 0000000..c9bb4d3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Ns.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface Ns + extends + DataObject, + Augmentable, + CpdOrVirtualLink +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.Ns.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.Ns ns, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.@Nullable Ns getNs(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/NsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/NsBuilder.java new file mode 100644 index 0000000..d68eb12 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/NsBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsBuilder + * @see Builder + * + */ +public class NsBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.Ns _ns; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsBuilder() { + } + + public NsBuilder(Ns base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._ns = base.getNs(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.Ns getNs() { + return _ns; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public NsBuilder setNs(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.Ns value) { + this._ns = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Ns build() { + return new NsImpl(this); + } + + private static final class NsImpl + extends AbstractAugmentable + implements Ns { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.Ns _ns; + + NsImpl(NsBuilder base) { + super(base.augmentation); + this._ns = base.getNs(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.Ns getNs() { + return _ns; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_ns); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Ns.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Ns other = (Ns)obj; + if (!Objects.equals(_ns, other.getNs())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsImpl otherImpl = (NsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Ns"); + CodeHelpers.appendValue(helper, "_ns", _ns); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Pnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Pnf.java new file mode 100644 index 0000000..2d80b7d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Pnf.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface Pnf + extends + DataObject, + Augmentable, + CpdOrVirtualLink +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.Pnf.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.Pnf pnf, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.@Nullable Pnf getPnf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/PnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/PnfBuilder.java new file mode 100644 index 0000000..eaf0ed5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/PnfBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfBuilder + * @see Builder + * + */ +public class PnfBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.Pnf _pnf; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfBuilder() { + } + + public PnfBuilder(Pnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._pnf = base.getPnf(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.Pnf getPnf() { + return _pnf; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PnfBuilder setPnf(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.Pnf value) { + this._pnf = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnf build() { + return new PnfImpl(this); + } + + private static final class PnfImpl + extends AbstractAugmentable + implements Pnf { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.Pnf _pnf; + + PnfImpl(PnfBuilder base) { + super(base.augmentation); + this._pnf = base.getPnf(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.Pnf getPnf() { + return _pnf; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_pnf); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnf other = (Pnf)obj; + if (!Objects.equals(_pnf, other.getPnf())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfImpl otherImpl = (PnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnf"); + CodeHelpers.appendValue(helper, "_pnf", _pnf); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDesc.java new file mode 100644 index 0000000..265b5f1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDesc.java @@ -0,0 +1,40 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface VirtualLinkDesc + extends + DataObject, + Augmentable, + CpdOrVirtualLink +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.VirtualLinkDesc.class; + } + + /** + * References the descriptor of the NS VL instance to which the SAP instantiated + * from this SAPD connects to. + * + * + * + * @return java.lang.String virtualLinkDesc, or null if not present + */ + @Nullable String getVirtualLinkDesc(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDescBuilder.java new file mode 100644 index 0000000..0d7fad5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VirtualLinkDescBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkDescBuilder + * @see Builder + * + */ +public class VirtualLinkDescBuilder implements Builder { + + private String _virtualLinkDesc; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkDescBuilder() { + } + + public VirtualLinkDescBuilder(VirtualLinkDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._virtualLinkDesc = base.getVirtualLinkDesc(); + } + + + public String getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VirtualLinkDescBuilder setVirtualLinkDesc(final String value) { + this._virtualLinkDesc = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkDesc build() { + return new VirtualLinkDescImpl(this); + } + + private static final class VirtualLinkDescImpl + extends AbstractAugmentable + implements VirtualLinkDesc { + + private final String _virtualLinkDesc; + + VirtualLinkDescImpl(VirtualLinkDescBuilder base) { + super(base.augmentation); + this._virtualLinkDesc = base.getVirtualLinkDesc(); + } + + @Override + public String getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_virtualLinkDesc); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkDesc other = (VirtualLinkDesc)obj; + if (!Objects.equals(_virtualLinkDesc, other.getVirtualLinkDesc())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkDescImpl otherImpl = (VirtualLinkDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkDesc"); + CodeHelpers.appendValue(helper, "_virtualLinkDesc", _virtualLinkDesc); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Vnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Vnf.java new file mode 100644 index 0000000..04c279f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/Vnf.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface Vnf + extends + DataObject, + Augmentable, + CpdOrVirtualLink +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.Vnf.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.Vnf vnf, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.@Nullable Vnf getVnf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VnfBuilder.java new file mode 100644 index 0000000..3bc3dc5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/VnfBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfBuilder + * @see Builder + * + */ +public class VnfBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.Vnf _vnf; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfBuilder() { + } + + public VnfBuilder(Vnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._vnf = base.getVnf(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.Vnf getVnf() { + return _vnf; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VnfBuilder setVnf(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.Vnf value) { + this._vnf = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnf build() { + return new VnfImpl(this); + } + + private static final class VnfImpl + extends AbstractAugmentable + implements Vnf { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.Vnf _vnf; + + VnfImpl(VnfBuilder base) { + super(base.augmentation); + this._vnf = base.getVnf(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.Vnf getVnf() { + return _vnf; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_vnf); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnf other = (Vnf)obj; + if (!Objects.equals(_vnf, other.getVnf())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfImpl otherImpl = (VnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnf"); + CodeHelpers.appendValue(helper, "_vnf", _vnf); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/Ns.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/Ns.java new file mode 100644 index 0000000..3b093b1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/Ns.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container ns {
+ *   leaf nsd-id {
+ *     type leafref {
+ *       path ../../../../nsd/id;
+ *     }
+ *     must boolean(../nsd-id[.=current()]);
+ *   }
+ *   leaf ext-cpd-id {
+ *     type leafref {
+ *       path deref(../nsd-id)/../sapd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/sapd/cpd-or-virtual-link/ns/ns + * + *

To create instances of this class use {@link NsBuilder}. + * @see NsBuilder + * + */ +public interface Ns + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns.Ns.class; + } + + /** + * @return java.lang.String nsdId, or null if not present + */ + @Nullable String getNsdId(); + + /** + * @return java.lang.String extCpdId, or null if not present + */ + @Nullable String getExtCpdId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/NsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/NsBuilder.java new file mode 100644 index 0000000..071fd3c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/ns/NsBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.ns; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsBuilder + * @see Builder + * + */ +public class NsBuilder implements Builder { + + private String _extCpdId; + private String _nsdId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsBuilder() { + } + + public NsBuilder(Ns base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._extCpdId = base.getExtCpdId(); + this._nsdId = base.getNsdId(); + } + + + public String getExtCpdId() { + return _extCpdId; + } + + public String getNsdId() { + return _nsdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public NsBuilder setExtCpdId(final String value) { + this._extCpdId = value; + return this; + } + + public NsBuilder setNsdId(final String value) { + this._nsdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Ns build() { + return new NsImpl(this); + } + + private static final class NsImpl + extends AbstractAugmentable + implements Ns { + + private final String _extCpdId; + private final String _nsdId; + + NsImpl(NsBuilder base) { + super(base.augmentation); + this._extCpdId = base.getExtCpdId(); + this._nsdId = base.getNsdId(); + } + + @Override + public String getExtCpdId() { + return _extCpdId; + } + + @Override + public String getNsdId() { + return _nsdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extCpdId); + result = prime * result + Objects.hashCode(_nsdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Ns.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Ns other = (Ns)obj; + if (!Objects.equals(_extCpdId, other.getExtCpdId())) { + return false; + } + if (!Objects.equals(_nsdId, other.getNsdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsImpl otherImpl = (NsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Ns"); + CodeHelpers.appendValue(helper, "_extCpdId", _extCpdId); + CodeHelpers.appendValue(helper, "_nsdId", _nsdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/Pnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/Pnf.java new file mode 100644 index 0000000..6b2c1f4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/Pnf.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container pnf {
+ *   leaf pnfd-id {
+ *     type leafref {
+ *       path ../../../../pnfd/id;
+ *     }
+ *     must boolean(../pnfd-id[.=current()]);
+ *   }
+ *   leaf ext-cpd-id {
+ *     type leafref {
+ *       path deref(../pnfd-id)/../ext-cpd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/sapd/cpd-or-virtual-link/pnf/pnf + * + *

To create instances of this class use {@link PnfBuilder}. + * @see PnfBuilder + * + */ +public interface Pnf + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf.Pnf.class; + } + + /** + * @return java.lang.String pnfdId, or null if not present + */ + @Nullable String getPnfdId(); + + /** + * @return java.lang.String extCpdId, or null if not present + */ + @Nullable String getExtCpdId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/PnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/PnfBuilder.java new file mode 100644 index 0000000..f4e48e5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/pnf/PnfBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.pnf; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfBuilder + * @see Builder + * + */ +public class PnfBuilder implements Builder { + + private String _extCpdId; + private String _pnfdId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfBuilder() { + } + + public PnfBuilder(Pnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._extCpdId = base.getExtCpdId(); + this._pnfdId = base.getPnfdId(); + } + + + public String getExtCpdId() { + return _extCpdId; + } + + public String getPnfdId() { + return _pnfdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PnfBuilder setExtCpdId(final String value) { + this._extCpdId = value; + return this; + } + + public PnfBuilder setPnfdId(final String value) { + this._pnfdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnf build() { + return new PnfImpl(this); + } + + private static final class PnfImpl + extends AbstractAugmentable + implements Pnf { + + private final String _extCpdId; + private final String _pnfdId; + + PnfImpl(PnfBuilder base) { + super(base.augmentation); + this._extCpdId = base.getExtCpdId(); + this._pnfdId = base.getPnfdId(); + } + + @Override + public String getExtCpdId() { + return _extCpdId; + } + + @Override + public String getPnfdId() { + return _pnfdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extCpdId); + result = prime * result + Objects.hashCode(_pnfdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnf other = (Pnf)obj; + if (!Objects.equals(_extCpdId, other.getExtCpdId())) { + return false; + } + if (!Objects.equals(_pnfdId, other.getPnfdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfImpl otherImpl = (PnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnf"); + CodeHelpers.appendValue(helper, "_extCpdId", _extCpdId); + CodeHelpers.appendValue(helper, "_pnfdId", _pnfdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/Vnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/Vnf.java new file mode 100644 index 0000000..19e89aa --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/Vnf.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container vnf {
+ *   leaf vnfd-id {
+ *     type leafref {
+ *       path ../../../../vnfd/id;
+ *     }
+ *     must boolean(../../../vnfd-id[.=current()]);
+ *   }
+ *   leaf ext-cpd-id {
+ *     type leafref {
+ *       path deref(../vnfd-id)/../ext-cpd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/sapd/cpd-or-virtual-link/vnf/vnf + * + *

To create instances of this class use {@link VnfBuilder}. + * @see VnfBuilder + * + */ +public interface Vnf + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf.Vnf.class; + } + + /** + * @return java.lang.String vnfdId, or null if not present + */ + @Nullable String getVnfdId(); + + /** + * @return java.lang.String extCpdId, or null if not present + */ + @Nullable String getExtCpdId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/VnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/VnfBuilder.java new file mode 100644 index 0000000..c8f7773 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/sapd/cpd/or/virtual/link/vnf/VnfBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.cpd.or.virtual.link.vnf; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfBuilder + * @see Builder + * + */ +public class VnfBuilder implements Builder { + + private String _extCpdId; + private String _vnfdId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfBuilder() { + } + + public VnfBuilder(Vnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._extCpdId = base.getExtCpdId(); + this._vnfdId = base.getVnfdId(); + } + + + public String getExtCpdId() { + return _extCpdId; + } + + public String getVnfdId() { + return _vnfdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VnfBuilder setExtCpdId(final String value) { + this._extCpdId = value; + return this; + } + + public VnfBuilder setVnfdId(final String value) { + this._vnfdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnf build() { + return new VnfImpl(this); + } + + private static final class VnfImpl + extends AbstractAugmentable + implements Vnf { + + private final String _extCpdId; + private final String _vnfdId; + + VnfImpl(VnfBuilder base) { + super(base.augmentation); + this._extCpdId = base.getExtCpdId(); + this._vnfdId = base.getVnfdId(); + } + + @Override + public String getExtCpdId() { + return _extCpdId; + } + + @Override + public String getVnfdId() { + return _vnfdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extCpdId); + result = prime * result + Objects.hashCode(_vnfdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnf other = (Vnf)obj; + if (!Objects.equals(_extCpdId, other.getExtCpdId())) { + return false; + } + if (!Objects.equals(_vnfdId, other.getVnfdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfImpl otherImpl = (VnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnf"); + CodeHelpers.appendValue(helper, "_extCpdId", _extCpdId); + CodeHelpers.appendValue(helper, "_vnfdId", _vnfdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/Df.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/Df.java new file mode 100644 index 0000000..fbdf5fb --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/Df.java @@ -0,0 +1,181 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.df.Qos; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The VirtualLinkDf information element specifies properties for instantiating a + * VL according to a specific flavour. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list df {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   container qos {
+ *     presence "VL QoS parameters";
+ *     leaf latency {
+ *       type uint32;
+ *       units ms;
+ *     }
+ *     leaf packet-delay-variation {
+ *       type uint32;
+ *       units ms;
+ *     }
+ *     leaf packet-loss-ratio {
+ *       type decimal64 {
+ *         fraction-digits 2;
+ *         range 0..1.00;
+ *       }
+ *     }
+ *     leaf priority {
+ *       type uint32;
+ *     }
+ *   }
+ *   leaf service-availability-level {
+ *     type enumeration {
+ *       enum level-1;
+ *       enum level-2;
+ *       enum level-3;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/virtual-link-desc/df + * + *

To create instances of this class use {@link DfBuilder}. + * @see DfBuilder + * @see DfKey + * + */ +public interface Df + extends + ChildOf, + Augmentable, + Identifiable +{ + + + public enum ServiceAvailabilityLevel implements Enumeration { + Level1(0, "level-1"), + + Level2(1, "level-2"), + + Level3(2, "level-3") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (ServiceAvailabilityLevel enumItem : ServiceAvailabilityLevel.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private ServiceAvailabilityLevel(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding ServiceAvailabilityLevel item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding ServiceAvailabilityLevel item, or null if no such item exists + */ + public static ServiceAvailabilityLevel forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("df"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.Df.class; + } + + /** + * Identifies this VirtualLinkDf information element within a VLD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The QoS information element specifies quality of service parameters applicable + * to a VL. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.df.Qos qos, or null if not present + */ + @Nullable Qos getQos(); + + /** + * Specifies one of the three levels defined in ETSI ETSI GS NFV-REL 001 [i.5] * + * Level 1. * Level 2. * Level 3. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.Df.ServiceAvailabilityLevel serviceAvailabilityLevel, or null if not present + */ + @Nullable ServiceAvailabilityLevel getServiceAvailabilityLevel(); + + @Override + DfKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfBuilder.java new file mode 100644 index 0000000..9b14903 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfBuilder.java @@ -0,0 +1,295 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.df.Qos; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link DfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DfBuilder + * @see Builder + * + */ +public class DfBuilder implements Builder { + + private String _id; + private Qos _qos; + private Df.ServiceAvailabilityLevel _serviceAvailabilityLevel; + private DfKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DfBuilder() { + } + + public DfBuilder(Df base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._qos = base.getQos(); + this._serviceAvailabilityLevel = base.getServiceAvailabilityLevel(); + } + + + public DfKey key() { + return key; + } + + public String getId() { + return _id; + } + + public Qos getQos() { + return _qos; + } + + public Df.ServiceAvailabilityLevel getServiceAvailabilityLevel() { + return _serviceAvailabilityLevel; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public DfBuilder withKey(final DfKey key) { + this.key = key; + return this; + } + + public DfBuilder setId(final String value) { + this._id = value; + return this; + } + + public DfBuilder setQos(final Qos value) { + this._qos = value; + return this; + } + + public DfBuilder setServiceAvailabilityLevel(final Df.ServiceAvailabilityLevel value) { + this._serviceAvailabilityLevel = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Df build() { + return new DfImpl(this); + } + + private static final class DfImpl + extends AbstractAugmentable + implements Df { + + private final String _id; + private final Qos _qos; + private final Df.ServiceAvailabilityLevel _serviceAvailabilityLevel; + private final DfKey key; + + DfImpl(DfBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new DfKey(base.getId()); + } + this._id = key.getId(); + this._qos = base.getQos(); + this._serviceAvailabilityLevel = base.getServiceAvailabilityLevel(); + } + + @Override + public DfKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Qos getQos() { + return _qos; + } + + @Override + public Df.ServiceAvailabilityLevel getServiceAvailabilityLevel() { + return _serviceAvailabilityLevel; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_qos); + result = prime * result + Objects.hashCode(_serviceAvailabilityLevel); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Df.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Df other = (Df)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_qos, other.getQos())) { + return false; + } + if (!Objects.equals(_serviceAvailabilityLevel, other.getServiceAvailabilityLevel())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DfImpl otherImpl = (DfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Df"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_qos", _qos); + CodeHelpers.appendValue(helper, "_serviceAvailabilityLevel", _serviceAvailabilityLevel); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfKey.java new file mode 100644 index 0000000..7997647 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/DfKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class DfKey + implements Identifier { + private static final long serialVersionUID = 4083286612161956839L; + private final String _id; + + + public DfKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public DfKey(DfKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DfKey)) { + return false; + } + final DfKey other = (DfKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(DfKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/Qos.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/Qos.java new file mode 100644 index 0000000..04280a7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/Qos.java @@ -0,0 +1,101 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.df; +import java.lang.Class; +import java.lang.Override; +import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * The QoS information element specifies quality of service parameters applicable + * to a VL. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container qos {
+ *   presence "VL QoS parameters";
+ *   leaf latency {
+ *     type uint32;
+ *     units ms;
+ *   }
+ *   leaf packet-delay-variation {
+ *     type uint32;
+ *     units ms;
+ *   }
+ *   leaf packet-loss-ratio {
+ *     type decimal64 {
+ *       fraction-digits 2;
+ *       range 0..1.00;
+ *     }
+ *   }
+ *   leaf priority {
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/virtual-link-desc/df/qos + * + *

To create instances of this class use {@link QosBuilder}. + * @see QosBuilder + * + */ +public interface Qos + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("qos"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.df.Qos.class; + } + + /** + * Specifies the maximum latency in ms. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 latency, or null if not present + */ + @Nullable Uint32 getLatency(); + + /** + * Specifies the maximum jitter in ms. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 packetDelayVariation, or null if not present + */ + @Nullable Uint32 getPacketDelayVariation(); + + /** + * Specifies the maximum packet loss ratio. + * + * + * + * @return java.math.BigDecimal packetLossRatio, or null if not present + */ + @Nullable BigDecimal getPacketLossRatio(); + + /** + * Specifies the priority level in case of congestion on the underlying physical + * links. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 priority, or null if not present + */ + @Nullable Uint32 getPriority(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/QosBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/QosBuilder.java new file mode 100644 index 0000000..af6d2e2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/virtual/link/desc/df/QosBuilder.java @@ -0,0 +1,357 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.df; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Range; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link QosBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     QosBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new QosBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of QosBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see QosBuilder + * @see Builder + * + */ +public class QosBuilder implements Builder { + + private Uint32 _latency; + private Uint32 _packetDelayVariation; + private BigDecimal _packetLossRatio; + private Uint32 _priority; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public QosBuilder() { + } + + public QosBuilder(Qos base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._latency = base.getLatency(); + this._packetDelayVariation = base.getPacketDelayVariation(); + this._packetLossRatio = base.getPacketLossRatio(); + this._priority = base.getPriority(); + } + + + public Uint32 getLatency() { + return _latency; + } + + public Uint32 getPacketDelayVariation() { + return _packetDelayVariation; + } + + public BigDecimal getPacketLossRatio() { + return _packetLossRatio; + } + + public Uint32 getPriority() { + return _priority; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public QosBuilder setLatency(final Uint32 value) { + this._latency = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLatency(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public QosBuilder setLatency(final Long value) { + return setLatency(CodeHelpers.compatUint(value)); + } + + public QosBuilder setPacketDelayVariation(final Uint32 value) { + this._packetDelayVariation = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setPacketDelayVariation(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public QosBuilder setPacketDelayVariation(final Long value) { + return setPacketDelayVariation(CodeHelpers.compatUint(value)); + } + + private static final Range[] CHECKPACKETLOSSRATIORANGE_RANGES; + static { + @SuppressWarnings("unchecked") + final Range[] a = (Range[]) Array.newInstance(Range.class, 1); + a[0] = Range.closed(java.math.BigDecimal.ZERO, new java.math.BigDecimal("1.00")); + CHECKPACKETLOSSRATIORANGE_RANGES = a; + } + private static void checkPacketLossRatioRange(final java.math.BigDecimal value) { + for (Range r : CHECKPACKETLOSSRATIORANGE_RANGES) { + if (r.contains(value)) { + return; + } + } + CodeHelpers.throwInvalidRange(CHECKPACKETLOSSRATIORANGE_RANGES, value); + } + + public QosBuilder setPacketLossRatio(final BigDecimal value) { + if (value != null) { + checkPacketLossRatioRange(value); + + } + this._packetLossRatio = value; + return this; + } + + public QosBuilder setPriority(final Uint32 value) { + this._priority = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setPriority(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public QosBuilder setPriority(final Long value) { + return setPriority(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public QosBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public QosBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public QosBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private QosBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Qos build() { + return new QosImpl(this); + } + + private static final class QosImpl + extends AbstractAugmentable + implements Qos { + + private final Uint32 _latency; + private final Uint32 _packetDelayVariation; + private final BigDecimal _packetLossRatio; + private final Uint32 _priority; + + QosImpl(QosBuilder base) { + super(base.augmentation); + this._latency = base.getLatency(); + this._packetDelayVariation = base.getPacketDelayVariation(); + this._packetLossRatio = base.getPacketLossRatio(); + this._priority = base.getPriority(); + } + + @Override + public Uint32 getLatency() { + return _latency; + } + + @Override + public Uint32 getPacketDelayVariation() { + return _packetDelayVariation; + } + + @Override + public BigDecimal getPacketLossRatio() { + return _packetLossRatio; + } + + @Override + public Uint32 getPriority() { + return _priority; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_latency); + result = prime * result + Objects.hashCode(_packetDelayVariation); + result = prime * result + Objects.hashCode(_packetLossRatio); + result = prime * result + Objects.hashCode(_priority); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Qos.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Qos other = (Qos)obj; + if (!Objects.equals(_latency, other.getLatency())) { + return false; + } + if (!Objects.equals(_packetDelayVariation, other.getPacketDelayVariation())) { + return false; + } + if (!Objects.equals(_packetLossRatio, other.getPacketLossRatio())) { + return false; + } + if (!Objects.equals(_priority, other.getPriority())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + QosImpl otherImpl = (QosImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Qos"); + CodeHelpers.appendValue(helper, "_latency", _latency); + CodeHelpers.appendValue(helper, "_packetDelayVariation", _packetDelayVariation); + CodeHelpers.appendValue(helper, "_packetLossRatio", _packetLossRatio); + CodeHelpers.appendValue(helper, "_priority", _priority); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPool.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPool.java new file mode 100644 index 0000000..989a410 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPool.java @@ -0,0 +1,155 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentBaseElementId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentCpdId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes a pool of descriptors of connection points attached to one of the + * constituent VNFs and PNFs and/or one of the SAPs of the parent NS or of a + * NS. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list cpd-pool {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   choice constituent-base-element-id {
+ *     case vnf-profile {
+ *       container vnf-profile {
+ *         leaf vnf-profile-id {
+ *           type leafref {
+ *             path ../../../../../nsd/df/vnf-profile/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case pnf-profile {
+ *       container pnf-profile {
+ *         leaf pnf-profile-id {
+ *           type leafref {
+ *             path ../../../../../nsd/df/pnf-profile/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case ns-profile {
+ *       container ns-profile {
+ *         leaf ns-profile-id {
+ *           type leafref {
+ *             path ../../../../../nsd/df/ns-profile/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   choice constituent-cpd-id {
+ *     case vnf {
+ *       container vnf {
+ *         leaf vnfd-id {
+ *           type leafref {
+ *             path ../../../../../vnfd/id;
+ *           }
+ *         }
+ *         leaf cpd-id {
+ *           type leafref {
+ *             path deref(../vnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case pnf {
+ *       container pnf {
+ *         leaf pnfd-id {
+ *           type leafref {
+ *             path ../../../../../pnfd/id;
+ *           }
+ *         }
+ *         leaf pnf-cpd-id {
+ *           type leafref {
+ *             path deref(../pnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case ns {
+ *       container ns {
+ *         leaf nsd-id {
+ *           type leafref {
+ *             path ../../../../../nsd/id;
+ *           }
+ *         }
+ *         leaf sap-cpd-id {
+ *           type leafref {
+ *             path deref(../nsd-id)/../sapd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool + * + *

To create instances of this class use {@link CpdPoolBuilder}. + * @see CpdPoolBuilder + * @see CpdPoolKey + * + */ +public interface CpdPool + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cpd-pool"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Reference to the profile of an NS constituent. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentBaseElementId constituentBaseElementId, or null if not present + */ + @Nullable ConstituentBaseElementId getConstituentBaseElementId(); + + /** + * A reference to the descriptor of a connection point attached to one of the + * constituent VNFs and PNFs or to the descriptor of a NS SAP. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentCpdId constituentCpdId, or null if not present + */ + @Nullable ConstituentCpdId getConstituentCpdId(); + + @Override + CpdPoolKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolBuilder.java new file mode 100644 index 0000000..c4ab493 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentBaseElementId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentCpdId; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link CpdPoolBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     CpdPoolBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new CpdPoolBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of CpdPoolBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see CpdPoolBuilder + * @see Builder + * + */ +public class CpdPoolBuilder implements Builder { + + private ConstituentBaseElementId _constituentBaseElementId; + private ConstituentCpdId _constituentCpdId; + private String _id; + private CpdPoolKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public CpdPoolBuilder() { + } + + public CpdPoolBuilder(CpdPool base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._constituentBaseElementId = base.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + + public CpdPoolKey key() { + return key; + } + + public ConstituentBaseElementId getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + public ConstituentCpdId getConstituentCpdId() { + return _constituentCpdId; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public CpdPoolBuilder withKey(final CpdPoolKey key) { + this.key = key; + return this; + } + + public CpdPoolBuilder setConstituentBaseElementId(final ConstituentBaseElementId value) { + this._constituentBaseElementId = value; + return this; + } + + public CpdPoolBuilder setConstituentCpdId(final ConstituentCpdId value) { + this._constituentCpdId = value; + return this; + } + + public CpdPoolBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public CpdPoolBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public CpdPoolBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public CpdPoolBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private CpdPoolBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public CpdPool build() { + return new CpdPoolImpl(this); + } + + private static final class CpdPoolImpl + extends AbstractAugmentable + implements CpdPool { + + private final ConstituentBaseElementId _constituentBaseElementId; + private final ConstituentCpdId _constituentCpdId; + private final String _id; + private final CpdPoolKey key; + + CpdPoolImpl(CpdPoolBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new CpdPoolKey(base.getId()); + } + this._id = key.getId(); + this._constituentBaseElementId = base.getConstituentBaseElementId(); + this._constituentCpdId = base.getConstituentCpdId(); + } + + @Override + public CpdPoolKey key() { + return key; + } + + @Override + public ConstituentBaseElementId getConstituentBaseElementId() { + return _constituentBaseElementId; + } + + @Override + public ConstituentCpdId getConstituentCpdId() { + return _constituentCpdId; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentBaseElementId); + result = prime * result + Objects.hashCode(_constituentCpdId); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!CpdPool.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + CpdPool other = (CpdPool)obj; + if (!Objects.equals(_constituentBaseElementId, other.getConstituentBaseElementId())) { + return false; + } + if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + CpdPoolImpl otherImpl = (CpdPoolImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("CpdPool"); + CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); + CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolKey.java new file mode 100644 index 0000000..de095e3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/CpdPoolKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class CpdPoolKey + implements Identifier { + private static final long serialVersionUID = 7881550034162738138L; + private final String _id; + + + public CpdPoolKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public CpdPoolKey(CpdPoolKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CpdPoolKey)) { + return false; + } + final CpdPoolKey other = (CpdPoolKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(CpdPoolKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/Nfpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/Nfpd.java new file mode 100644 index 0000000..5f5793d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/Nfpd.java @@ -0,0 +1,124 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.PositionDescId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.PositionDescIdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The network forwarding path associated to the VNFFG. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list nfpd {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf rule {
+ *     type string;
+ *   }
+ *   list position-desc-id {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list cp-profile-id {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       list constituent-profile-elements {
+ *         key id;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         leaf cpd-id {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/nfpd + * + *

To create instances of this class use {@link NfpdBuilder}. + * @see NfpdBuilder + * @see NfpdKey + * + */ +public interface Nfpd + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nfpd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.Nfpd.class; + } + + /** + * Identifies this nfpd information element within a VNFFGD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Provides an NFP classification and selection rule. The rule may be expressed as + * a criteria constructed out of atomic assertions linked by Boolean operators AND, + * OR and NOT. + * + * + * + * @return java.lang.String rule, or null if not present + */ + @Nullable String getRule(); + + /** + * Describes a position in the NFP in terms of one or more CP profiles and rules + * for distributing the traffic among CP and SAP instances created from the CPD or + * SAPD associated to these profiles. This shall be connection point profile, which + * is either a CPD associated with the VnfProfile of a constituent VNF, or a CPD + * associated with the PnfProfile of a constituent PNF, or a SAPD associated with + * the NsProfile of a nested NS. The related VnfProfile, PnfProfile and NsProfile + * shall be included in the parent VNFFGD. + * + * + * + * @return java.util.Map positionDescId, or null if not present + */ + @Nullable Map getPositionDescId(); + + /** + * @return java.util.Map positionDescId, or an empty list if it is not present + */ + default @NonNull Map nonnullPositionDescId() { + return CodeHelpers.nonnull(getPositionDescId()); + } + + @Override + NfpdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdBuilder.java new file mode 100644 index 0000000..b64b127 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdBuilder.java @@ -0,0 +1,314 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.PositionDescId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.PositionDescIdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NfpdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NfpdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NfpdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NfpdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NfpdBuilder + * @see Builder + * + */ +public class NfpdBuilder implements Builder { + + private String _id; + private Map _positionDescId; + private String _rule; + private NfpdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NfpdBuilder() { + } + + public NfpdBuilder(Nfpd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._positionDescId = base.getPositionDescId(); + this._rule = base.getRule(); + } + + + public NfpdKey key() { + return key; + } + + public String getId() { + return _id; + } + + public Map getPositionDescId() { + return _positionDescId; + } + + public String getRule() { + return _rule; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NfpdBuilder withKey(final NfpdKey key) { + this.key = key; + return this; + } + + public NfpdBuilder setId(final String value) { + this._id = value; + return this; + } + public NfpdBuilder setPositionDescId(final Map values) { + this._positionDescId = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setPositionDescId(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NfpdBuilder setPositionDescId(final List values) { + return setPositionDescId(CodeHelpers.compatMap(values)); + } + + public NfpdBuilder setRule(final String value) { + this._rule = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NfpdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NfpdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NfpdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NfpdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nfpd build() { + return new NfpdImpl(this); + } + + private static final class NfpdImpl + extends AbstractAugmentable + implements Nfpd { + + private final String _id; + private final Map _positionDescId; + private final String _rule; + private final NfpdKey key; + + NfpdImpl(NfpdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NfpdKey(base.getId()); + } + this._id = key.getId(); + this._positionDescId = CodeHelpers.emptyToNull(base.getPositionDescId()); + this._rule = base.getRule(); + } + + @Override + public NfpdKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getPositionDescId() { + return _positionDescId; + } + + @Override + public String getRule() { + return _rule; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_positionDescId); + result = prime * result + Objects.hashCode(_rule); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nfpd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nfpd other = (Nfpd)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_positionDescId, other.getPositionDescId())) { + return false; + } + if (!Objects.equals(_rule, other.getRule())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NfpdImpl otherImpl = (NfpdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nfpd"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_positionDescId", _positionDescId); + CodeHelpers.appendValue(helper, "_rule", _rule); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdKey.java new file mode 100644 index 0000000..becbeee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/NfpdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NfpdKey + implements Identifier { + private static final long serialVersionUID = -6682064197064622726L; + private final String _id; + + + public NfpdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NfpdKey(NfpdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NfpdKey)) { + return false; + } + final NfpdKey other = (NfpdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NfpdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentBaseElementId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentBaseElementId.java new file mode 100644 index 0000000..89d43f3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentBaseElementId.java @@ -0,0 +1,58 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Reference to the profile of an NS constituent. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * choice constituent-base-element-id {
+ *   case vnf-profile {
+ *     container vnf-profile {
+ *       leaf vnf-profile-id {
+ *         type leafref {
+ *           path ../../../../../nsd/df/vnf-profile/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case pnf-profile {
+ *     container pnf-profile {
+ *       leaf pnf-profile-id {
+ *         type leafref {
+ *           path ../../../../../nsd/df/pnf-profile/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case ns-profile {
+ *     container ns-profile {
+ *       leaf ns-profile-id {
+ *         type leafref {
+ *           path ../../../../../nsd/df/ns-profile/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-base-element-id + * + */ +public interface ConstituentBaseElementId + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("constituent-base-element-id"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentCpdId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentCpdId.java new file mode 100644 index 0000000..83452c5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/ConstituentCpdId.java @@ -0,0 +1,74 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * A reference to the descriptor of a connection point attached to one of the + * constituent VNFs and PNFs or to the descriptor of a NS SAP. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * choice constituent-cpd-id {
+ *   case vnf {
+ *     container vnf {
+ *       leaf vnfd-id {
+ *         type leafref {
+ *           path ../../../../../vnfd/id;
+ *         }
+ *       }
+ *       leaf cpd-id {
+ *         type leafref {
+ *           path deref(../vnfd-id)/../ext-cpd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case pnf {
+ *     container pnf {
+ *       leaf pnfd-id {
+ *         type leafref {
+ *           path ../../../../../pnfd/id;
+ *         }
+ *       }
+ *       leaf pnf-cpd-id {
+ *         type leafref {
+ *           path deref(../pnfd-id)/../ext-cpd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case ns {
+ *     container ns {
+ *       leaf nsd-id {
+ *         type leafref {
+ *           path ../../../../../nsd/id;
+ *         }
+ *       }
+ *       leaf sap-cpd-id {
+ *         type leafref {
+ *           path deref(../nsd-id)/../sapd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-cpd-id + * + */ +public interface ConstituentCpdId + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("constituent-cpd-id"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfile.java new file mode 100644 index 0000000..991accd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfile.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentBaseElementId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface NsProfile + extends + DataObject, + Augmentable, + ConstituentBaseElementId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.NsProfile.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.NsProfile nsProfile, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.@Nullable NsProfile getNsProfile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfileBuilder.java new file mode 100644 index 0000000..4659161 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/NsProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsProfileBuilder + * @see Builder + * + */ +public class NsProfileBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.NsProfile _nsProfile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsProfileBuilder() { + } + + public NsProfileBuilder(NsProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._nsProfile = base.getNsProfile(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.NsProfile getNsProfile() { + return _nsProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public NsProfileBuilder setNsProfile(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.NsProfile value) { + this._nsProfile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NsProfile build() { + return new NsProfileImpl(this); + } + + private static final class NsProfileImpl + extends AbstractAugmentable + implements NsProfile { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.NsProfile _nsProfile; + + NsProfileImpl(NsProfileBuilder base) { + super(base.augmentation); + this._nsProfile = base.getNsProfile(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.NsProfile getNsProfile() { + return _nsProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_nsProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NsProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NsProfile other = (NsProfile)obj; + if (!Objects.equals(_nsProfile, other.getNsProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsProfileImpl otherImpl = (NsProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NsProfile"); + CodeHelpers.appendValue(helper, "_nsProfile", _nsProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfile.java new file mode 100644 index 0000000..5ef9e18 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfile.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentBaseElementId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface PnfProfile + extends + DataObject, + Augmentable, + ConstituentBaseElementId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.PnfProfile.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.PnfProfile pnfProfile, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.@Nullable PnfProfile getPnfProfile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfileBuilder.java new file mode 100644 index 0000000..b0489ad --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/PnfProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfProfileBuilder + * @see Builder + * + */ +public class PnfProfileBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.PnfProfile _pnfProfile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfProfileBuilder() { + } + + public PnfProfileBuilder(PnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._pnfProfile = base.getPnfProfile(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.PnfProfile getPnfProfile() { + return _pnfProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PnfProfileBuilder setPnfProfile(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.PnfProfile value) { + this._pnfProfile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PnfProfile build() { + return new PnfProfileImpl(this); + } + + private static final class PnfProfileImpl + extends AbstractAugmentable + implements PnfProfile { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.PnfProfile _pnfProfile; + + PnfProfileImpl(PnfProfileBuilder base) { + super(base.augmentation); + this._pnfProfile = base.getPnfProfile(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.PnfProfile getPnfProfile() { + return _pnfProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_pnfProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PnfProfile other = (PnfProfile)obj; + if (!Objects.equals(_pnfProfile, other.getPnfProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfProfileImpl otherImpl = (PnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PnfProfile"); + CodeHelpers.appendValue(helper, "_pnfProfile", _pnfProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfile.java new file mode 100644 index 0000000..e512537 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfile.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentBaseElementId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface VnfProfile + extends + DataObject, + Augmentable, + ConstituentBaseElementId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.VnfProfile.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.VnfProfile vnfProfile, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.@Nullable VnfProfile getVnfProfile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfileBuilder.java new file mode 100644 index 0000000..f6816da --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/VnfProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfProfileBuilder + * @see Builder + * + */ +public class VnfProfileBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.VnfProfile _vnfProfile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfProfileBuilder() { + } + + public VnfProfileBuilder(VnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._vnfProfile = base.getVnfProfile(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.VnfProfile getVnfProfile() { + return _vnfProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VnfProfileBuilder setVnfProfile(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.VnfProfile value) { + this._vnfProfile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VnfProfile build() { + return new VnfProfileImpl(this); + } + + private static final class VnfProfileImpl + extends AbstractAugmentable + implements VnfProfile { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.VnfProfile _vnfProfile; + + VnfProfileImpl(VnfProfileBuilder base) { + super(base.augmentation); + this._vnfProfile = base.getVnfProfile(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.VnfProfile getVnfProfile() { + return _vnfProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_vnfProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VnfProfile other = (VnfProfile)obj; + if (!Objects.equals(_vnfProfile, other.getVnfProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfProfileImpl otherImpl = (VnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VnfProfile"); + CodeHelpers.appendValue(helper, "_vnfProfile", _vnfProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfile.java new file mode 100644 index 0000000..163a537 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfile.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container ns-profile {
+ *   leaf ns-profile-id {
+ *     type leafref {
+ *       path ../../../../../nsd/df/ns-profile/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-base-element-id/ns-profile/ns-profile + * + *

To create instances of this class use {@link NsProfileBuilder}. + * @see NsProfileBuilder + * + */ +public interface NsProfile + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile.NsProfile.class; + } + + /** + * @return java.lang.String nsProfileId, or null if not present + */ + @Nullable String getNsProfileId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfileBuilder.java new file mode 100644 index 0000000..edbac3f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/ns/profile/NsProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.ns.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsProfileBuilder + * @see Builder + * + */ +public class NsProfileBuilder implements Builder { + + private String _nsProfileId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsProfileBuilder() { + } + + public NsProfileBuilder(NsProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._nsProfileId = base.getNsProfileId(); + } + + + public String getNsProfileId() { + return _nsProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public NsProfileBuilder setNsProfileId(final String value) { + this._nsProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NsProfile build() { + return new NsProfileImpl(this); + } + + private static final class NsProfileImpl + extends AbstractAugmentable + implements NsProfile { + + private final String _nsProfileId; + + NsProfileImpl(NsProfileBuilder base) { + super(base.augmentation); + this._nsProfileId = base.getNsProfileId(); + } + + @Override + public String getNsProfileId() { + return _nsProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_nsProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NsProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NsProfile other = (NsProfile)obj; + if (!Objects.equals(_nsProfileId, other.getNsProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsProfileImpl otherImpl = (NsProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NsProfile"); + CodeHelpers.appendValue(helper, "_nsProfileId", _nsProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfile.java new file mode 100644 index 0000000..34d343f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfile.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container pnf-profile {
+ *   leaf pnf-profile-id {
+ *     type leafref {
+ *       path ../../../../../nsd/df/pnf-profile/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-base-element-id/pnf-profile/pnf-profile + * + *

To create instances of this class use {@link PnfProfileBuilder}. + * @see PnfProfileBuilder + * + */ +public interface PnfProfile + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile.PnfProfile.class; + } + + /** + * @return java.lang.String pnfProfileId, or null if not present + */ + @Nullable String getPnfProfileId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfileBuilder.java new file mode 100644 index 0000000..9d78928 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/pnf/profile/PnfProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.pnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfProfileBuilder + * @see Builder + * + */ +public class PnfProfileBuilder implements Builder { + + private String _pnfProfileId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfProfileBuilder() { + } + + public PnfProfileBuilder(PnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._pnfProfileId = base.getPnfProfileId(); + } + + + public String getPnfProfileId() { + return _pnfProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PnfProfileBuilder setPnfProfileId(final String value) { + this._pnfProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PnfProfile build() { + return new PnfProfileImpl(this); + } + + private static final class PnfProfileImpl + extends AbstractAugmentable + implements PnfProfile { + + private final String _pnfProfileId; + + PnfProfileImpl(PnfProfileBuilder base) { + super(base.augmentation); + this._pnfProfileId = base.getPnfProfileId(); + } + + @Override + public String getPnfProfileId() { + return _pnfProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_pnfProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PnfProfile other = (PnfProfile)obj; + if (!Objects.equals(_pnfProfileId, other.getPnfProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfProfileImpl otherImpl = (PnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PnfProfile"); + CodeHelpers.appendValue(helper, "_pnfProfileId", _pnfProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfile.java new file mode 100644 index 0000000..5d18f5e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfile.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container vnf-profile {
+ *   leaf vnf-profile-id {
+ *     type leafref {
+ *       path ../../../../../nsd/df/vnf-profile/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-base-element-id/vnf-profile/vnf-profile + * + *

To create instances of this class use {@link VnfProfileBuilder}. + * @see VnfProfileBuilder + * + */ +public interface VnfProfile + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile.VnfProfile.class; + } + + /** + * @return java.lang.String vnfProfileId, or null if not present + */ + @Nullable String getVnfProfileId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfileBuilder.java new file mode 100644 index 0000000..5fd02c1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/base/element/id/vnf/profile/VnfProfileBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.base.element.id.vnf.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfProfileBuilder + * @see Builder + * + */ +public class VnfProfileBuilder implements Builder { + + private String _vnfProfileId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfProfileBuilder() { + } + + public VnfProfileBuilder(VnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._vnfProfileId = base.getVnfProfileId(); + } + + + public String getVnfProfileId() { + return _vnfProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VnfProfileBuilder setVnfProfileId(final String value) { + this._vnfProfileId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VnfProfile build() { + return new VnfProfileImpl(this); + } + + private static final class VnfProfileImpl + extends AbstractAugmentable + implements VnfProfile { + + private final String _vnfProfileId; + + VnfProfileImpl(VnfProfileBuilder base) { + super(base.augmentation); + this._vnfProfileId = base.getVnfProfileId(); + } + + @Override + public String getVnfProfileId() { + return _vnfProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_vnfProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VnfProfile other = (VnfProfile)obj; + if (!Objects.equals(_vnfProfileId, other.getVnfProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfProfileImpl otherImpl = (VnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VnfProfile"); + CodeHelpers.appendValue(helper, "_vnfProfileId", _vnfProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Ns.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Ns.java new file mode 100644 index 0000000..a44a02c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Ns.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentCpdId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface Ns + extends + DataObject, + Augmentable, + ConstituentCpdId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.Ns.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.Ns ns, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.@Nullable Ns getNs(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/NsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/NsBuilder.java new file mode 100644 index 0000000..a748fcd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/NsBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsBuilder + * @see Builder + * + */ +public class NsBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.Ns _ns; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsBuilder() { + } + + public NsBuilder(Ns base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._ns = base.getNs(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.Ns getNs() { + return _ns; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public NsBuilder setNs(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.Ns value) { + this._ns = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Ns build() { + return new NsImpl(this); + } + + private static final class NsImpl + extends AbstractAugmentable + implements Ns { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.Ns _ns; + + NsImpl(NsBuilder base) { + super(base.augmentation); + this._ns = base.getNs(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.Ns getNs() { + return _ns; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_ns); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Ns.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Ns other = (Ns)obj; + if (!Objects.equals(_ns, other.getNs())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsImpl otherImpl = (NsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Ns"); + CodeHelpers.appendValue(helper, "_ns", _ns); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Pnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Pnf.java new file mode 100644 index 0000000..5f4453d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Pnf.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentCpdId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface Pnf + extends + DataObject, + Augmentable, + ConstituentCpdId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.Pnf.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.Pnf pnf, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.@Nullable Pnf getPnf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/PnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/PnfBuilder.java new file mode 100644 index 0000000..bdcd918 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/PnfBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfBuilder + * @see Builder + * + */ +public class PnfBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.Pnf _pnf; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfBuilder() { + } + + public PnfBuilder(Pnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._pnf = base.getPnf(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.Pnf getPnf() { + return _pnf; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PnfBuilder setPnf(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.Pnf value) { + this._pnf = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnf build() { + return new PnfImpl(this); + } + + private static final class PnfImpl + extends AbstractAugmentable + implements Pnf { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.Pnf _pnf; + + PnfImpl(PnfBuilder base) { + super(base.augmentation); + this._pnf = base.getPnf(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.Pnf getPnf() { + return _pnf; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_pnf); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnf other = (Pnf)obj; + if (!Objects.equals(_pnf, other.getPnf())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfImpl otherImpl = (PnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnf"); + CodeHelpers.appendValue(helper, "_pnf", _pnf); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Vnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Vnf.java new file mode 100644 index 0000000..9259997 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/Vnf.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.ConstituentCpdId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface Vnf + extends + DataObject, + Augmentable, + ConstituentCpdId +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.Vnf.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.Vnf vnf, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.@Nullable Vnf getVnf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/VnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/VnfBuilder.java new file mode 100644 index 0000000..f554f13 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/VnfBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfBuilder + * @see Builder + * + */ +public class VnfBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.Vnf _vnf; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfBuilder() { + } + + public VnfBuilder(Vnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._vnf = base.getVnf(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.Vnf getVnf() { + return _vnf; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VnfBuilder setVnf(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.Vnf value) { + this._vnf = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnf build() { + return new VnfImpl(this); + } + + private static final class VnfImpl + extends AbstractAugmentable + implements Vnf { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.Vnf _vnf; + + VnfImpl(VnfBuilder base) { + super(base.augmentation); + this._vnf = base.getVnf(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.Vnf getVnf() { + return _vnf; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_vnf); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnf other = (Vnf)obj; + if (!Objects.equals(_vnf, other.getVnf())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfImpl otherImpl = (VnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnf"); + CodeHelpers.appendValue(helper, "_vnf", _vnf); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/Ns.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/Ns.java new file mode 100644 index 0000000..8026bd3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/Ns.java @@ -0,0 +1,63 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container ns {
+ *   leaf nsd-id {
+ *     type leafref {
+ *       path ../../../../../nsd/id;
+ *     }
+ *   }
+ *   leaf sap-cpd-id {
+ *     type leafref {
+ *       path deref(../nsd-id)/../sapd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-cpd-id/ns/ns + * + *

To create instances of this class use {@link NsBuilder}. + * @see NsBuilder + * + */ +public interface Ns + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns.Ns.class; + } + + /** + * @return java.lang.String nsdId, or null if not present + */ + @Nullable String getNsdId(); + + /** + * @return java.lang.String sapCpdId, or null if not present + */ + @Nullable String getSapCpdId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/NsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/NsBuilder.java new file mode 100644 index 0000000..8c8a636 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/ns/NsBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.ns; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsBuilder + * @see Builder + * + */ +public class NsBuilder implements Builder { + + private String _nsdId; + private String _sapCpdId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsBuilder() { + } + + public NsBuilder(Ns base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._nsdId = base.getNsdId(); + this._sapCpdId = base.getSapCpdId(); + } + + + public String getNsdId() { + return _nsdId; + } + + public String getSapCpdId() { + return _sapCpdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public NsBuilder setNsdId(final String value) { + this._nsdId = value; + return this; + } + + public NsBuilder setSapCpdId(final String value) { + this._sapCpdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Ns build() { + return new NsImpl(this); + } + + private static final class NsImpl + extends AbstractAugmentable + implements Ns { + + private final String _nsdId; + private final String _sapCpdId; + + NsImpl(NsBuilder base) { + super(base.augmentation); + this._nsdId = base.getNsdId(); + this._sapCpdId = base.getSapCpdId(); + } + + @Override + public String getNsdId() { + return _nsdId; + } + + @Override + public String getSapCpdId() { + return _sapCpdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_nsdId); + result = prime * result + Objects.hashCode(_sapCpdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Ns.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Ns other = (Ns)obj; + if (!Objects.equals(_nsdId, other.getNsdId())) { + return false; + } + if (!Objects.equals(_sapCpdId, other.getSapCpdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsImpl otherImpl = (NsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Ns"); + CodeHelpers.appendValue(helper, "_nsdId", _nsdId); + CodeHelpers.appendValue(helper, "_sapCpdId", _sapCpdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/Pnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/Pnf.java new file mode 100644 index 0000000..c5806d1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/Pnf.java @@ -0,0 +1,63 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container pnf {
+ *   leaf pnfd-id {
+ *     type leafref {
+ *       path ../../../../../pnfd/id;
+ *     }
+ *   }
+ *   leaf pnf-cpd-id {
+ *     type leafref {
+ *       path deref(../pnfd-id)/../ext-cpd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-cpd-id/pnf/pnf + * + *

To create instances of this class use {@link PnfBuilder}. + * @see PnfBuilder + * + */ +public interface Pnf + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf.Pnf.class; + } + + /** + * @return java.lang.String pnfdId, or null if not present + */ + @Nullable String getPnfdId(); + + /** + * @return java.lang.String pnfCpdId, or null if not present + */ + @Nullable String getPnfCpdId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/PnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/PnfBuilder.java new file mode 100644 index 0000000..7286eb2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/pnf/PnfBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.pnf; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfBuilder + * @see Builder + * + */ +public class PnfBuilder implements Builder { + + private String _pnfCpdId; + private String _pnfdId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfBuilder() { + } + + public PnfBuilder(Pnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._pnfCpdId = base.getPnfCpdId(); + this._pnfdId = base.getPnfdId(); + } + + + public String getPnfCpdId() { + return _pnfCpdId; + } + + public String getPnfdId() { + return _pnfdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PnfBuilder setPnfCpdId(final String value) { + this._pnfCpdId = value; + return this; + } + + public PnfBuilder setPnfdId(final String value) { + this._pnfdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnf build() { + return new PnfImpl(this); + } + + private static final class PnfImpl + extends AbstractAugmentable + implements Pnf { + + private final String _pnfCpdId; + private final String _pnfdId; + + PnfImpl(PnfBuilder base) { + super(base.augmentation); + this._pnfCpdId = base.getPnfCpdId(); + this._pnfdId = base.getPnfdId(); + } + + @Override + public String getPnfCpdId() { + return _pnfCpdId; + } + + @Override + public String getPnfdId() { + return _pnfdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_pnfCpdId); + result = prime * result + Objects.hashCode(_pnfdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnf other = (Pnf)obj; + if (!Objects.equals(_pnfCpdId, other.getPnfCpdId())) { + return false; + } + if (!Objects.equals(_pnfdId, other.getPnfdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfImpl otherImpl = (PnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnf"); + CodeHelpers.appendValue(helper, "_pnfCpdId", _pnfCpdId); + CodeHelpers.appendValue(helper, "_pnfdId", _pnfdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/Vnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/Vnf.java new file mode 100644 index 0000000..b61bf6b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/Vnf.java @@ -0,0 +1,63 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container vnf {
+ *   leaf vnfd-id {
+ *     type leafref {
+ *       path ../../../../../vnfd/id;
+ *     }
+ *   }
+ *   leaf cpd-id {
+ *     type leafref {
+ *       path deref(../vnfd-id)/../ext-cpd/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/cpd-pool/constituent-cpd-id/vnf/vnf + * + *

To create instances of this class use {@link VnfBuilder}. + * @see VnfBuilder + * + */ +public interface Vnf + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnf"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf.Vnf.class; + } + + /** + * @return java.lang.String vnfdId, or null if not present + */ + @Nullable String getVnfdId(); + + /** + * @return java.lang.String cpdId, or null if not present + */ + @Nullable String getCpdId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/VnfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/VnfBuilder.java new file mode 100644 index 0000000..698f07e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/cpd/pool/constituent/cpd/id/vnf/VnfBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.cpd.pool.constituent.cpd.id.vnf; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfBuilder + * @see Builder + * + */ +public class VnfBuilder implements Builder { + + private String _cpdId; + private String _vnfdId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfBuilder() { + } + + public VnfBuilder(Vnf base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cpdId = base.getCpdId(); + this._vnfdId = base.getVnfdId(); + } + + + public String getCpdId() { + return _cpdId; + } + + public String getVnfdId() { + return _vnfdId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VnfBuilder setCpdId(final String value) { + this._cpdId = value; + return this; + } + + public VnfBuilder setVnfdId(final String value) { + this._vnfdId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnf build() { + return new VnfImpl(this); + } + + private static final class VnfImpl + extends AbstractAugmentable + implements Vnf { + + private final String _cpdId; + private final String _vnfdId; + + VnfImpl(VnfBuilder base) { + super(base.augmentation); + this._cpdId = base.getCpdId(); + this._vnfdId = base.getVnfdId(); + } + + @Override + public String getCpdId() { + return _cpdId; + } + + @Override + public String getVnfdId() { + return _vnfdId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpdId); + result = prime * result + Objects.hashCode(_vnfdId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnf.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnf other = (Vnf)obj; + if (!Objects.equals(_cpdId, other.getCpdId())) { + return false; + } + if (!Objects.equals(_vnfdId, other.getVnfdId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfImpl otherImpl = (VnfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnf"); + CodeHelpers.appendValue(helper, "_cpdId", _cpdId); + CodeHelpers.appendValue(helper, "_vnfdId", _vnfdId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescId.java new file mode 100644 index 0000000..c5a6aa7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescId.java @@ -0,0 +1,107 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.Nfpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.CpProfileId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.CpProfileIdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes a position in the NFP in terms of one or more CP profiles and rules + * for distributing the traffic among CP and SAP instances created from the CPD or + * SAPD associated to these profiles. This shall be connection point profile, + * is either a CPD associated with the VnfProfile of a constituent VNF, or a CPD + * associated with the PnfProfile of a constituent PNF, or a SAPD associated with + * the NsProfile of a nested NS. The related VnfProfile, PnfProfile and NsProfile + * shall be included in the parent VNFFGD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list position-desc-id {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   list cp-profile-id {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list constituent-profile-elements {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf cpd-id {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/nfpd/position-desc-id + * + *

To create instances of this class use {@link PositionDescIdBuilder}. + * @see PositionDescIdBuilder + * @see PositionDescIdKey + * + */ +public interface PositionDescId + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("position-desc-id"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.PositionDescId.class; + } + + /** + * Identifier of this NfpPositionDesc element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References the profile of a connection point to be traversed by the traffic + * flows matching the criteria. This shall be a connection point attached to one of + * the constituent VNFs and PNFs of the parent VNFFG, or a SAP of one of the + * constituent nested NSs of the parent VNFFG. + * + * + * + * @return java.util.Map cpProfileId, or null if not present + */ + @Nullable Map getCpProfileId(); + + /** + * @return java.util.Map cpProfileId, or an empty list if it is not present + */ + default @NonNull Map nonnullCpProfileId() { + return CodeHelpers.nonnull(getCpProfileId()); + } + + @Override + PositionDescIdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdBuilder.java new file mode 100644 index 0000000..0907061 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdBuilder.java @@ -0,0 +1,291 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.CpProfileId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.CpProfileIdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PositionDescIdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PositionDescIdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PositionDescIdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PositionDescIdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PositionDescIdBuilder + * @see Builder + * + */ +public class PositionDescIdBuilder implements Builder { + + private Map _cpProfileId; + private String _id; + private PositionDescIdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PositionDescIdBuilder() { + } + + public PositionDescIdBuilder(PositionDescId base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._cpProfileId = base.getCpProfileId(); + } + + + public PositionDescIdKey key() { + return key; + } + + public Map getCpProfileId() { + return _cpProfileId; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PositionDescIdBuilder withKey(final PositionDescIdKey key) { + this.key = key; + return this; + } + public PositionDescIdBuilder setCpProfileId(final Map values) { + this._cpProfileId = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setCpProfileId(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PositionDescIdBuilder setCpProfileId(final List values) { + return setCpProfileId(CodeHelpers.compatMap(values)); + } + + public PositionDescIdBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PositionDescIdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PositionDescIdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PositionDescIdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PositionDescIdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PositionDescId build() { + return new PositionDescIdImpl(this); + } + + private static final class PositionDescIdImpl + extends AbstractAugmentable + implements PositionDescId { + + private final Map _cpProfileId; + private final String _id; + private final PositionDescIdKey key; + + PositionDescIdImpl(PositionDescIdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new PositionDescIdKey(base.getId()); + } + this._id = key.getId(); + this._cpProfileId = CodeHelpers.emptyToNull(base.getCpProfileId()); + } + + @Override + public PositionDescIdKey key() { + return key; + } + + @Override + public Map getCpProfileId() { + return _cpProfileId; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpProfileId); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PositionDescId.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PositionDescId other = (PositionDescId)obj; + if (!Objects.equals(_cpProfileId, other.getCpProfileId())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PositionDescIdImpl otherImpl = (PositionDescIdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PositionDescId"); + CodeHelpers.appendValue(helper, "_cpProfileId", _cpProfileId); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdKey.java new file mode 100644 index 0000000..3519791 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/PositionDescIdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class PositionDescIdKey + implements Identifier { + private static final long serialVersionUID = 4821410304072817872L; + private final String _id; + + + public PositionDescIdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public PositionDescIdKey(PositionDescIdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof PositionDescIdKey)) { + return false; + } + final PositionDescIdKey other = (PositionDescIdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(PositionDescIdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileId.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileId.java new file mode 100644 index 0000000..a9bd343 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileId.java @@ -0,0 +1,96 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.PositionDescId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id.ConstituentProfileElements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id.ConstituentProfileElementsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * References the profile of a connection point to be traversed by the traffic + * flows matching the criteria. This shall be a connection point attached to one + * the constituent VNFs and PNFs of the parent VNFFG, or a SAP of one of the + * constituent nested NSs of the parent VNFFG. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list cp-profile-id {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   list constituent-profile-elements {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf cpd-id {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/nfpd/position-desc-id/cp-profile-id + * + *

To create instances of this class use {@link CpProfileIdBuilder}. + * @see CpProfileIdBuilder + * @see CpProfileIdKey + * + */ +public interface CpProfileId + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cp-profile-id"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.CpProfileId.class; + } + + /** + * Identifier of this CpProfile information element. It uniquely identifies a + * CpProfile. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Specifies the constituents of the CpProfile. + * + * + * + * @return java.util.Map constituentProfileElements, or null if not present + */ + @Nullable Map getConstituentProfileElements(); + + /** + * @return java.util.Map constituentProfileElements, or an empty list if it is not present + */ + default @NonNull Map nonnullConstituentProfileElements() { + return CodeHelpers.nonnull(getConstituentProfileElements()); + } + + @Override + CpProfileIdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdBuilder.java new file mode 100644 index 0000000..0ea14d7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdBuilder.java @@ -0,0 +1,291 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id.ConstituentProfileElements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id.ConstituentProfileElementsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link CpProfileIdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     CpProfileIdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new CpProfileIdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of CpProfileIdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see CpProfileIdBuilder + * @see Builder + * + */ +public class CpProfileIdBuilder implements Builder { + + private Map _constituentProfileElements; + private String _id; + private CpProfileIdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public CpProfileIdBuilder() { + } + + public CpProfileIdBuilder(CpProfileId base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._constituentProfileElements = base.getConstituentProfileElements(); + } + + + public CpProfileIdKey key() { + return key; + } + + public Map getConstituentProfileElements() { + return _constituentProfileElements; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public CpProfileIdBuilder withKey(final CpProfileIdKey key) { + this.key = key; + return this; + } + public CpProfileIdBuilder setConstituentProfileElements(final Map values) { + this._constituentProfileElements = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setConstituentProfileElements(Map)} instead. + */ + @Deprecated(forRemoval = true) + public CpProfileIdBuilder setConstituentProfileElements(final List values) { + return setConstituentProfileElements(CodeHelpers.compatMap(values)); + } + + public CpProfileIdBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public CpProfileIdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public CpProfileIdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public CpProfileIdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private CpProfileIdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public CpProfileId build() { + return new CpProfileIdImpl(this); + } + + private static final class CpProfileIdImpl + extends AbstractAugmentable + implements CpProfileId { + + private final Map _constituentProfileElements; + private final String _id; + private final CpProfileIdKey key; + + CpProfileIdImpl(CpProfileIdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new CpProfileIdKey(base.getId()); + } + this._id = key.getId(); + this._constituentProfileElements = CodeHelpers.emptyToNull(base.getConstituentProfileElements()); + } + + @Override + public CpProfileIdKey key() { + return key; + } + + @Override + public Map getConstituentProfileElements() { + return _constituentProfileElements; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_constituentProfileElements); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!CpProfileId.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + CpProfileId other = (CpProfileId)obj; + if (!Objects.equals(_constituentProfileElements, other.getConstituentProfileElements())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + CpProfileIdImpl otherImpl = (CpProfileIdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("CpProfileId"); + CodeHelpers.appendValue(helper, "_constituentProfileElements", _constituentProfileElements); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdKey.java new file mode 100644 index 0000000..043b67b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/CpProfileIdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class CpProfileIdKey + implements Identifier { + private static final long serialVersionUID = 105739188582255767L; + private final String _id; + + + public CpProfileIdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public CpProfileIdKey(CpProfileIdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CpProfileIdKey)) { + return false; + } + final CpProfileIdKey other = (CpProfileIdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(CpProfileIdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElements.java new file mode 100644 index 0000000..c456889 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElements.java @@ -0,0 +1,77 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.CpProfileId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the constituents of the CpProfile. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list constituent-profile-elements {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf cpd-id {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd/nfpd/position-desc-id/cp-profile-id/constituent-profile-elements + * + *

To create instances of this class use {@link ConstituentProfileElementsBuilder}. + * @see ConstituentProfileElementsBuilder + * @see ConstituentProfileElementsKey + * + */ +public interface ConstituentProfileElements + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("constituent-profile-elements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id.ConstituentProfileElements.class; + } + + /** + * Specifies the constituents of the CpProfile. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References the VNF external CPD for a given VnfProfile, or the PNF external CPD + * for a given PnfProfile, or a NS SAPD for a give NsProfile identified by the + * constituentBasedElementId. + * + * + * + * @return java.lang.String cpdId, or null if not present + */ + @Nullable String getCpdId(); + + @Override + ConstituentProfileElementsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsBuilder.java new file mode 100644 index 0000000..c96eee0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConstituentProfileElementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConstituentProfileElementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConstituentProfileElementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConstituentProfileElementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConstituentProfileElementsBuilder + * @see Builder + * + */ +public class ConstituentProfileElementsBuilder implements Builder { + + private String _cpdId; + private String _id; + private ConstituentProfileElementsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConstituentProfileElementsBuilder() { + } + + public ConstituentProfileElementsBuilder(ConstituentProfileElements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._cpdId = base.getCpdId(); + } + + + public ConstituentProfileElementsKey key() { + return key; + } + + public String getCpdId() { + return _cpdId; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ConstituentProfileElementsBuilder withKey(final ConstituentProfileElementsKey key) { + this.key = key; + return this; + } + + public ConstituentProfileElementsBuilder setCpdId(final String value) { + this._cpdId = value; + return this; + } + + public ConstituentProfileElementsBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConstituentProfileElementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConstituentProfileElementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConstituentProfileElementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConstituentProfileElementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConstituentProfileElements build() { + return new ConstituentProfileElementsImpl(this); + } + + private static final class ConstituentProfileElementsImpl + extends AbstractAugmentable + implements ConstituentProfileElements { + + private final String _cpdId; + private final String _id; + private final ConstituentProfileElementsKey key; + + ConstituentProfileElementsImpl(ConstituentProfileElementsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ConstituentProfileElementsKey(base.getId()); + } + this._id = key.getId(); + this._cpdId = base.getCpdId(); + } + + @Override + public ConstituentProfileElementsKey key() { + return key; + } + + @Override + public String getCpdId() { + return _cpdId; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpdId); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConstituentProfileElements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConstituentProfileElements other = (ConstituentProfileElements)obj; + if (!Objects.equals(_cpdId, other.getCpdId())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConstituentProfileElementsImpl otherImpl = (ConstituentProfileElementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConstituentProfileElements"); + CodeHelpers.appendValue(helper, "_cpdId", _cpdId); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsKey.java new file mode 100644 index 0000000..788e6b0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/vnffgd/nfpd/position/desc/id/cp/profile/id/ConstituentProfileElementsKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.nfpd.position.desc.id.cp.profile.id; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ConstituentProfileElementsKey + implements Identifier { + private static final long serialVersionUID = 6080693131906435044L; + private final String _id; + + + public ConstituentProfileElementsKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ConstituentProfileElementsKey(ConstituentProfileElementsKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ConstituentProfileElementsKey)) { + return false; + } + final ConstituentProfileElementsKey other = (ConstituentProfileElementsKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ConstituentProfileElementsKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpd.java new file mode 100644 index 0000000..41b60be --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpd.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the characteristics of one or more connection points where to connect + * the PNF to a VL. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list ext-cpd {
+ *   key id;
+ *   uses cpd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/pnfd/ext-cpd + * + *

To create instances of this class use {@link ExtCpdBuilder}. + * @see ExtCpdBuilder + * @see ExtCpdKey + * + */ +public interface ExtCpd + extends + ChildOf, + Augmentable, + Cpd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ext-cpd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpd.class; + } + + @Override + ExtCpdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdBuilder.java new file mode 100644 index 0000000..fb9aa84 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdBuilder.java @@ -0,0 +1,416 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.CpRole; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.ProtocolKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ExtCpdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ExtCpdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ExtCpdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ExtCpdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ExtCpdBuilder + * @see Builder + * + */ +public class ExtCpdBuilder implements Builder { + + private String _description; + private String _id; + private List> _layerProtocol; + private Map _protocol; + private Class _role; + private Boolean _trunkMode; + private ExtCpdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ExtCpdBuilder() { + } + public ExtCpdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd arg) { + this._id = arg.getId(); + this._layerProtocol = arg.getLayerProtocol(); + this._role = arg.getRole(); + this._description = arg.getDescription(); + this._protocol = arg.getProtocol(); + this._trunkMode = arg.isTrunkMode(); + } + + public ExtCpdBuilder(ExtCpd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._description = base.getDescription(); + this._layerProtocol = base.getLayerProtocol(); + this._protocol = base.getProtocol(); + this._role = base.getRole(); + this._trunkMode = base.isTrunkMode(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getId(); + this._layerProtocol = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getLayerProtocol(); + this._role = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getRole(); + this._description = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getDescription(); + this._protocol = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getProtocol(); + this._trunkMode = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).isTrunkMode(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd]"); + } + + public ExtCpdKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public List> getLayerProtocol() { + return _layerProtocol; + } + + public Map getProtocol() { + return _protocol; + } + + public Class getRole() { + return _role; + } + + public Boolean isTrunkMode() { + return _trunkMode; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ExtCpdBuilder withKey(final ExtCpdKey key) { + this.key = key; + return this; + } + + public ExtCpdBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public ExtCpdBuilder setId(final String value) { + this._id = value; + return this; + } + public ExtCpdBuilder setLayerProtocol(final List> values) { + this._layerProtocol = values; + return this; + } + + public ExtCpdBuilder setProtocol(final Map values) { + this._protocol = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setProtocol(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ExtCpdBuilder setProtocol(final List values) { + return setProtocol(CodeHelpers.compatMap(values)); + } + + public ExtCpdBuilder setRole(final Class value) { + this._role = value; + return this; + } + + public ExtCpdBuilder setTrunkMode(final Boolean value) { + this._trunkMode = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ExtCpdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ExtCpdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ExtCpdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ExtCpdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ExtCpd build() { + return new ExtCpdImpl(this); + } + + private static final class ExtCpdImpl + extends AbstractAugmentable + implements ExtCpd { + + private final String _description; + private final String _id; + private final List> _layerProtocol; + private final Map _protocol; + private final Class _role; + private final Boolean _trunkMode; + private final ExtCpdKey key; + + ExtCpdImpl(ExtCpdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ExtCpdKey(base.getId()); + } + this._id = key.getId(); + this._description = base.getDescription(); + this._layerProtocol = base.getLayerProtocol(); + this._protocol = CodeHelpers.emptyToNull(base.getProtocol()); + this._role = base.getRole(); + this._trunkMode = base.isTrunkMode(); + } + + @Override + public ExtCpdKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public List> getLayerProtocol() { + return _layerProtocol; + } + + @Override + public Map getProtocol() { + return _protocol; + } + + @Override + public Class getRole() { + return _role; + } + + @Override + public Boolean isTrunkMode() { + return _trunkMode; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_layerProtocol); + result = prime * result + Objects.hashCode(_protocol); + result = prime * result + Objects.hashCode(_role); + result = prime * result + Objects.hashCode(_trunkMode); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ExtCpd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ExtCpd other = (ExtCpd)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_layerProtocol, other.getLayerProtocol())) { + return false; + } + if (!Objects.equals(_protocol, other.getProtocol())) { + return false; + } + if (!Objects.equals(_role, other.getRole())) { + return false; + } + if (!Objects.equals(_trunkMode, other.isTrunkMode())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ExtCpdImpl otherImpl = (ExtCpdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ExtCpd"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_layerProtocol", _layerProtocol); + CodeHelpers.appendValue(helper, "_protocol", _protocol); + CodeHelpers.appendValue(helper, "_role", _role); + CodeHelpers.appendValue(helper, "_trunkMode", _trunkMode); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdKey.java new file mode 100644 index 0000000..7f55a00 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/ExtCpdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ExtCpdKey + implements Identifier { + private static final long serialVersionUID = -7160822752734312733L; + private final String _id; + + + public ExtCpdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ExtCpdKey(ExtCpdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ExtCpdKey)) { + return false; + } + final ExtCpdKey other = (ExtCpdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ExtCpdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/Security.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/Security.java new file mode 100644 index 0000000..0b132ba --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/Security.java @@ -0,0 +1,54 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides a signature to prevent tampering. Editor's Note: While IFA014 does + * specify that the PNFD includes a security parameter. SOL001 does not have one. + * We need to harmonize SOL001 & SOL006 on this point. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list security {
+ *   key signature;
+ *   uses security-parameters;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/pnfd/security + * + *

To create instances of this class use {@link SecurityBuilder}. + * @see SecurityBuilder + * @see SecurityKey + * + */ +public interface Security + extends + ChildOf, + Augmentable, + SecurityParameters, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("security"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.Security.class; + } + + @Override + SecurityKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityBuilder.java new file mode 100644 index 0000000..3cde341 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityBuilder.java @@ -0,0 +1,318 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link SecurityBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SecurityBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SecurityBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SecurityBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SecurityBuilder + * @see Builder + * + */ +public class SecurityBuilder implements Builder { + + private String _algorithm; + private String _certificate; + private String _signature; + private SecurityKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SecurityBuilder() { + } + public SecurityBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters arg) { + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + + public SecurityBuilder(Security base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._signature = base.getSignature(); + this._algorithm = base.getAlgorithm(); + this._certificate = base.getCertificate(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters) { + this._signature = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getSignature(); + this._algorithm = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getAlgorithm(); + this._certificate = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getCertificate(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters]"); + } + + public SecurityKey key() { + return key; + } + + public String getAlgorithm() { + return _algorithm; + } + + public String getCertificate() { + return _certificate; + } + + public String getSignature() { + return _signature; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public SecurityBuilder withKey(final SecurityKey key) { + this.key = key; + return this; + } + + public SecurityBuilder setAlgorithm(final String value) { + this._algorithm = value; + return this; + } + + public SecurityBuilder setCertificate(final String value) { + this._certificate = value; + return this; + } + + public SecurityBuilder setSignature(final String value) { + this._signature = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SecurityBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SecurityBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SecurityBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SecurityBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Security build() { + return new SecurityImpl(this); + } + + private static final class SecurityImpl + extends AbstractAugmentable + implements Security { + + private final String _algorithm; + private final String _certificate; + private final String _signature; + private final SecurityKey key; + + SecurityImpl(SecurityBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new SecurityKey(base.getSignature()); + } + this._signature = key.getSignature(); + this._algorithm = base.getAlgorithm(); + this._certificate = base.getCertificate(); + } + + @Override + public SecurityKey key() { + return key; + } + + @Override + public String getAlgorithm() { + return _algorithm; + } + + @Override + public String getCertificate() { + return _certificate; + } + + @Override + public String getSignature() { + return _signature; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_algorithm); + result = prime * result + Objects.hashCode(_certificate); + result = prime * result + Objects.hashCode(_signature); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Security.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Security other = (Security)obj; + if (!Objects.equals(_algorithm, other.getAlgorithm())) { + return false; + } + if (!Objects.equals(_certificate, other.getCertificate())) { + return false; + } + if (!Objects.equals(_signature, other.getSignature())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SecurityImpl otherImpl = (SecurityImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Security"); + CodeHelpers.appendValue(helper, "_algorithm", _algorithm); + CodeHelpers.appendValue(helper, "_certificate", _certificate); + CodeHelpers.appendValue(helper, "_signature", _signature); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityKey.java new file mode 100644 index 0000000..6a6abe3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/pnfd/SecurityKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class SecurityKey + implements Identifier { + private static final long serialVersionUID = -4666693731352198522L; + private final String _signature; + + + public SecurityKey(String _signature) { + + this._signature = _signature; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public SecurityKey(SecurityKey source) { + this._signature = source._signature; + } + + + public String getSignature() { + return _signature; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_signature); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SecurityKey)) { + return false; + } + final SecurityKey other = (SecurityKey) obj; + if (!Objects.equals(_signature, other._signature)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(SecurityKey.class); + CodeHelpers.appendValue(helper, "_signature", _signature); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRule.java new file mode 100644 index 0000000..e910e9e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRule.java @@ -0,0 +1,349 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Defines security group rules to be used by the VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list security-group-rule {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   leaf direction {
+ *     type enumeration {
+ *       enum ingress;
+ *       enum egress;
+ *     }
+ *     default ingress;
+ *   }
+ *   leaf ether-type {
+ *     type enumeration {
+ *       enum ipv4;
+ *       enum ipv6;
+ *     }
+ *     default ipv4;
+ *   }
+ *   leaf protocol {
+ *     type enumeration {
+ *       enum tcp;
+ *       enum udp;
+ *       enum icmp;
+ *     }
+ *     default tcp;
+ *   }
+ *   leaf port-range-min {
+ *     must ". <= ../port-range-max";
+ *     type uint16;
+ *     default 0;
+ *   }
+ *   leaf port-range-max {
+ *     must ". >= ../port-range-min";
+ *     type uint16;
+ *     default 65535;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/security-group-rule/security-group-rule + * + *

To create instances of this class use {@link SecurityGroupRuleBuilder}. + * @see SecurityGroupRuleBuilder + * @see SecurityGroupRuleKey + * + */ +public interface SecurityGroupRule + extends + ChildOf, + Augmentable, + Identifiable +{ + + + public enum Direction implements Enumeration { + Ingress(0, "ingress"), + + Egress(1, "egress") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Direction enumItem : Direction.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Direction(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Direction item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Direction item, or null if no such item exists + */ + public static Direction forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public enum EtherType implements Enumeration { + Ipv4(0, "ipv4"), + + Ipv6(1, "ipv6") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (EtherType enumItem : EtherType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private EtherType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding EtherType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding EtherType item, or null if no such item exists + */ + public static EtherType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public enum Protocol implements Enumeration { + Tcp(0, "tcp"), + + Udp(1, "udp"), + + Icmp(2, "icmp") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Protocol enumItem : Protocol.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Protocol(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Protocol item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Protocol item, or null if no such item exists + */ + public static Protocol forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("security-group-rule"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule.class; + } + + /** + * Identifier of this SecurityGroupRule information element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable description of the security group rule. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * The direction in which the security group rule is applied. Permitted values: + * INGRESS, EGRESS. Defaults to INGRESS. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule.Direction direction, or null if not present + */ + @Nullable Direction getDirection(); + + /** + * Indicates the protocol carried over the Ethernet layer. Permitted values: IPV4, + * IPV6. Defaults to IPV4. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule.EtherType etherType, or null if not present + */ + @Nullable EtherType getEtherType(); + + /** + * Indicates the protocol carried over the IP layer. Permitted values: any protocol + * defined in the IANA protocol registry, e.g. TCP, UDP, ICMP, etc. Defaults to + * TCP. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule.Protocol protocol, or null if not present + */ + @Nullable Protocol getProtocol(); + + /** + * Indicates minimum port number in the range that is matched by the security group + * rule. Defaults to 0. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 portRangeMin, or null if not present + */ + @Nullable Uint16 getPortRangeMin(); + + /** + * Indicates maximum port number in the range that is matched by the security group + * rule. Defaults to 65535. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 portRangeMax, or null if not present + */ + @Nullable Uint16 getPortRangeMax(); + + @Override + SecurityGroupRuleKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleBuilder.java new file mode 100644 index 0000000..e039327 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleBuilder.java @@ -0,0 +1,412 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link SecurityGroupRuleBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SecurityGroupRuleBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SecurityGroupRuleBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SecurityGroupRuleBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SecurityGroupRuleBuilder + * @see Builder + * + */ +public class SecurityGroupRuleBuilder implements Builder { + + private String _description; + private SecurityGroupRule.Direction _direction; + private SecurityGroupRule.EtherType _etherType; + private String _id; + private Uint16 _portRangeMax; + private Uint16 _portRangeMin; + private SecurityGroupRule.Protocol _protocol; + private SecurityGroupRuleKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SecurityGroupRuleBuilder() { + } + + public SecurityGroupRuleBuilder(SecurityGroupRule base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._description = base.getDescription(); + this._direction = base.getDirection(); + this._etherType = base.getEtherType(); + this._portRangeMax = base.getPortRangeMax(); + this._portRangeMin = base.getPortRangeMin(); + this._protocol = base.getProtocol(); + } + + + public SecurityGroupRuleKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public SecurityGroupRule.Direction getDirection() { + return _direction; + } + + public SecurityGroupRule.EtherType getEtherType() { + return _etherType; + } + + public String getId() { + return _id; + } + + public Uint16 getPortRangeMax() { + return _portRangeMax; + } + + public Uint16 getPortRangeMin() { + return _portRangeMin; + } + + public SecurityGroupRule.Protocol getProtocol() { + return _protocol; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public SecurityGroupRuleBuilder withKey(final SecurityGroupRuleKey key) { + this.key = key; + return this; + } + + public SecurityGroupRuleBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public SecurityGroupRuleBuilder setDirection(final SecurityGroupRule.Direction value) { + this._direction = value; + return this; + } + + public SecurityGroupRuleBuilder setEtherType(final SecurityGroupRule.EtherType value) { + this._etherType = value; + return this; + } + + public SecurityGroupRuleBuilder setId(final String value) { + this._id = value; + return this; + } + + public SecurityGroupRuleBuilder setPortRangeMax(final Uint16 value) { + this._portRangeMax = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setPortRangeMax(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public SecurityGroupRuleBuilder setPortRangeMax(final Integer value) { + return setPortRangeMax(CodeHelpers.compatUint(value)); + } + + public SecurityGroupRuleBuilder setPortRangeMin(final Uint16 value) { + this._portRangeMin = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setPortRangeMin(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public SecurityGroupRuleBuilder setPortRangeMin(final Integer value) { + return setPortRangeMin(CodeHelpers.compatUint(value)); + } + + public SecurityGroupRuleBuilder setProtocol(final SecurityGroupRule.Protocol value) { + this._protocol = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SecurityGroupRuleBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SecurityGroupRuleBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SecurityGroupRuleBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SecurityGroupRuleBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public SecurityGroupRule build() { + return new SecurityGroupRuleImpl(this); + } + + private static final class SecurityGroupRuleImpl + extends AbstractAugmentable + implements SecurityGroupRule { + + private final String _description; + private final SecurityGroupRule.Direction _direction; + private final SecurityGroupRule.EtherType _etherType; + private final String _id; + private final Uint16 _portRangeMax; + private final Uint16 _portRangeMin; + private final SecurityGroupRule.Protocol _protocol; + private final SecurityGroupRuleKey key; + + SecurityGroupRuleImpl(SecurityGroupRuleBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new SecurityGroupRuleKey(base.getId()); + } + this._id = key.getId(); + this._description = base.getDescription(); + this._direction = base.getDirection(); + this._etherType = base.getEtherType(); + this._portRangeMax = base.getPortRangeMax(); + this._portRangeMin = base.getPortRangeMin(); + this._protocol = base.getProtocol(); + } + + @Override + public SecurityGroupRuleKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public SecurityGroupRule.Direction getDirection() { + return _direction; + } + + @Override + public SecurityGroupRule.EtherType getEtherType() { + return _etherType; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Uint16 getPortRangeMax() { + return _portRangeMax; + } + + @Override + public Uint16 getPortRangeMin() { + return _portRangeMin; + } + + @Override + public SecurityGroupRule.Protocol getProtocol() { + return _protocol; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_direction); + result = prime * result + Objects.hashCode(_etherType); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_portRangeMax); + result = prime * result + Objects.hashCode(_portRangeMin); + result = prime * result + Objects.hashCode(_protocol); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!SecurityGroupRule.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + SecurityGroupRule other = (SecurityGroupRule)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_direction, other.getDirection())) { + return false; + } + if (!Objects.equals(_etherType, other.getEtherType())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_portRangeMax, other.getPortRangeMax())) { + return false; + } + if (!Objects.equals(_portRangeMin, other.getPortRangeMin())) { + return false; + } + if (!Objects.equals(_protocol, other.getProtocol())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SecurityGroupRuleImpl otherImpl = (SecurityGroupRuleImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("SecurityGroupRule"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_direction", _direction); + CodeHelpers.appendValue(helper, "_etherType", _etherType); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_portRangeMax", _portRangeMax); + CodeHelpers.appendValue(helper, "_portRangeMin", _portRangeMin); + CodeHelpers.appendValue(helper, "_protocol", _protocol); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleKey.java new file mode 100644 index 0000000..3a800a3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/security/group/rule/SecurityGroupRuleKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class SecurityGroupRuleKey + implements Identifier { + private static final long serialVersionUID = 5462535903571843209L; + private final String _id; + + + public SecurityGroupRuleKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public SecurityGroupRuleKey(SecurityGroupRuleKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SecurityGroupRuleKey)) { + return false; + } + final SecurityGroupRuleKey other = (SecurityGroupRuleKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(SecurityGroupRuleKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirement.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirement.java new file mode 100644 index 0000000..d2f35f9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirement.java @@ -0,0 +1,123 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement.NetworkInterfaceRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement.NetworkInterfaceRequirementsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies requirements on a virtual network interface realising the CPs + * instantiated from this CPD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-network-interface-requirement {
+ *   key name;
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   leaf support-mandatory {
+ *     default false;
+ *     type boolean;
+ *   }
+ *   list network-interface-requirements {
+ *     key key;
+ *     min-elements 1;
+ *     max-elements 1;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/virtual-network-interface-requirements/virtual-network-interface-requirement + * + *

To create instances of this class use {@link VirtualNetworkInterfaceRequirementBuilder}. + * @see VirtualNetworkInterfaceRequirementBuilder + * @see VirtualNetworkInterfaceRequirementKey + * + */ +public interface VirtualNetworkInterfaceRequirement + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-network-interface-requirement"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement.class; + } + + /** + * Provides a human readable name for the requirement. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Provides a human readable description of the requirement. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Indicates whether fulfilling the constraint is mandatory (true) for successful + * operation or desirable (false). + * + * + * + * @return java.lang.Boolean supportMandatory, or null if not present + */ + @Nullable Boolean isSupportMandatory(); + + /** + * The network interface requirements. An element from an array of key-value pairs + * that articulate the network interface deployment requirements. + * + * + * + * @return java.util.Map networkInterfaceRequirements, or null if not present + */ + @Nullable Map getNetworkInterfaceRequirements(); + + /** + * @return java.util.Map networkInterfaceRequirements, or an empty list if it is not present + */ + default @NonNull Map nonnullNetworkInterfaceRequirements() { + return CodeHelpers.nonnull(getNetworkInterfaceRequirements()); + } + + @Override + VirtualNetworkInterfaceRequirementKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementBuilder.java new file mode 100644 index 0000000..ddf4929 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementBuilder.java @@ -0,0 +1,338 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement.NetworkInterfaceRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement.NetworkInterfaceRequirementsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualNetworkInterfaceRequirementBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualNetworkInterfaceRequirementBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualNetworkInterfaceRequirementBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualNetworkInterfaceRequirementBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualNetworkInterfaceRequirementBuilder + * @see Builder + * + */ +public class VirtualNetworkInterfaceRequirementBuilder implements Builder { + + private String _description; + private String _name; + private Map _networkInterfaceRequirements; + private Boolean _supportMandatory; + private VirtualNetworkInterfaceRequirementKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualNetworkInterfaceRequirementBuilder() { + } + + public VirtualNetworkInterfaceRequirementBuilder(VirtualNetworkInterfaceRequirement base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._name = base.getName(); + this._description = base.getDescription(); + this._networkInterfaceRequirements = base.getNetworkInterfaceRequirements(); + this._supportMandatory = base.isSupportMandatory(); + } + + + public VirtualNetworkInterfaceRequirementKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public String getName() { + return _name; + } + + public Map getNetworkInterfaceRequirements() { + return _networkInterfaceRequirements; + } + + public Boolean isSupportMandatory() { + return _supportMandatory; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualNetworkInterfaceRequirementBuilder withKey(final VirtualNetworkInterfaceRequirementKey key) { + this.key = key; + return this; + } + + public VirtualNetworkInterfaceRequirementBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public VirtualNetworkInterfaceRequirementBuilder setName(final String value) { + this._name = value; + return this; + } + public VirtualNetworkInterfaceRequirementBuilder setNetworkInterfaceRequirements(final Map values) { + this._networkInterfaceRequirements = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNetworkInterfaceRequirements(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualNetworkInterfaceRequirementBuilder setNetworkInterfaceRequirements(final List values) { + return setNetworkInterfaceRequirements(CodeHelpers.compatMap(values)); + } + + public VirtualNetworkInterfaceRequirementBuilder setSupportMandatory(final Boolean value) { + this._supportMandatory = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualNetworkInterfaceRequirementBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualNetworkInterfaceRequirementBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualNetworkInterfaceRequirementBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualNetworkInterfaceRequirementBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualNetworkInterfaceRequirement build() { + return new VirtualNetworkInterfaceRequirementImpl(this); + } + + private static final class VirtualNetworkInterfaceRequirementImpl + extends AbstractAugmentable + implements VirtualNetworkInterfaceRequirement { + + private final String _description; + private final String _name; + private final Map _networkInterfaceRequirements; + private final Boolean _supportMandatory; + private final VirtualNetworkInterfaceRequirementKey key; + + VirtualNetworkInterfaceRequirementImpl(VirtualNetworkInterfaceRequirementBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualNetworkInterfaceRequirementKey(base.getName()); + } + this._name = key.getName(); + this._description = base.getDescription(); + this._networkInterfaceRequirements = CodeHelpers.emptyToNull(base.getNetworkInterfaceRequirements()); + this._supportMandatory = base.isSupportMandatory(); + } + + @Override + public VirtualNetworkInterfaceRequirementKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getName() { + return _name; + } + + @Override + public Map getNetworkInterfaceRequirements() { + return _networkInterfaceRequirements; + } + + @Override + public Boolean isSupportMandatory() { + return _supportMandatory; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_networkInterfaceRequirements); + result = prime * result + Objects.hashCode(_supportMandatory); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualNetworkInterfaceRequirement.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualNetworkInterfaceRequirement other = (VirtualNetworkInterfaceRequirement)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_networkInterfaceRequirements, other.getNetworkInterfaceRequirements())) { + return false; + } + if (!Objects.equals(_supportMandatory, other.isSupportMandatory())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualNetworkInterfaceRequirementImpl otherImpl = (VirtualNetworkInterfaceRequirementImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualNetworkInterfaceRequirement"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_networkInterfaceRequirements", _networkInterfaceRequirements); + CodeHelpers.appendValue(helper, "_supportMandatory", _supportMandatory); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementKey.java new file mode 100644 index 0000000..1f54182 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/VirtualNetworkInterfaceRequirementKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualNetworkInterfaceRequirementKey + implements Identifier { + private static final long serialVersionUID = 7680743484721154658L; + private final String _name; + + + public VirtualNetworkInterfaceRequirementKey(String _name) { + + this._name = _name; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualNetworkInterfaceRequirementKey(VirtualNetworkInterfaceRequirementKey source) { + this._name = source._name; + } + + + public String getName() { + return _name; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_name); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualNetworkInterfaceRequirementKey)) { + return false; + } + final VirtualNetworkInterfaceRequirementKey other = (VirtualNetworkInterfaceRequirementKey) obj; + if (!Objects.equals(_name, other._name)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualNetworkInterfaceRequirementKey.class); + CodeHelpers.appendValue(helper, "_name", _name); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirements.java new file mode 100644 index 0000000..6f81c81 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirements.java @@ -0,0 +1,70 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The network interface requirements. An element from an array of key-value pairs + * that articulate the network interface deployment requirements. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list network-interface-requirements {
+ *   key key;
+ *   min-elements 1;
+ *   max-elements 1;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/virtual-network-interface-requirements/virtual-network-interface-requirement/network-interface-requirements + * + *

To create instances of this class use {@link NetworkInterfaceRequirementsBuilder}. + * @see NetworkInterfaceRequirementsBuilder + * @see NetworkInterfaceRequirementsKey + * + */ +public interface NetworkInterfaceRequirements + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("network-interface-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement.NetworkInterfaceRequirements.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + NetworkInterfaceRequirementsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsBuilder.java new file mode 100644 index 0000000..fa55bee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NetworkInterfaceRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NetworkInterfaceRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NetworkInterfaceRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NetworkInterfaceRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NetworkInterfaceRequirementsBuilder + * @see Builder + * + */ +public class NetworkInterfaceRequirementsBuilder implements Builder { + + private String _key; + private String _value; + private NetworkInterfaceRequirementsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NetworkInterfaceRequirementsBuilder() { + } + + public NetworkInterfaceRequirementsBuilder(NetworkInterfaceRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public NetworkInterfaceRequirementsKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NetworkInterfaceRequirementsBuilder withKey(final NetworkInterfaceRequirementsKey key) { + this.key = key; + return this; + } + + public NetworkInterfaceRequirementsBuilder setKey(final String value) { + this._key = value; + return this; + } + + public NetworkInterfaceRequirementsBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NetworkInterfaceRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NetworkInterfaceRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NetworkInterfaceRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NetworkInterfaceRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NetworkInterfaceRequirements build() { + return new NetworkInterfaceRequirementsImpl(this); + } + + private static final class NetworkInterfaceRequirementsImpl + extends AbstractAugmentable + implements NetworkInterfaceRequirements { + + private final String _key; + private final String _value; + private final NetworkInterfaceRequirementsKey key; + + NetworkInterfaceRequirementsImpl(NetworkInterfaceRequirementsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NetworkInterfaceRequirementsKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public NetworkInterfaceRequirementsKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NetworkInterfaceRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NetworkInterfaceRequirements other = (NetworkInterfaceRequirements)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NetworkInterfaceRequirementsImpl otherImpl = (NetworkInterfaceRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NetworkInterfaceRequirements"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsKey.java new file mode 100644 index 0000000..878cc91 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/virtual/network/_interface/requirements/virtual/network/_interface/requirement/NetworkInterfaceRequirementsKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.virtual.network._interface.requirement; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NetworkInterfaceRequirementsKey + implements Identifier { + private static final long serialVersionUID = -5518541956212500630L; + private final String _key; + + + public NetworkInterfaceRequirementsKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NetworkInterfaceRequirementsKey(NetworkInterfaceRequirementsKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NetworkInterfaceRequirementsKey)) { + return false; + } + final NetworkInterfaceRequirementsKey other = (NetworkInterfaceRequirementsKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NetworkInterfaceRequirementsKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurableProperties.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurableProperties.java new file mode 100644 index 0000000..57a7c8d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurableProperties.java @@ -0,0 +1,99 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties.AdditionalConfigurableProperty; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties.AdditionalConfigurablePropertyKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the configurable properties of the VNF (e.g. related to auto scaling + * and auto healing). + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container configurable-properties {
+ *   leaf is-auto-scalable-enabled {
+ *     type boolean;
+ *   }
+ *   leaf is-auto-heal-enabled {
+ *     type boolean;
+ *   }
+ *   list additional-configurable-property {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/configurable-properties + * + *

To create instances of this class use {@link ConfigurablePropertiesBuilder}. + * @see ConfigurablePropertiesBuilder + * + */ +public interface ConfigurableProperties + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("configurable-properties"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties.class; + } + + /** + * It permits to enable (TRUE) / disable (FALSE) the auto-scaling functionality. + * + * + * + * @return java.lang.Boolean isAutoScalableEnabled, or null if not present + */ + @Nullable Boolean isIsAutoScalableEnabled(); + + /** + * It permits to enable (TRUE) / disable (FALSE) the auto-healing functionality. + * + * + * + * @return java.lang.Boolean isAutoHealEnabled, or null if not present + */ + @Nullable Boolean isIsAutoHealEnabled(); + + /** + * It provides VNF specific configurable properties that can be modified using the + * ModifyVnfConfiguration operation. + * + * + * + * @return java.util.Map additionalConfigurableProperty, or null if not present + */ + @Nullable Map getAdditionalConfigurableProperty(); + + /** + * @return java.util.Map additionalConfigurableProperty, or an empty list if it is not present + */ + default @NonNull Map nonnullAdditionalConfigurableProperty() { + return CodeHelpers.nonnull(getAdditionalConfigurableProperty()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurablePropertiesBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurablePropertiesBuilder.java new file mode 100644 index 0000000..ace9972 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ConfigurablePropertiesBuilder.java @@ -0,0 +1,294 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties.AdditionalConfigurableProperty; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties.AdditionalConfigurablePropertyKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConfigurablePropertiesBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConfigurablePropertiesBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConfigurablePropertiesBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConfigurablePropertiesBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConfigurablePropertiesBuilder + * @see Builder + * + */ +public class ConfigurablePropertiesBuilder implements Builder { + + private Map _additionalConfigurableProperty; + private Boolean _isAutoHealEnabled; + private Boolean _isAutoScalableEnabled; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConfigurablePropertiesBuilder() { + } + + public ConfigurablePropertiesBuilder(ConfigurableProperties base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._additionalConfigurableProperty = base.getAdditionalConfigurableProperty(); + this._isAutoHealEnabled = base.isIsAutoHealEnabled(); + this._isAutoScalableEnabled = base.isIsAutoScalableEnabled(); + } + + + public Map getAdditionalConfigurableProperty() { + return _additionalConfigurableProperty; + } + + public Boolean isIsAutoHealEnabled() { + return _isAutoHealEnabled; + } + + public Boolean isIsAutoScalableEnabled() { + return _isAutoScalableEnabled; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ConfigurablePropertiesBuilder setAdditionalConfigurableProperty(final Map values) { + this._additionalConfigurableProperty = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAdditionalConfigurableProperty(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ConfigurablePropertiesBuilder setAdditionalConfigurableProperty(final List values) { + return setAdditionalConfigurableProperty(CodeHelpers.compatMap(values)); + } + + public ConfigurablePropertiesBuilder setIsAutoHealEnabled(final Boolean value) { + this._isAutoHealEnabled = value; + return this; + } + + public ConfigurablePropertiesBuilder setIsAutoScalableEnabled(final Boolean value) { + this._isAutoScalableEnabled = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConfigurablePropertiesBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConfigurablePropertiesBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConfigurablePropertiesBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConfigurablePropertiesBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConfigurableProperties build() { + return new ConfigurablePropertiesImpl(this); + } + + private static final class ConfigurablePropertiesImpl + extends AbstractAugmentable + implements ConfigurableProperties { + + private final Map _additionalConfigurableProperty; + private final Boolean _isAutoHealEnabled; + private final Boolean _isAutoScalableEnabled; + + ConfigurablePropertiesImpl(ConfigurablePropertiesBuilder base) { + super(base.augmentation); + this._additionalConfigurableProperty = CodeHelpers.emptyToNull(base.getAdditionalConfigurableProperty()); + this._isAutoHealEnabled = base.isIsAutoHealEnabled(); + this._isAutoScalableEnabled = base.isIsAutoScalableEnabled(); + } + + @Override + public Map getAdditionalConfigurableProperty() { + return _additionalConfigurableProperty; + } + + @Override + public Boolean isIsAutoHealEnabled() { + return _isAutoHealEnabled; + } + + @Override + public Boolean isIsAutoScalableEnabled() { + return _isAutoScalableEnabled; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_additionalConfigurableProperty); + result = prime * result + Objects.hashCode(_isAutoHealEnabled); + result = prime * result + Objects.hashCode(_isAutoScalableEnabled); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConfigurableProperties.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConfigurableProperties other = (ConfigurableProperties)obj; + if (!Objects.equals(_additionalConfigurableProperty, other.getAdditionalConfigurableProperty())) { + return false; + } + if (!Objects.equals(_isAutoHealEnabled, other.isIsAutoHealEnabled())) { + return false; + } + if (!Objects.equals(_isAutoScalableEnabled, other.isIsAutoScalableEnabled())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConfigurablePropertiesImpl otherImpl = (ConfigurablePropertiesImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConfigurableProperties"); + CodeHelpers.appendValue(helper, "_additionalConfigurableProperty", _additionalConfigurableProperty); + CodeHelpers.appendValue(helper, "_isAutoHealEnabled", _isAutoHealEnabled); + CodeHelpers.appendValue(helper, "_isAutoScalableEnabled", _isAutoScalableEnabled); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Df.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Df.java new file mode 100644 index 0000000..8dda1c3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Df.java @@ -0,0 +1,694 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SupportedOperation; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.DfBuilder.DfImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.InstantiationLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.InstantiationLevelKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.MonitoringParameterKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.ScalingAspect; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.ScalingAspectKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.SupportedVnfInterfaces; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.SupportedVnfInterfacesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VduProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VduProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfileKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Describes a specific Deployment Flavour (DF) of a VNF with specific + * for capacity and performance. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list df {
+ *   must "default-instantiation-level or count(instantiation-level) = 1";
+ *   key id;
+ *   min-elements 1;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list vdu-profile {
+ *     key id;
+ *     min-elements 1;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../vdu/id;
+ *       }
+ *     }
+ *     leaf min-number-of-instances {
+ *       type uint16;
+ *       default 1;
+ *     }
+ *     leaf max-number-of-instances {
+ *       type uint16;
+ *       default 1;
+ *       must ". >= ../min-number-of-instances";
+ *     }
+ *     uses local-affinity-or-anti-affinity-rule;
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-profile {
+ *     key "id flavour";
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../int-virtual-link-desc/id;
+ *       }
+ *     }
+ *     leaf flavour {
+ *       type leafref {
+ *         path ../../../flavour/id;
+ *       }
+ *     }
+ *     uses local-affinity-or-anti-affinity-rule;
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *     container max-bit-rate-requirements {
+ *       leaf root {
+ *         type uint32;
+ *       }
+ *       leaf leaf {
+ *         type uint32;
+ *       }
+ *     }
+ *     container min-bit-rate-requirements {
+ *       leaf root {
+ *         type uint32;
+ *       }
+ *       leaf leaf {
+ *         type uint32;
+ *       }
+ *     }
+ *     container virtual-link-protocol-data {
+ *       leaf associated-layer-protocol {
+ *         type identityref {
+ *           base layer-protocol;
+ *         }
+ *       }
+ *       container l2-protocol-data {
+ *         when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *         leaf name {
+ *           type string;
+ *         }
+ *         leaf network-type {
+ *           type enumeration {
+ *             enum flat;
+ *             enum vlan;
+ *             enum vxlan;
+ *             enum gre;
+ *           }
+ *         }
+ *         leaf vlan-transparent {
+ *           type boolean;
+ *         }
+ *         leaf mtu {
+ *           type uint16;
+ *         }
+ *       }
+ *       container l3-protocol-data {
+ *         when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *         leaf name {
+ *           type string;
+ *         }
+ *         leaf ip-version {
+ *           type enumeration {
+ *             enum ipv4;
+ *             enum ipv6;
+ *           }
+ *           default ipv4;
+ *         }
+ *         leaf cidr {
+ *           type string;
+ *         }
+ *         leaf-list ip-allocation-pools {
+ *           type string;
+ *         }
+ *         leaf gateway-ip {
+ *           type inet:ip-address;
+ *         }
+ *         leaf dhcp-enabled {
+ *           type boolean;
+ *           default true;
+ *         }
+ *         leaf ipv6-address-mode {
+ *           when "../ip-version = 'ipv6'";
+ *           type enumeration {
+ *             enum slaac;
+ *             enum dhcpv6-stateful;
+ *             enum dhcpv6-stateless;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list instantiation-level {
+ *     key id;
+ *     min-elements 1;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list vdu-level {
+ *       key vdu-id;
+ *       min-elements 1;
+ *       leaf vdu-id {
+ *         type leafref {
+ *           path ../../../../vdu/id;
+ *         }
+ *       }
+ *       leaf number-of-instances {
+ *         type uint16;
+ *         must ". <= ../../../../df/vdu-profile[id=current()/../vdu-id]/max-number-of-instances";
+ *         must ". >= ../../../../df/vdu-profile[id=current()/../vdu-id]/min-number-of-instances";
+ *         default 1;
+ *       }
+ *     }
+ *     list scaling-info {
+ *       key scaling-aspect-id;
+ *       leaf scaling-aspect-id {
+ *         type leafref {
+ *           path ../../../scaling-aspect/id;
+ *         }
+ *       }
+ *       leaf scale-level {
+ *         type uint32;
+ *       }
+ *     }
+ *   }
+ *   leaf default-instantiation-level {
+ *     type leafref {
+ *       path ../instantiation-level/id;
+ *     }
+ *   }
+ *   leaf-list supported-operation {
+ *     type identityref {
+ *       base supported-operation;
+ *     }
+ *   }
+ *   container lcm-operations-configuration {
+ *     container instantiate-vnf-op-config {
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     container scale-vnf-op-config {
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *       leaf scaling-by-more-than-one-step-supported {
+ *         type boolean;
+ *         default false;
+ *       }
+ *     }
+ *     container scale-vnf-to-level-op-config {
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *       leaf arbitrary-target-levels-supported {
+ *         type boolean;
+ *         default false;
+ *       }
+ *     }
+ *     container heal-vnf-op-config {
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *       leaf-list cause {
+ *         type string;
+ *       }
+ *     }
+ *     container terminate-vnf-op-config {
+ *       leaf min-graceful-termination {
+ *         type yang:timeticks;
+ *         default 1;
+ *       }
+ *       leaf max-recommended-graceful-termination {
+ *         type yang:timeticks;
+ *       }
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     container operate-vnf-op-config {
+ *       leaf min-graceful-stop-timeout {
+ *         type yang:timeticks;
+ *         default 1;
+ *       }
+ *       leaf max-recommended-graceful-stop-timeout {
+ *         type yang:timeticks;
+ *       }
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     container change-vnf-flavour-op-config {
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     container change-ext-vnf-connectivity-op-config {
+ *       list parameter {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list affinity-or-anti-affinity-group {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf type {
+ *       type affinity-type;
+ *     }
+ *     leaf scope {
+ *       type affinity-scope;
+ *     }
+ *   }
+ *   list indicator {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf indicator-value {
+ *       type string;
+ *     }
+ *     leaf source {
+ *       type enumeration {
+ *         enum vnf;
+ *         enum em;
+ *         enum both;
+ *       }
+ *     }
+ *   }
+ *   list supported-vnf-interfaces {
+ *     key name;
+ *     leaf name {
+ *       type enumeration {
+ *         enum vnf-configuration;
+ *         enum vnf-indicator;
+ *       }
+ *     }
+ *     leaf-list cpd-id {
+ *       type leafref {
+ *         path ../../../ext-cpd/id;
+ *       }
+ *     }
+ *     list interface-details {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   list monitoring-parameter {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     uses monitoring-parameter;
+ *   }
+ *   list scaling-aspect {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf max-scale-level {
+ *       type uint32 {
+ *         range 1..max;
+ *       }
+ *     }
+ *     container aspect-delta-details {
+ *       list deltas {
+ *         key id;
+ *         min-elements 1;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         list vdu-delta {
+ *           key id;
+ *           leaf id {
+ *             type leafref {
+ *               path ../../../../../../vdu/id;
+ *             }
+ *           }
+ *           leaf number-of-instances {
+ *             type uint32 {
+ *               range 0..max;
+ *             }
+ *           }
+ *         }
+ *         list virtual-link-bit-rate-delta {
+ *           key id;
+ *           leaf id {
+ *             type string;
+ *           }
+ *           container bit-rate-requirements {
+ *             leaf root {
+ *               type uint32;
+ *               units bits/sec;
+ *             }
+ *             leaf leaf {
+ *               type uint32;
+ *               units bits/sec;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       leaf step-deltas {
+ *         type leafref {
+ *           path ../deltas/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df + * + *

To create instances of this class use {@link DfBuilder}. + * @see DfBuilder + * @see DfKey + * + */ +@JsonDeserialize(as = DfImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface Df + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("df"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df.class; + } + + /** + * Identifier of this DF within the VNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable description of the deployment flavour + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * The Vduprofile describes additional instantiation data for a given VDU used in a + * deployment flavour. + * + * + * + * @return java.util.Map vduProfile, or null if not present + */ + @Nullable Map getVduProfile(); + + /** + * @return java.util.Map vduProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullVduProfile() { + return CodeHelpers.nonnull(getVduProfile()); + } + + /** + * Defines the internal VLD along with additional data which is used in this DF. + * + * + * + * @return java.util.Map virtualLinkProfile, or null if not present + */ + @JsonDeserialize(keyUsing = VirtualLinkProfileKey.class) + @Nullable Map getVirtualLinkProfile(); + + /** + * @return java.util.Map virtualLinkProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkProfile() { + return CodeHelpers.nonnull(getVirtualLinkProfile()); + } + + /** + * Describes the various levels of resources that can be used to instantiate the + * VNF using this flavour. Examples: Small, Medium, Large. If there is only one + * 'instantiationLevel' entry, it shall be treated as the default instantiation + * level for this DF. The InstantiationLevel information element describes a given + * level of resources to be instantiated within a deployment flavour in term of the + * number of VNFC instances to be created from each VDU. All the VDUs referenced in + * the level shall be part of the corresponding deployment flavour and their number + * shall be within the range (min/max) for this deployment flavour. + * + * + * + * @return java.util.Map instantiationLevel, or null if not present + */ + @Nullable Map getInstantiationLevel(); + + /** + * @return java.util.Map instantiationLevel, or an empty list if it is not present + */ + default @NonNull Map nonnullInstantiationLevel() { + return CodeHelpers.nonnull(getInstantiationLevel()); + } + + /** + * This attribute references the 'instantiationLevel' entry which defines the + * default instantiation level for this DF. It shall be present if there are + * multiple 'instantiationLevel' entries. + * + * + * + * @return java.lang.String defaultInstantiationLevel, or null if not present + */ + @Nullable String getDefaultInstantiationLevel(); + + /** + * Indicates which operations are available for this DF via the VNF LCM interface. + * Instantiate VNF, Query VNF and Terminate VNF are supported in all DF and + * therefore need not be included in this list. + * + * + * + * @return java.util.List supportedOperation, or null if not present + */ + @Nullable List> getSupportedOperation(); + + /** + * This information element is a container for all attributes that affect the + * invocation of the VNF Lifecycle Management operations, structured by operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration lcmOperationsConfiguration, or null if not present + */ + @Nullable LcmOperationsConfiguration getLcmOperationsConfiguration(); + + /** + * The AffinityOrAntiAffinityGroup describes the affinity or anti-affinity + * relationship applicable between the virtualization containers to be created + * based on different VDUs, or between internal VLs to be created based on + * different VnfVirtualLinkDesc(s). Per VNF, the affinity/anti-affinity rules + * defined using this information element, using the + * LocalAffinityOrAntiAffinityRule information element, and using the placement + * constraints in the GrantLifecycleOperation as defined in ETSI GS NFV-IFA 007 + * [i.3] should be conflict-free. In case of conflicts, the placement constraints + * in the GrantLifecycleOperation shall take precedence. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroup, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroup(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroup() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroup()); + } + + /** + * Declares the VNF indicators that are supported by this VNF (specific to this + * DF). + * + * + * + * @return java.util.Map indicator, or null if not present + */ + @Nullable Map getIndicator(); + + /** + * @return java.util.Map indicator, or an empty list if it is not present + */ + default @NonNull Map nonnullIndicator() { + return CodeHelpers.nonnull(getIndicator()); + } + + /** + * Indicates which interfaces the VNF produces and provides additional details on + * how to access the interface endpoints. + * + * + * + * @return java.util.Map supportedVnfInterfaces, or null if not present + */ + @JsonDeserialize(keyUsing = SupportedVnfInterfacesKey.class) + @Nullable Map getSupportedVnfInterfaces(); + + /** + * @return java.util.Map supportedVnfInterfaces, or an empty list if it is not present + */ + default @NonNull Map nonnullSupportedVnfInterfaces() { + return CodeHelpers.nonnull(getSupportedVnfInterfaces()); + } + + /** + * Defines the virtualised resources monitoring parameters on VNF level. + * + * + * + * @return java.util.Map monitoringParameter, or null if not present + */ + @Nullable Map getMonitoringParameter(); + + /** + * @return java.util.Map monitoringParameter, or an empty list if it is not present + */ + default @NonNull Map nonnullMonitoringParameter() { + return CodeHelpers.nonnull(getMonitoringParameter()); + } + + /** + * The scaling aspects supported by this DF of the VNF. scalingAspect shall be + * present if the VNF supports scaling. + * + * + * + * @return java.util.Map scalingAspect, or null if not present + */ + @Nullable Map getScalingAspect(); + + /** + * @return java.util.Map scalingAspect, or an empty list if it is not present + */ + default @NonNull Map nonnullScalingAspect() { + return CodeHelpers.nonnull(getScalingAspect()); + } + + @Override + DfKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfBuilder.java new file mode 100644 index 0000000..72cc4af --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfBuilder.java @@ -0,0 +1,690 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SupportedOperation; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.InstantiationLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.InstantiationLevelKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.MonitoringParameterKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.ScalingAspect; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.ScalingAspectKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.SupportedVnfInterfaces; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.SupportedVnfInterfacesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VduProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VduProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfileKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link DfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DfBuilder + * @see Builder + * + */ +public class DfBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroup; + private String _defaultInstantiationLevel; + private String _description; + private String _id; + private Map _indicator; + private Map _instantiationLevel; + private LcmOperationsConfiguration _lcmOperationsConfiguration; + private Map _monitoringParameter; + private Map _scalingAspect; + private List> _supportedOperation; + private Map _supportedVnfInterfaces; + private Map _vduProfile; + private Map _virtualLinkProfile; + private DfKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DfBuilder() { + } + + public DfBuilder(Df base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroup = base.getAffinityOrAntiAffinityGroup(); + this._defaultInstantiationLevel = base.getDefaultInstantiationLevel(); + this._description = base.getDescription(); + this._indicator = base.getIndicator(); + this._instantiationLevel = base.getInstantiationLevel(); + this._lcmOperationsConfiguration = base.getLcmOperationsConfiguration(); + this._monitoringParameter = base.getMonitoringParameter(); + this._scalingAspect = base.getScalingAspect(); + this._supportedOperation = base.getSupportedOperation(); + this._supportedVnfInterfaces = base.getSupportedVnfInterfaces(); + this._vduProfile = base.getVduProfile(); + this._virtualLinkProfile = base.getVirtualLinkProfile(); + } + + + public DfKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + public String getDefaultInstantiationLevel() { + return _defaultInstantiationLevel; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public Map getIndicator() { + return _indicator; + } + + public Map getInstantiationLevel() { + return _instantiationLevel; + } + + public LcmOperationsConfiguration getLcmOperationsConfiguration() { + return _lcmOperationsConfiguration; + } + + public Map getMonitoringParameter() { + return _monitoringParameter; + } + + public Map getScalingAspect() { + return _scalingAspect; + } + + public List> getSupportedOperation() { + return _supportedOperation; + } + + public Map getSupportedVnfInterfaces() { + return _supportedVnfInterfaces; + } + + public Map getVduProfile() { + return _vduProfile; + } + + public Map getVirtualLinkProfile() { + return _virtualLinkProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public DfBuilder withKey(final DfKey key) { + this.key = key; + return this; + } + public DfBuilder setAffinityOrAntiAffinityGroup(final Map values) { + this._affinityOrAntiAffinityGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setAffinityOrAntiAffinityGroup(final List values) { + return setAffinityOrAntiAffinityGroup(CodeHelpers.compatMap(values)); + } + + public DfBuilder setDefaultInstantiationLevel(final String value) { + this._defaultInstantiationLevel = value; + return this; + } + + public DfBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public DfBuilder setId(final String value) { + this._id = value; + return this; + } + public DfBuilder setIndicator(final Map values) { + this._indicator = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIndicator(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public DfBuilder setIndicator(final List values) { + return setIndicator(CodeHelpers.compatMap(values)); + } + public DfBuilder setInstantiationLevel(final Map values) { + this._instantiationLevel = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setInstantiationLevel(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setInstantiationLevel(final List values) { + return setInstantiationLevel(CodeHelpers.compatMap(values)); + } + + public DfBuilder setLcmOperationsConfiguration(final LcmOperationsConfiguration value) { + this._lcmOperationsConfiguration = value; + return this; + } + public DfBuilder setMonitoringParameter(final Map values) { + this._monitoringParameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setMonitoringParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setMonitoringParameter(final List values) { + return setMonitoringParameter(CodeHelpers.compatMap(values)); + } + public DfBuilder setScalingAspect(final Map values) { + this._scalingAspect = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setScalingAspect(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setScalingAspect(final List values) { + return setScalingAspect(CodeHelpers.compatMap(values)); + } + public DfBuilder setSupportedOperation(final List> values) { + this._supportedOperation = values; + return this; + } + + public DfBuilder setSupportedVnfInterfaces(final Map values) { + this._supportedVnfInterfaces = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSupportedVnfInterfaces(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setSupportedVnfInterfaces(final List values) { + return setSupportedVnfInterfaces(CodeHelpers.compatMap(values)); + } + public DfBuilder setVduProfile(final Map values) { + this._vduProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVduProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setVduProfile(final List values) { + return setVduProfile(CodeHelpers.compatMap(values)); + } + public DfBuilder setVirtualLinkProfile(final Map values) { + this._virtualLinkProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setVirtualLinkProfile(final List values) { + return setVirtualLinkProfile(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Df build() { + return new DfImpl(this); + } + + public static final class DfImpl + extends AbstractAugmentable + implements Df { + private final Map _affinityOrAntiAffinityGroup; + private final String _defaultInstantiationLevel; + private final String _description; + private final String _id; + private final Map _indicator; + private final Map _instantiationLevel; + private final LcmOperationsConfiguration _lcmOperationsConfiguration; + private final Map _monitoringParameter; + private final Map _scalingAspect; + private final List> _supportedOperation; + @JsonDeserialize(keyUsing = SupportedVnfInterfacesKey.class) + private final Map _supportedVnfInterfaces; + private final Map _vduProfile; + private final Map _virtualLinkProfile; + private DfKey key; + + DfImpl(DfBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new DfKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroup = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroup()); + this._defaultInstantiationLevel = base.getDefaultInstantiationLevel(); + this._description = base.getDescription(); + this._indicator = CodeHelpers.emptyToNull(base.getIndicator()); + this._instantiationLevel = CodeHelpers.emptyToNull(base.getInstantiationLevel()); + this._lcmOperationsConfiguration = base.getLcmOperationsConfiguration(); + this._monitoringParameter = CodeHelpers.emptyToNull(base.getMonitoringParameter()); + this._scalingAspect = CodeHelpers.emptyToNull(base.getScalingAspect()); + this._supportedOperation = base.getSupportedOperation(); + this._supportedVnfInterfaces = CodeHelpers.emptyToNull(base.getSupportedVnfInterfaces()); + this._vduProfile = CodeHelpers.emptyToNull(base.getVduProfile()); + this._virtualLinkProfile = CodeHelpers.emptyToNull(base.getVirtualLinkProfile()); + } + + public DfImpl() { + this( new DfBuilder()); + } + + + @Override + public DfKey key() { + if ( ( key != null) && ( key.getId() == null) && ( _id != null) ) { + key = new DfKey(_id); + } + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + @Override + public String getDefaultInstantiationLevel() { + return _defaultInstantiationLevel; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getIndicator() { + return _indicator; + } + + @Override + public Map getInstantiationLevel() { + return _instantiationLevel; + } + + @Override + public LcmOperationsConfiguration getLcmOperationsConfiguration() { + return _lcmOperationsConfiguration; + } + + @Override + public Map getMonitoringParameter() { + return _monitoringParameter; + } + + @Override + public Map getScalingAspect() { + return _scalingAspect; + } + + @Override + public List> getSupportedOperation() { + return _supportedOperation; + } + + @Override + public Map getSupportedVnfInterfaces() { + return _supportedVnfInterfaces; + } + + @Override + public Map getVduProfile() { + return _vduProfile; + } + + @Override + public Map getVirtualLinkProfile() { + return _virtualLinkProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroup); + result = prime * result + Objects.hashCode(_defaultInstantiationLevel); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_indicator); + result = prime * result + Objects.hashCode(_instantiationLevel); + result = prime * result + Objects.hashCode(_lcmOperationsConfiguration); + result = prime * result + Objects.hashCode(_monitoringParameter); + result = prime * result + Objects.hashCode(_scalingAspect); + result = prime * result + Objects.hashCode(_supportedOperation); + result = prime * result + Objects.hashCode(_supportedVnfInterfaces); + result = prime * result + Objects.hashCode(_vduProfile); + result = prime * result + Objects.hashCode(_virtualLinkProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Df.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Df other = (Df)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroup, other.getAffinityOrAntiAffinityGroup())) { + return false; + } + if (!Objects.equals(_defaultInstantiationLevel, other.getDefaultInstantiationLevel())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_indicator, other.getIndicator())) { + return false; + } + if (!Objects.equals(_instantiationLevel, other.getInstantiationLevel())) { + return false; + } + if (!Objects.equals(_lcmOperationsConfiguration, other.getLcmOperationsConfiguration())) { + return false; + } + if (!Objects.equals(_monitoringParameter, other.getMonitoringParameter())) { + return false; + } + if (!Objects.equals(_scalingAspect, other.getScalingAspect())) { + return false; + } + if (!Objects.equals(_supportedOperation, other.getSupportedOperation())) { + return false; + } + if (!Objects.equals(_supportedVnfInterfaces, other.getSupportedVnfInterfaces())) { + return false; + } + if (!Objects.equals(_vduProfile, other.getVduProfile())) { + return false; + } + if (!Objects.equals(_virtualLinkProfile, other.getVirtualLinkProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DfImpl otherImpl = (DfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Df"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroup", _affinityOrAntiAffinityGroup); + CodeHelpers.appendValue(helper, "_defaultInstantiationLevel", _defaultInstantiationLevel); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_indicator", _indicator); + CodeHelpers.appendValue(helper, "_instantiationLevel", _instantiationLevel); + CodeHelpers.appendValue(helper, "_lcmOperationsConfiguration", _lcmOperationsConfiguration); + CodeHelpers.appendValue(helper, "_monitoringParameter", _monitoringParameter); + CodeHelpers.appendValue(helper, "_scalingAspect", _scalingAspect); + CodeHelpers.appendValue(helper, "_supportedOperation", _supportedOperation); + CodeHelpers.appendValue(helper, "_supportedVnfInterfaces", _supportedVnfInterfaces); + CodeHelpers.appendValue(helper, "_vduProfile", _vduProfile); + CodeHelpers.appendValue(helper, "_virtualLinkProfile", _virtualLinkProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfKey.java new file mode 100644 index 0000000..a6f809b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/DfKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class DfKey + implements Identifier { + private static final long serialVersionUID = 4083286612161956839L; + private final String _id; + + + public DfKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public DfKey(DfKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DfKey)) { + return false; + } + final DfKey other = (DfKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(DfKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroup.java new file mode 100644 index 0000000..b3c0bf4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroup.java @@ -0,0 +1,105 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the associated elements of a VNFD for a certain purpose during VNF + * lifecycle management. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list element-group {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   leaf-list vdu {
+ *     type leafref {
+ *       path ../../vdu/id;
+ *     }
+ *   }
+ *   leaf-list virtual-link-desc {
+ *     type leafref {
+ *       path ../../int-virtual-link-desc/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/element-group + * + *

To create instances of this class use {@link ElementGroupBuilder}. + * @see ElementGroupBuilder + * @see ElementGroupKey + * + */ +public interface ElementGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("element-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroup.class; + } + + /** + * Unique identifier of this group in the VNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable description of the group. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * References to Vdus that are part of this group. + * + * + * + * @return java.util.List vdu, or null if not present + */ + @Nullable List getVdu(); + + /** + * References to VnfVirtualLinkDesc that are part of this group. + * + * + * + * @return java.util.List virtualLinkDesc, or null if not present + */ + @Nullable List getVirtualLinkDesc(); + + @Override + ElementGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupBuilder.java new file mode 100644 index 0000000..7532bbf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupBuilder.java @@ -0,0 +1,318 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ElementGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ElementGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ElementGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ElementGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ElementGroupBuilder + * @see Builder + * + */ +public class ElementGroupBuilder implements Builder { + + private String _description; + private String _id; + private List _vdu; + private List _virtualLinkDesc; + private ElementGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ElementGroupBuilder() { + } + + public ElementGroupBuilder(ElementGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._description = base.getDescription(); + this._vdu = base.getVdu(); + this._virtualLinkDesc = base.getVirtualLinkDesc(); + } + + + public ElementGroupKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public List getVdu() { + return _vdu; + } + + public List getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ElementGroupBuilder withKey(final ElementGroupKey key) { + this.key = key; + return this; + } + + public ElementGroupBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public ElementGroupBuilder setId(final String value) { + this._id = value; + return this; + } + public ElementGroupBuilder setVdu(final List values) { + this._vdu = values; + return this; + } + + public ElementGroupBuilder setVirtualLinkDesc(final List values) { + this._virtualLinkDesc = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ElementGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ElementGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ElementGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ElementGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ElementGroup build() { + return new ElementGroupImpl(this); + } + + private static final class ElementGroupImpl + extends AbstractAugmentable + implements ElementGroup { + + private final String _description; + private final String _id; + private final List _vdu; + private final List _virtualLinkDesc; + private final ElementGroupKey key; + + ElementGroupImpl(ElementGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ElementGroupKey(base.getId()); + } + this._id = key.getId(); + this._description = base.getDescription(); + this._vdu = base.getVdu(); + this._virtualLinkDesc = base.getVirtualLinkDesc(); + } + + @Override + public ElementGroupKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public List getVdu() { + return _vdu; + } + + @Override + public List getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_vdu); + result = prime * result + Objects.hashCode(_virtualLinkDesc); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ElementGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ElementGroup other = (ElementGroup)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_vdu, other.getVdu())) { + return false; + } + if (!Objects.equals(_virtualLinkDesc, other.getVirtualLinkDesc())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ElementGroupImpl otherImpl = (ElementGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ElementGroup"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_vdu", _vdu); + CodeHelpers.appendValue(helper, "_virtualLinkDesc", _virtualLinkDesc); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupKey.java new file mode 100644 index 0000000..8fce703 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ElementGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ElementGroupKey + implements Identifier { + private static final long serialVersionUID = 5183248186865619279L; + private final String _id; + + + public ElementGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ElementGroupKey(ElementGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ElementGroupKey)) { + return false; + } + final ElementGroupKey other = (ElementGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ElementGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpd.java new file mode 100644 index 0000000..eaf1c41 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpd.java @@ -0,0 +1,123 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.CpConnection; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes an external interface exposed by this VNF enabling connection with a + * Virual Link + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list ext-cpd {
+ *   key id;
+ *   min-elements 1;
+ *   choice cp-connection {
+ *     case int-virtual-link-desc {
+ *       leaf int-virtual-link-desc {
+ *         type leafref {
+ *           path ../../int-virtual-link-desc/id;
+ *         }
+ *       }
+ *     }
+ *     case int-cpd {
+ *       container int-cpd {
+ *         leaf vdu-id {
+ *           type leafref {
+ *             path ../../../vdu/id;
+ *           }
+ *         }
+ *         leaf cpd {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     case k8s-cluster-net {
+ *       leaf k8s-cluster-net {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   uses virtual-network-interface-requirements;
+ *   leaf nicio-requirements {
+ *     type leafref {
+ *       path ../../virtual-compute-desc/id;
+ *     }
+ *   }
+ *   uses cpd;
+ *   leaf security-group-rule-id {
+ *     type leafref {
+ *       path ../../security-group-rule/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/ext-cpd + * + *

To create instances of this class use {@link ExtCpdBuilder}. + * @see ExtCpdBuilder + * @see ExtCpdKey + * + */ +public interface ExtCpd + extends + ChildOf, + Augmentable, + VirtualNetworkInterfaceRequirements, + Cpd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ext-cpd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.CpConnection cpConnection, or null if not present + */ + @Nullable CpConnection getCpConnection(); + + /** + * This references (couples) the CPD with any logical node I/O requirements (for + * network devices) that may have been created. Linking these attributes is + * necessary so that so that I/O requirements that need to be articulated at the + * logical node level can be associated with the network interface requirements + * associated with the CPD. + * + * + * + * @return java.lang.String nicioRequirements, or null if not present + */ + @Nullable String getNicioRequirements(); + + /** + * Reference of the security group rules bound to this CPD. + * + * + * + * @return java.lang.String securityGroupRuleId, or null if not present + */ + @Nullable String getSecurityGroupRuleId(); + + @Override + ExtCpdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdBuilder.java new file mode 100644 index 0000000..2c51e46 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdBuilder.java @@ -0,0 +1,536 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.CpRole; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.ProtocolKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirementKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.CpConnection; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ExtCpdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ExtCpdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ExtCpdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ExtCpdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ExtCpdBuilder + * @see Builder + * + */ +public class ExtCpdBuilder implements Builder { + + private CpConnection _cpConnection; + private String _description; + private String _id; + private List> _layerProtocol; + private String _nicioRequirements; + private Map _protocol; + private Class _role; + private String _securityGroupRuleId; + private Map _virtualNetworkInterfaceRequirement; + private Boolean _trunkMode; + private ExtCpdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ExtCpdBuilder() { + } + public ExtCpdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements arg) { + this._virtualNetworkInterfaceRequirement = arg.getVirtualNetworkInterfaceRequirement(); + } + public ExtCpdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd arg) { + this._id = arg.getId(); + this._layerProtocol = arg.getLayerProtocol(); + this._role = arg.getRole(); + this._description = arg.getDescription(); + this._protocol = arg.getProtocol(); + this._trunkMode = arg.isTrunkMode(); + } + + public ExtCpdBuilder(ExtCpd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._cpConnection = base.getCpConnection(); + this._description = base.getDescription(); + this._layerProtocol = base.getLayerProtocol(); + this._nicioRequirements = base.getNicioRequirements(); + this._protocol = base.getProtocol(); + this._role = base.getRole(); + this._securityGroupRuleId = base.getSecurityGroupRuleId(); + this._virtualNetworkInterfaceRequirement = base.getVirtualNetworkInterfaceRequirement(); + this._trunkMode = base.isTrunkMode(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements) { + this._virtualNetworkInterfaceRequirement = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements)arg).getVirtualNetworkInterfaceRequirement(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getId(); + this._layerProtocol = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getLayerProtocol(); + this._role = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getRole(); + this._description = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getDescription(); + this._protocol = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getProtocol(); + this._trunkMode = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).isTrunkMode(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd]"); + } + + public ExtCpdKey key() { + return key; + } + + public CpConnection getCpConnection() { + return _cpConnection; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public List> getLayerProtocol() { + return _layerProtocol; + } + + public String getNicioRequirements() { + return _nicioRequirements; + } + + public Map getProtocol() { + return _protocol; + } + + public Class getRole() { + return _role; + } + + public String getSecurityGroupRuleId() { + return _securityGroupRuleId; + } + + public Map getVirtualNetworkInterfaceRequirement() { + return _virtualNetworkInterfaceRequirement; + } + + public Boolean isTrunkMode() { + return _trunkMode; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ExtCpdBuilder withKey(final ExtCpdKey key) { + this.key = key; + return this; + } + + public ExtCpdBuilder setCpConnection(final CpConnection value) { + this._cpConnection = value; + return this; + } + + public ExtCpdBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public ExtCpdBuilder setId(final String value) { + this._id = value; + return this; + } + public ExtCpdBuilder setLayerProtocol(final List> values) { + this._layerProtocol = values; + return this; + } + + + public ExtCpdBuilder setNicioRequirements(final String value) { + this._nicioRequirements = value; + return this; + } + public ExtCpdBuilder setProtocol(final Map values) { + this._protocol = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setProtocol(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ExtCpdBuilder setProtocol(final List values) { + return setProtocol(CodeHelpers.compatMap(values)); + } + + public ExtCpdBuilder setRole(final Class value) { + this._role = value; + return this; + } + + public ExtCpdBuilder setSecurityGroupRuleId(final String value) { + this._securityGroupRuleId = value; + return this; + } + public ExtCpdBuilder setVirtualNetworkInterfaceRequirement(final Map values) { + this._virtualNetworkInterfaceRequirement = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualNetworkInterfaceRequirement(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ExtCpdBuilder setVirtualNetworkInterfaceRequirement(final List values) { + return setVirtualNetworkInterfaceRequirement(CodeHelpers.compatMap(values)); + } + + public ExtCpdBuilder setTrunkMode(final Boolean value) { + this._trunkMode = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ExtCpdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ExtCpdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ExtCpdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ExtCpdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ExtCpd build() { + return new ExtCpdImpl(this); + } + + private static final class ExtCpdImpl + extends AbstractAugmentable + implements ExtCpd { + + private final CpConnection _cpConnection; + private final String _description; + private final String _id; + private final List> _layerProtocol; + private final String _nicioRequirements; + private final Map _protocol; + private final Class _role; + private final String _securityGroupRuleId; + private final Map _virtualNetworkInterfaceRequirement; + private final Boolean _trunkMode; + private final ExtCpdKey key; + + ExtCpdImpl(ExtCpdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ExtCpdKey(base.getId()); + } + this._id = key.getId(); + this._cpConnection = base.getCpConnection(); + this._description = base.getDescription(); + this._layerProtocol = base.getLayerProtocol(); + this._nicioRequirements = base.getNicioRequirements(); + this._protocol = CodeHelpers.emptyToNull(base.getProtocol()); + this._role = base.getRole(); + this._securityGroupRuleId = base.getSecurityGroupRuleId(); + this._virtualNetworkInterfaceRequirement = CodeHelpers.emptyToNull(base.getVirtualNetworkInterfaceRequirement()); + this._trunkMode = base.isTrunkMode(); + } + + @Override + public ExtCpdKey key() { + return key; + } + + @Override + public CpConnection getCpConnection() { + return _cpConnection; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public List> getLayerProtocol() { + return _layerProtocol; + } + + @Override + public String getNicioRequirements() { + return _nicioRequirements; + } + + @Override + public Map getProtocol() { + return _protocol; + } + + @Override + public Class getRole() { + return _role; + } + + @Override + public String getSecurityGroupRuleId() { + return _securityGroupRuleId; + } + + @Override + public Map getVirtualNetworkInterfaceRequirement() { + return _virtualNetworkInterfaceRequirement; + } + + @Override + public Boolean isTrunkMode() { + return _trunkMode; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpConnection); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_layerProtocol); + result = prime * result + Objects.hashCode(_nicioRequirements); + result = prime * result + Objects.hashCode(_protocol); + result = prime * result + Objects.hashCode(_role); + result = prime * result + Objects.hashCode(_securityGroupRuleId); + result = prime * result + Objects.hashCode(_virtualNetworkInterfaceRequirement); + result = prime * result + Objects.hashCode(_trunkMode); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ExtCpd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ExtCpd other = (ExtCpd)obj; + if (!Objects.equals(_cpConnection, other.getCpConnection())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_layerProtocol, other.getLayerProtocol())) { + return false; + } + if (!Objects.equals(_nicioRequirements, other.getNicioRequirements())) { + return false; + } + if (!Objects.equals(_protocol, other.getProtocol())) { + return false; + } + if (!Objects.equals(_role, other.getRole())) { + return false; + } + if (!Objects.equals(_securityGroupRuleId, other.getSecurityGroupRuleId())) { + return false; + } + if (!Objects.equals(_virtualNetworkInterfaceRequirement, other.getVirtualNetworkInterfaceRequirement())) { + return false; + } + if (!Objects.equals(_trunkMode, other.isTrunkMode())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ExtCpdImpl otherImpl = (ExtCpdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ExtCpd"); + CodeHelpers.appendValue(helper, "_cpConnection", _cpConnection); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_layerProtocol", _layerProtocol); + CodeHelpers.appendValue(helper, "_nicioRequirements", _nicioRequirements); + CodeHelpers.appendValue(helper, "_protocol", _protocol); + CodeHelpers.appendValue(helper, "_role", _role); + CodeHelpers.appendValue(helper, "_securityGroupRuleId", _securityGroupRuleId); + CodeHelpers.appendValue(helper, "_virtualNetworkInterfaceRequirement", _virtualNetworkInterfaceRequirement); + CodeHelpers.appendValue(helper, "_trunkMode", _trunkMode); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdKey.java new file mode 100644 index 0000000..f0c2cd6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ExtCpdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ExtCpdKey + implements Identifier { + private static final long serialVersionUID = -7160822752734312733L; + private final String _id; + + + public ExtCpdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ExtCpdKey(ExtCpdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ExtCpdKey)) { + return false; + } + final ExtCpdKey other = (ExtCpdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ExtCpdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Indicator.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Indicator.java new file mode 100644 index 0000000..aa791a8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Indicator.java @@ -0,0 +1,174 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Declares the VNF indicators that are supported by this VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list indicator {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf-list indicator-value {
+ *     type string;
+ *   }
+ *   leaf source {
+ *     type enumeration {
+ *       enum vnf;
+ *       enum em;
+ *       enum both;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/indicator + * + *

To create instances of this class use {@link IndicatorBuilder}. + * @see IndicatorBuilder + * @see IndicatorKey + * + */ +public interface Indicator + extends + ChildOf, + Augmentable, + Identifiable +{ + + + public enum Source implements Enumeration { + Vnf(0, "vnf"), + + Em(1, "em"), + + Both(2, "both") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Source enumItem : Source.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Source(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Source item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Source item, or null if no such item exists + */ + public static Source forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("indicator"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator.class; + } + + /** + * Unique identifier + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The human readable name of the VnfIndicator. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Defines the allowed values or value ranges of this indicator. + * + * + * + * @return java.util.List indicatorValue, or null if not present + */ + @Nullable List getIndicatorValue(); + + /** + * Describe the source of the indicator. The possible values are: • VNF. • EM. • + * Both. This tells the consumer where to send the subscription request. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator.Source source, or null if not present + */ + @Nullable Source getSource(); + + @Override + IndicatorKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorBuilder.java new file mode 100644 index 0000000..723f22e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorBuilder.java @@ -0,0 +1,318 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link IndicatorBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     IndicatorBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new IndicatorBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of IndicatorBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see IndicatorBuilder + * @see Builder + * + */ +public class IndicatorBuilder implements Builder { + + private String _id; + private List _indicatorValue; + private String _name; + private Indicator.Source _source; + private IndicatorKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public IndicatorBuilder() { + } + + public IndicatorBuilder(Indicator base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._indicatorValue = base.getIndicatorValue(); + this._name = base.getName(); + this._source = base.getSource(); + } + + + public IndicatorKey key() { + return key; + } + + public String getId() { + return _id; + } + + public List getIndicatorValue() { + return _indicatorValue; + } + + public String getName() { + return _name; + } + + public Indicator.Source getSource() { + return _source; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public IndicatorBuilder withKey(final IndicatorKey key) { + this.key = key; + return this; + } + + public IndicatorBuilder setId(final String value) { + this._id = value; + return this; + } + public IndicatorBuilder setIndicatorValue(final List values) { + this._indicatorValue = values; + return this; + } + + + public IndicatorBuilder setName(final String value) { + this._name = value; + return this; + } + + public IndicatorBuilder setSource(final Indicator.Source value) { + this._source = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public IndicatorBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public IndicatorBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public IndicatorBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private IndicatorBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Indicator build() { + return new IndicatorImpl(this); + } + + private static final class IndicatorImpl + extends AbstractAugmentable + implements Indicator { + + private final String _id; + private final List _indicatorValue; + private final String _name; + private final Indicator.Source _source; + private final IndicatorKey key; + + IndicatorImpl(IndicatorBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new IndicatorKey(base.getId()); + } + this._id = key.getId(); + this._indicatorValue = base.getIndicatorValue(); + this._name = base.getName(); + this._source = base.getSource(); + } + + @Override + public IndicatorKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public List getIndicatorValue() { + return _indicatorValue; + } + + @Override + public String getName() { + return _name; + } + + @Override + public Indicator.Source getSource() { + return _source; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_indicatorValue); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_source); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Indicator.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Indicator other = (Indicator)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_indicatorValue, other.getIndicatorValue())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_source, other.getSource())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + IndicatorImpl otherImpl = (IndicatorImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Indicator"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_indicatorValue", _indicatorValue); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_source", _source); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorKey.java new file mode 100644 index 0000000..b48332e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IndicatorKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class IndicatorKey + implements Identifier { + private static final long serialVersionUID = 2687907149552019284L; + private final String _id; + + + public IndicatorKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public IndicatorKey(IndicatorKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof IndicatorKey)) { + return false; + } + final IndicatorKey other = (IndicatorKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(IndicatorKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDesc.java new file mode 100644 index 0000000..b4c1411 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDesc.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.Flavour; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.FlavourKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.MonitoringParameters; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.MonitoringParametersKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Represents the type of network connectivity mandated by the VNF provider + * two or more CPs which includes at least one internal CP. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list int-virtual-link-desc {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   list flavour {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     container qos {
+ *       presence "VL QoS parameters";
+ *       leaf latency {
+ *         type uint32;
+ *         units ms;
+ *       }
+ *       leaf packet-delay-variation {
+ *         type uint32;
+ *         units ms;
+ *       }
+ *       leaf packet-loss-ratio {
+ *         type decimal64 {
+ *           fraction-digits 2;
+ *           range 0..1.00;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   uses connectivity-type;
+ *   leaf-list test-access {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list monitoring-parameters {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     uses monitoring-parameter;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/int-virtual-link-desc + * + *

To create instances of this class use {@link IntVirtualLinkDescBuilder}. + * @see IntVirtualLinkDescBuilder + * @see IntVirtualLinkDescKey + * + */ +public interface IntVirtualLinkDesc + extends + ChildOf, + Augmentable, + ConnectivityType, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("int-virtual-link-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc.class; + } + + /** + * Unique identifier of this internal VLD in VNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Describes a specific flavour of the VL with specific bitrate requirements. + * + * + * + * @return java.util.Map flavour, or null if not present + */ + @Nullable Map getFlavour(); + + /** + * @return java.util.Map flavour, or an empty list if it is not present + */ + default @NonNull Map nonnullFlavour() { + return CodeHelpers.nonnull(getFlavour()); + } + + /** + * Specifies test access facilities expected on the VL (e.g. none, passive + * monitoring, or active (intrusive) loopbacks at endpoints. + * + * + * + * @return java.util.List testAccess, or null if not present + */ + @Nullable List getTestAccess(); + + /** + * Provides human-readable information on the purpose of the VL (e.g. control plane + * traffic). + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * @return java.util.Map monitoringParameters, or null if not present + */ + @Nullable Map getMonitoringParameters(); + + /** + * @return java.util.Map monitoringParameters, or an empty list if it is not present + */ + default @NonNull Map nonnullMonitoringParameters() { + return CodeHelpers.nonnull(getMonitoringParameters()); + } + + @Override + IntVirtualLinkDescKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescBuilder.java new file mode 100644 index 0000000..effaa68 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescBuilder.java @@ -0,0 +1,423 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.ConnectivityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.Flavour; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.FlavourKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.MonitoringParameters; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.MonitoringParametersKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link IntVirtualLinkDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     IntVirtualLinkDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new IntVirtualLinkDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of IntVirtualLinkDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see IntVirtualLinkDescBuilder + * @see Builder + * + */ +public class IntVirtualLinkDescBuilder implements Builder { + + private ConnectivityType _connectivityType; + private String _description; + private Map _flavour; + private String _id; + private Map _monitoringParameters; + private List _testAccess; + private IntVirtualLinkDescKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public IntVirtualLinkDescBuilder() { + } + public IntVirtualLinkDescBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType arg) { + this._connectivityType = arg.getConnectivityType(); + } + + public IntVirtualLinkDescBuilder(IntVirtualLinkDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._connectivityType = base.getConnectivityType(); + this._description = base.getDescription(); + this._flavour = base.getFlavour(); + this._monitoringParameters = base.getMonitoringParameters(); + this._testAccess = base.getTestAccess(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType) { + this._connectivityType = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType)arg).getConnectivityType(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType]"); + } + + public IntVirtualLinkDescKey key() { + return key; + } + + public ConnectivityType getConnectivityType() { + return _connectivityType; + } + + public String getDescription() { + return _description; + } + + public Map getFlavour() { + return _flavour; + } + + public String getId() { + return _id; + } + + public Map getMonitoringParameters() { + return _monitoringParameters; + } + + public List getTestAccess() { + return _testAccess; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public IntVirtualLinkDescBuilder withKey(final IntVirtualLinkDescKey key) { + this.key = key; + return this; + } + + public IntVirtualLinkDescBuilder setConnectivityType(final ConnectivityType value) { + this._connectivityType = value; + return this; + } + + public IntVirtualLinkDescBuilder setDescription(final String value) { + this._description = value; + return this; + } + public IntVirtualLinkDescBuilder setFlavour(final Map values) { + this._flavour = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setFlavour(Map)} instead. + */ + @Deprecated(forRemoval = true) + public IntVirtualLinkDescBuilder setFlavour(final List values) { + return setFlavour(CodeHelpers.compatMap(values)); + } + + public IntVirtualLinkDescBuilder setId(final String value) { + this._id = value; + return this; + } + public IntVirtualLinkDescBuilder setMonitoringParameters(final Map values) { + this._monitoringParameters = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setMonitoringParameters(Map)} instead. + */ + @Deprecated(forRemoval = true) + public IntVirtualLinkDescBuilder setMonitoringParameters(final List values) { + return setMonitoringParameters(CodeHelpers.compatMap(values)); + } + public IntVirtualLinkDescBuilder setTestAccess(final List values) { + this._testAccess = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public IntVirtualLinkDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public IntVirtualLinkDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public IntVirtualLinkDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private IntVirtualLinkDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public IntVirtualLinkDesc build() { + return new IntVirtualLinkDescImpl(this); + } + + private static final class IntVirtualLinkDescImpl + extends AbstractAugmentable + implements IntVirtualLinkDesc { + + private final ConnectivityType _connectivityType; + private final String _description; + private final Map _flavour; + private final String _id; + private final Map _monitoringParameters; + private final List _testAccess; + private final IntVirtualLinkDescKey key; + + IntVirtualLinkDescImpl(IntVirtualLinkDescBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new IntVirtualLinkDescKey(base.getId()); + } + this._id = key.getId(); + this._connectivityType = base.getConnectivityType(); + this._description = base.getDescription(); + this._flavour = CodeHelpers.emptyToNull(base.getFlavour()); + this._monitoringParameters = CodeHelpers.emptyToNull(base.getMonitoringParameters()); + this._testAccess = base.getTestAccess(); + } + + @Override + public IntVirtualLinkDescKey key() { + return key; + } + + @Override + public ConnectivityType getConnectivityType() { + return _connectivityType; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public Map getFlavour() { + return _flavour; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getMonitoringParameters() { + return _monitoringParameters; + } + + @Override + public List getTestAccess() { + return _testAccess; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_connectivityType); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_flavour); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_monitoringParameters); + result = prime * result + Objects.hashCode(_testAccess); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!IntVirtualLinkDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + IntVirtualLinkDesc other = (IntVirtualLinkDesc)obj; + if (!Objects.equals(_connectivityType, other.getConnectivityType())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_flavour, other.getFlavour())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_monitoringParameters, other.getMonitoringParameters())) { + return false; + } + if (!Objects.equals(_testAccess, other.getTestAccess())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + IntVirtualLinkDescImpl otherImpl = (IntVirtualLinkDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("IntVirtualLinkDesc"); + CodeHelpers.appendValue(helper, "_connectivityType", _connectivityType); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_flavour", _flavour); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_monitoringParameters", _monitoringParameters); + CodeHelpers.appendValue(helper, "_testAccess", _testAccess); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescKey.java new file mode 100644 index 0000000..5b6d8c1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/IntVirtualLinkDescKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class IntVirtualLinkDescKey + implements Identifier { + private static final long serialVersionUID = 375821421458981131L; + private final String _id; + + + public IntVirtualLinkDescKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public IntVirtualLinkDescKey(IntVirtualLinkDescKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof IntVirtualLinkDescKey)) { + return false; + } + final IntVirtualLinkDescKey other = (IntVirtualLinkDescKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(IntVirtualLinkDescKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScript.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScript.java new file mode 100644 index 0000000..35d11a3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScript.java @@ -0,0 +1,149 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.InternalLifecycleManagementScriptEvent; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script.ScriptInput; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script.ScriptInputKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Includes a list of events and corresponding management scripts performed for + * VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list lifecycle-management-script {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf-list event {
+ *     type internal-lifecycle-management-script-event;
+ *   }
+ *   leaf-list lcm-transition-event {
+ *     type string;
+ *   }
+ *   leaf script {
+ *     type string;
+ *   }
+ *   leaf script-dsl {
+ *     type string;
+ *   }
+ *   list script-input {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/lifecycle-management-script + * + *

To create instances of this class use {@link LifecycleManagementScriptBuilder}. + * @see LifecycleManagementScriptBuilder + * @see LifecycleManagementScriptKey + * + */ +public interface LifecycleManagementScript + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("lifecycle-management-script"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript.class; + } + + /** + * A unique string that identfies the script in question. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Describes VNF lifecycle event(s) or an external stimulus detected on a VNFM + * reference point. + * + * + * + * @return java.util.List event, or null if not present + */ + @Nullable List getEvent(); + + /** + * Describes the transition VNF lifecycle event(s) that cannot be mapped to any of + * the enumerated values defined for the event attribute. + * + * + * + * @return java.util.List lcmTransitionEvent, or null if not present + */ + @Nullable List getLcmTransitionEvent(); + + /** + * Includes a VNF LCM script (e.g. written in a DSL as specified in requirement + * VNF_PACK.LCM.001) triggered to react to one of the events listed in the event + * attribute. + * + * + * + * @return java.lang.String script, or null if not present + */ + @Nullable String getScript(); + + /** + * Defines the domain specific language (i.e. the type) of script that is provided. + * Types of scripts could include bash, python, etc. + * + * + * + * @return java.lang.String scriptDsl, or null if not present + */ + @Nullable String getScriptDsl(); + + /** + * Array of KVP requirements with the key as the parameter name and the value as + * the parameter that need to be passed as an input to the script. + * + * + * + * @return java.util.Map scriptInput, or null if not present + */ + @Nullable Map getScriptInput(); + + /** + * @return java.util.Map scriptInput, or an empty list if it is not present + */ + default @NonNull Map nonnullScriptInput() { + return CodeHelpers.nonnull(getScriptInput()); + } + + @Override + LifecycleManagementScriptKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptBuilder.java new file mode 100644 index 0000000..c283b8b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptBuilder.java @@ -0,0 +1,384 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.InternalLifecycleManagementScriptEvent; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script.ScriptInput; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script.ScriptInputKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link LifecycleManagementScriptBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     LifecycleManagementScriptBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new LifecycleManagementScriptBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of LifecycleManagementScriptBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see LifecycleManagementScriptBuilder + * @see Builder + * + */ +public class LifecycleManagementScriptBuilder implements Builder { + + private List _event; + private String _id; + private List _lcmTransitionEvent; + private String _script; + private String _scriptDsl; + private Map _scriptInput; + private LifecycleManagementScriptKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public LifecycleManagementScriptBuilder() { + } + + public LifecycleManagementScriptBuilder(LifecycleManagementScript base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._event = base.getEvent(); + this._lcmTransitionEvent = base.getLcmTransitionEvent(); + this._script = base.getScript(); + this._scriptDsl = base.getScriptDsl(); + this._scriptInput = base.getScriptInput(); + } + + + public LifecycleManagementScriptKey key() { + return key; + } + + public List getEvent() { + return _event; + } + + public String getId() { + return _id; + } + + public List getLcmTransitionEvent() { + return _lcmTransitionEvent; + } + + public String getScript() { + return _script; + } + + public String getScriptDsl() { + return _scriptDsl; + } + + public Map getScriptInput() { + return _scriptInput; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public LifecycleManagementScriptBuilder withKey(final LifecycleManagementScriptKey key) { + this.key = key; + return this; + } + public LifecycleManagementScriptBuilder setEvent(final List values) { + this._event = values; + return this; + } + + + public LifecycleManagementScriptBuilder setId(final String value) { + this._id = value; + return this; + } + public LifecycleManagementScriptBuilder setLcmTransitionEvent(final List values) { + this._lcmTransitionEvent = values; + return this; + } + + + public LifecycleManagementScriptBuilder setScript(final String value) { + this._script = value; + return this; + } + + public LifecycleManagementScriptBuilder setScriptDsl(final String value) { + this._scriptDsl = value; + return this; + } + public LifecycleManagementScriptBuilder setScriptInput(final Map values) { + this._scriptInput = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setScriptInput(Map)} instead. + */ + @Deprecated(forRemoval = true) + public LifecycleManagementScriptBuilder setScriptInput(final List values) { + return setScriptInput(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public LifecycleManagementScriptBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public LifecycleManagementScriptBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public LifecycleManagementScriptBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private LifecycleManagementScriptBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public LifecycleManagementScript build() { + return new LifecycleManagementScriptImpl(this); + } + + private static final class LifecycleManagementScriptImpl + extends AbstractAugmentable + implements LifecycleManagementScript { + + private final List _event; + private final String _id; + private final List _lcmTransitionEvent; + private final String _script; + private final String _scriptDsl; + private final Map _scriptInput; + private final LifecycleManagementScriptKey key; + + LifecycleManagementScriptImpl(LifecycleManagementScriptBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new LifecycleManagementScriptKey(base.getId()); + } + this._id = key.getId(); + this._event = base.getEvent(); + this._lcmTransitionEvent = base.getLcmTransitionEvent(); + this._script = base.getScript(); + this._scriptDsl = base.getScriptDsl(); + this._scriptInput = CodeHelpers.emptyToNull(base.getScriptInput()); + } + + @Override + public LifecycleManagementScriptKey key() { + return key; + } + + @Override + public List getEvent() { + return _event; + } + + @Override + public String getId() { + return _id; + } + + @Override + public List getLcmTransitionEvent() { + return _lcmTransitionEvent; + } + + @Override + public String getScript() { + return _script; + } + + @Override + public String getScriptDsl() { + return _scriptDsl; + } + + @Override + public Map getScriptInput() { + return _scriptInput; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_event); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_lcmTransitionEvent); + result = prime * result + Objects.hashCode(_script); + result = prime * result + Objects.hashCode(_scriptDsl); + result = prime * result + Objects.hashCode(_scriptInput); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!LifecycleManagementScript.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + LifecycleManagementScript other = (LifecycleManagementScript)obj; + if (!Objects.equals(_event, other.getEvent())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_lcmTransitionEvent, other.getLcmTransitionEvent())) { + return false; + } + if (!Objects.equals(_script, other.getScript())) { + return false; + } + if (!Objects.equals(_scriptDsl, other.getScriptDsl())) { + return false; + } + if (!Objects.equals(_scriptInput, other.getScriptInput())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + LifecycleManagementScriptImpl otherImpl = (LifecycleManagementScriptImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LifecycleManagementScript"); + CodeHelpers.appendValue(helper, "_event", _event); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_lcmTransitionEvent", _lcmTransitionEvent); + CodeHelpers.appendValue(helper, "_script", _script); + CodeHelpers.appendValue(helper, "_scriptDsl", _scriptDsl); + CodeHelpers.appendValue(helper, "_scriptInput", _scriptInput); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptKey.java new file mode 100644 index 0000000..7879329 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/LifecycleManagementScriptKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class LifecycleManagementScriptKey + implements Identifier { + private static final long serialVersionUID = 4840233266810285534L; + private final String _id; + + + public LifecycleManagementScriptKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public LifecycleManagementScriptKey(LifecycleManagementScriptKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LifecycleManagementScriptKey)) { + return false; + } + final LifecycleManagementScriptKey other = (LifecycleManagementScriptKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(LifecycleManagementScriptKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributes.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributes.java new file mode 100644 index 0000000..7b0ce04 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributes.java @@ -0,0 +1,84 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the modifiable attributes of the VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container modifiable-attributes {
+ *   leaf-list extension {
+ *     type string;
+ *   }
+ *   leaf-list metadata {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/modifiable-attributes + * + *

To create instances of this class use {@link ModifiableAttributesBuilder}. + * @see ModifiableAttributesBuilder + * + */ +public interface ModifiableAttributes + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("modifiable-attributes"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes.class; + } + + /** + * Additional VNF-specific attributes of VnfInfo that affect the lifecycle + * management of a VNF instance and that are writeable. For each VNF instance, + * these attributes are stored persistently by the VNFM and can be queried and + * modified through the VNFM. These attributes are intended to be consumed by the + * VNFM or by the lifecycle management scripts during the execution of VNF + * lifecycle management operations. Modifying these values has no direct effect on + * the VNF instance; however, modified values can be considered during subsequent + * VNF lifecycle management operations, which means that the modified values can + * indirectly affect the configuration of the VNF instance. + * + * + * + * @return java.util.List extension, or null if not present + */ + @Nullable List getExtension(); + + /** + * Additional VNF-specific attributes of VnfInfo that are writeable and that + * provide metadata describing the VNF instance. For each VNF instance, these + * attributes are stored persistently by the VNFM and can be queried and modified + * through the VNFM. These attributes are intended to provide information to + * functional blocks external to the VNFM and will not be used by the VNFM or the + * VNF lifecycle management scripts when executing lifecycle management operations. + * Modifying these attributes has no effect on the VNF instance. It only affects + * the attribute values stored by the VNFM. + * + * + * + * @return java.util.List metadata, or null if not present + */ + @Nullable List getMetadata(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributesBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributesBuilder.java new file mode 100644 index 0000000..bf9d4e5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ModifiableAttributesBuilder.java @@ -0,0 +1,251 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ModifiableAttributesBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ModifiableAttributesBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ModifiableAttributesBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ModifiableAttributesBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ModifiableAttributesBuilder + * @see Builder + * + */ +public class ModifiableAttributesBuilder implements Builder { + + private List _extension; + private List _metadata; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ModifiableAttributesBuilder() { + } + + public ModifiableAttributesBuilder(ModifiableAttributes base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._extension = base.getExtension(); + this._metadata = base.getMetadata(); + } + + + public List getExtension() { + return _extension; + } + + public List getMetadata() { + return _metadata; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ModifiableAttributesBuilder setExtension(final List values) { + this._extension = values; + return this; + } + + public ModifiableAttributesBuilder setMetadata(final List values) { + this._metadata = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ModifiableAttributesBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ModifiableAttributesBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ModifiableAttributesBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ModifiableAttributesBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ModifiableAttributes build() { + return new ModifiableAttributesImpl(this); + } + + private static final class ModifiableAttributesImpl + extends AbstractAugmentable + implements ModifiableAttributes { + + private final List _extension; + private final List _metadata; + + ModifiableAttributesImpl(ModifiableAttributesBuilder base) { + super(base.augmentation); + this._extension = base.getExtension(); + this._metadata = base.getMetadata(); + } + + @Override + public List getExtension() { + return _extension; + } + + @Override + public List getMetadata() { + return _metadata; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extension); + result = prime * result + Objects.hashCode(_metadata); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ModifiableAttributes.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ModifiableAttributes other = (ModifiableAttributes)obj; + if (!Objects.equals(_extension, other.getExtension())) { + return false; + } + if (!Objects.equals(_metadata, other.getMetadata())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ModifiableAttributesImpl otherImpl = (ModifiableAttributesImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ModifiableAttributes"); + CodeHelpers.appendValue(helper, "_extension", _extension); + CodeHelpers.appendValue(helper, "_metadata", _metadata); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDesc.java new file mode 100644 index 0000000..eedb261 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDesc.java @@ -0,0 +1,487 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.sw.image.desc.Checksum; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Defines descriptors of software images to be used by the VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list sw-image-desc {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf version {
+ *     type string;
+ *   }
+ *   container checksum {
+ *     leaf algorithm {
+ *       type identityref {
+ *         base checksum-algorithm;
+ *       }
+ *     }
+ *     leaf hash {
+ *       type string;
+ *     }
+ *   }
+ *   leaf container-format {
+ *     default bare;
+ *     type enumeration {
+ *       enum aki {
+ *       }
+ *       enum ami {
+ *       }
+ *       enum ari {
+ *       }
+ *       enum bare {
+ *       }
+ *       enum docker {
+ *       }
+ *       enum ova {
+ *       }
+ *       enum ovf {
+ *       }
+ *     }
+ *   }
+ *   leaf disk-format {
+ *     default qcow2;
+ *     type enumeration {
+ *       enum aki {
+ *       }
+ *       enum ami {
+ *       }
+ *       enum ari {
+ *       }
+ *       enum iso {
+ *       }
+ *       enum qcow2 {
+ *       }
+ *       enum raw {
+ *       }
+ *       enum vdi {
+ *       }
+ *       enum vhd {
+ *       }
+ *       enum vhdx {
+ *       }
+ *       enum vmdk {
+ *       }
+ *     }
+ *   }
+ *   leaf min-disk {
+ *     type uint64;
+ *     units GB;
+ *   }
+ *   leaf min-ram {
+ *     type decimal64 {
+ *       fraction-digits 1;
+ *       range 0..max;
+ *     }
+ *     units GB;
+ *     default 0;
+ *   }
+ *   leaf size {
+ *     type uint64;
+ *     units GB;
+ *   }
+ *   leaf image {
+ *     default .;
+ *     type inet:uri;
+ *   }
+ *   leaf operating-system {
+ *     type string;
+ *   }
+ *   leaf-list supported-virtualization-environment {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/sw-image-desc + * + *

To create instances of this class use {@link SwImageDescBuilder}. + * @see SwImageDescBuilder + * @see SwImageDescKey + * + */ +public interface SwImageDesc + extends + ChildOf, + Augmentable, + Identifiable +{ + + + public enum ContainerFormat implements Enumeration { + /** + * An Amazon kernel image. + * + */ + Aki(0, "aki"), + + /** + * An Amazon machine image. + * + */ + Ami(1, "ami"), + + /** + * An Amazon ramdisk image. + * + */ + Ari(2, "ari"), + + /** + * The image does not have a container or metadata envelope. + * + */ + Bare(3, "bare"), + + /** + * A docker container format. + * + */ + Docker(4, "docker"), + + /** + * An OVF package in a tarfile. + * + */ + Ova(5, "ova"), + + /** + * The OVF container format. + * + */ + Ovf(6, "ovf") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (ContainerFormat enumItem : ContainerFormat.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private ContainerFormat(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding ContainerFormat item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding ContainerFormat item, or null if no such item exists + */ + public static ContainerFormat forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public enum DiskFormat implements Enumeration { + /** + * An Amazon kernel image. + * + */ + Aki(0, "aki"), + + /** + * An Amazon machine image. + * + */ + Ami(1, "ami"), + + /** + * An Amazon ramdisk image. + * + */ + Ari(2, "ari"), + + /** + * An archive format for the data contents of an disk, such as CD-ROM. + * + */ + Iso(3, "iso"), + + /** + * Supported by the QEMU emulator that can expand dynamically and supports Copy on + * Write. + * + */ + Qcow2(4, "qcow2"), + + /** + * An unstructured disk image format; if you have a file without an extension it is + * possibly a raw format. + * + */ + Raw(5, "raw"), + + /** + * Supported by VirtualBox virtual machine monitor and the QEMU emulator. + * + */ + Vdi(6, "vdi"), + + /** + * The VHD disk format, a common disk format used by virtual machine monitors from + * VMware, Xen, Microsoft, VirtualBox, and others. + * + */ + Vhd(7, "vhd"), + + /** + * The VHDX disk format, an enhanced version of the VHD format, which supports + * larger disk sizes among other features. + * + */ + Vhdx(8, "vhdx"), + + /** + * Common disk format supported by many common virtual machine monitors. + * + */ + Vmdk(9, "vmdk") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (DiskFormat enumItem : DiskFormat.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private DiskFormat(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding DiskFormat item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding DiskFormat item, or null if no such item exists + */ + public static DiskFormat forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sw-image-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc.class; + } + + /** + * The identifier of this software image. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The name of this software image. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * The version of this software image. + * + * + * + * @return java.lang.String version, or null if not present + */ + @Nullable String getVersion(); + + /** + * The checksum of the software image file. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.sw.image.desc.Checksum checksum, or null if not present + */ + @Nullable Checksum getChecksum(); + + /** + * The container format describes the container file format in which software image + * is provided. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc.ContainerFormat containerFormat, or null if not present + */ + @Nullable ContainerFormat getContainerFormat(); + + /** + * The disk format of a software image is the format of the underlying disk image. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc.DiskFormat diskFormat, or null if not present + */ + @Nullable DiskFormat getDiskFormat(); + + /** + * The minimal disk size requirement for this software image. The value of the + * 'size of storage' attribute of the VirtualStorageDesc referencing this + * SwImageDesc shall not be smaller than the value of minDisk. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 minDisk, or null if not present + */ + @Nullable Uint64 getMinDisk(); + + /** + * The minimal RAM requirement for this software image. The value of the 'size' + * attribute of VirtualMemoryData of the Vdu referencing this SwImageDesc shall not + * be smaller than the value of minRam. + * + * + * + * @return java.math.BigDecimal minRam, or null if not present + */ + @Nullable BigDecimal getMinRam(); + + /** + * The size of this software image. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 size, or null if not present + */ + @Nullable Uint64 getSize(); + + /** + * This is a reference to the actual software image. The reference can be relative + * to the root of the VNF Package or can be a URL + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri image, or null if not present + */ + @Nullable Uri getImage(); + + /** + * Identifies the operating system used in the software image. This attribute may + * also identify if a 32 bit or 64 bit software image is used. + * + * + * + * @return java.lang.String operatingSystem, or null if not present + */ + @Nullable String getOperatingSystem(); + + /** + * Identifies the virtualisation environments (e.g. hypervisor) compatible with + * this software image. + * + * + * + * @return java.util.List supportedVirtualizationEnvironment, or null if not present + */ + @Nullable List getSupportedVirtualizationEnvironment(); + + @Override + SwImageDescKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescBuilder.java new file mode 100644 index 0000000..da0cae8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescBuilder.java @@ -0,0 +1,553 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Range; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.sw.image.desc.Checksum; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link SwImageDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SwImageDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SwImageDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SwImageDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SwImageDescBuilder + * @see Builder + * + */ +public class SwImageDescBuilder implements Builder { + + private Checksum _checksum; + private SwImageDesc.ContainerFormat _containerFormat; + private SwImageDesc.DiskFormat _diskFormat; + private String _id; + private Uri _image; + private Uint64 _minDisk; + private BigDecimal _minRam; + private String _name; + private String _operatingSystem; + private Uint64 _size; + private List _supportedVirtualizationEnvironment; + private String _version; + private SwImageDescKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SwImageDescBuilder() { + } + + public SwImageDescBuilder(SwImageDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._checksum = base.getChecksum(); + this._containerFormat = base.getContainerFormat(); + this._diskFormat = base.getDiskFormat(); + this._image = base.getImage(); + this._minDisk = base.getMinDisk(); + this._minRam = base.getMinRam(); + this._name = base.getName(); + this._operatingSystem = base.getOperatingSystem(); + this._size = base.getSize(); + this._supportedVirtualizationEnvironment = base.getSupportedVirtualizationEnvironment(); + this._version = base.getVersion(); + } + + + public SwImageDescKey key() { + return key; + } + + public Checksum getChecksum() { + return _checksum; + } + + public SwImageDesc.ContainerFormat getContainerFormat() { + return _containerFormat; + } + + public SwImageDesc.DiskFormat getDiskFormat() { + return _diskFormat; + } + + public String getId() { + return _id; + } + + public Uri getImage() { + return _image; + } + + public Uint64 getMinDisk() { + return _minDisk; + } + + public BigDecimal getMinRam() { + return _minRam; + } + + public String getName() { + return _name; + } + + public String getOperatingSystem() { + return _operatingSystem; + } + + public Uint64 getSize() { + return _size; + } + + public List getSupportedVirtualizationEnvironment() { + return _supportedVirtualizationEnvironment; + } + + public String getVersion() { + return _version; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public SwImageDescBuilder withKey(final SwImageDescKey key) { + this.key = key; + return this; + } + + public SwImageDescBuilder setChecksum(final Checksum value) { + this._checksum = value; + return this; + } + + public SwImageDescBuilder setContainerFormat(final SwImageDesc.ContainerFormat value) { + this._containerFormat = value; + return this; + } + + public SwImageDescBuilder setDiskFormat(final SwImageDesc.DiskFormat value) { + this._diskFormat = value; + return this; + } + + public SwImageDescBuilder setId(final String value) { + this._id = value; + return this; + } + + public SwImageDescBuilder setImage(final Uri value) { + this._image = value; + return this; + } + + public SwImageDescBuilder setMinDisk(final Uint64 value) { + this._minDisk = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMinDisk(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public SwImageDescBuilder setMinDisk(final BigInteger value) { + return setMinDisk(CodeHelpers.compatUint(value)); + } + + private static final Range[] CHECKMINRAMRANGE_RANGES; + static { + @SuppressWarnings("unchecked") + final Range[] a = (Range[]) Array.newInstance(Range.class, 1); + a[0] = Range.closed(java.math.BigDecimal.ZERO, new java.math.BigDecimal("922337203685477580.7")); + CHECKMINRAMRANGE_RANGES = a; + } + private static void checkMinRamRange(final java.math.BigDecimal value) { + for (Range r : CHECKMINRAMRANGE_RANGES) { + if (r.contains(value)) { + return; + } + } + CodeHelpers.throwInvalidRange(CHECKMINRAMRANGE_RANGES, value); + } + + public SwImageDescBuilder setMinRam(final BigDecimal value) { + if (value != null) { + checkMinRamRange(value); + + } + this._minRam = value; + return this; + } + + public SwImageDescBuilder setName(final String value) { + this._name = value; + return this; + } + + public SwImageDescBuilder setOperatingSystem(final String value) { + this._operatingSystem = value; + return this; + } + + public SwImageDescBuilder setSize(final Uint64 value) { + this._size = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setSize(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public SwImageDescBuilder setSize(final BigInteger value) { + return setSize(CodeHelpers.compatUint(value)); + } + public SwImageDescBuilder setSupportedVirtualizationEnvironment(final List values) { + this._supportedVirtualizationEnvironment = values; + return this; + } + + + public SwImageDescBuilder setVersion(final String value) { + this._version = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SwImageDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SwImageDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SwImageDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SwImageDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public SwImageDesc build() { + return new SwImageDescImpl(this); + } + + private static final class SwImageDescImpl + extends AbstractAugmentable + implements SwImageDesc { + + private final Checksum _checksum; + private final SwImageDesc.ContainerFormat _containerFormat; + private final SwImageDesc.DiskFormat _diskFormat; + private final String _id; + private final Uri _image; + private final Uint64 _minDisk; + private final BigDecimal _minRam; + private final String _name; + private final String _operatingSystem; + private final Uint64 _size; + private final List _supportedVirtualizationEnvironment; + private final String _version; + private final SwImageDescKey key; + + SwImageDescImpl(SwImageDescBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new SwImageDescKey(base.getId()); + } + this._id = key.getId(); + this._checksum = base.getChecksum(); + this._containerFormat = base.getContainerFormat(); + this._diskFormat = base.getDiskFormat(); + this._image = base.getImage(); + this._minDisk = base.getMinDisk(); + this._minRam = base.getMinRam(); + this._name = base.getName(); + this._operatingSystem = base.getOperatingSystem(); + this._size = base.getSize(); + this._supportedVirtualizationEnvironment = base.getSupportedVirtualizationEnvironment(); + this._version = base.getVersion(); + } + + @Override + public SwImageDescKey key() { + return key; + } + + @Override + public Checksum getChecksum() { + return _checksum; + } + + @Override + public SwImageDesc.ContainerFormat getContainerFormat() { + return _containerFormat; + } + + @Override + public SwImageDesc.DiskFormat getDiskFormat() { + return _diskFormat; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Uri getImage() { + return _image; + } + + @Override + public Uint64 getMinDisk() { + return _minDisk; + } + + @Override + public BigDecimal getMinRam() { + return _minRam; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getOperatingSystem() { + return _operatingSystem; + } + + @Override + public Uint64 getSize() { + return _size; + } + + @Override + public List getSupportedVirtualizationEnvironment() { + return _supportedVirtualizationEnvironment; + } + + @Override + public String getVersion() { + return _version; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_checksum); + result = prime * result + Objects.hashCode(_containerFormat); + result = prime * result + Objects.hashCode(_diskFormat); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_image); + result = prime * result + Objects.hashCode(_minDisk); + result = prime * result + Objects.hashCode(_minRam); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_operatingSystem); + result = prime * result + Objects.hashCode(_size); + result = prime * result + Objects.hashCode(_supportedVirtualizationEnvironment); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!SwImageDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + SwImageDesc other = (SwImageDesc)obj; + if (!Objects.equals(_checksum, other.getChecksum())) { + return false; + } + if (!Objects.equals(_containerFormat, other.getContainerFormat())) { + return false; + } + if (!Objects.equals(_diskFormat, other.getDiskFormat())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_image, other.getImage())) { + return false; + } + if (!Objects.equals(_minDisk, other.getMinDisk())) { + return false; + } + if (!Objects.equals(_minRam, other.getMinRam())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_operatingSystem, other.getOperatingSystem())) { + return false; + } + if (!Objects.equals(_size, other.getSize())) { + return false; + } + if (!Objects.equals(_supportedVirtualizationEnvironment, other.getSupportedVirtualizationEnvironment())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SwImageDescImpl otherImpl = (SwImageDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("SwImageDesc"); + CodeHelpers.appendValue(helper, "_checksum", _checksum); + CodeHelpers.appendValue(helper, "_containerFormat", _containerFormat); + CodeHelpers.appendValue(helper, "_diskFormat", _diskFormat); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_image", _image); + CodeHelpers.appendValue(helper, "_minDisk", _minDisk); + CodeHelpers.appendValue(helper, "_minRam", _minRam); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_operatingSystem", _operatingSystem); + CodeHelpers.appendValue(helper, "_size", _size); + CodeHelpers.appendValue(helper, "_supportedVirtualizationEnvironment", _supportedVirtualizationEnvironment); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescKey.java new file mode 100644 index 0000000..26dddcf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/SwImageDescKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class SwImageDescKey + implements Identifier { + private static final long serialVersionUID = 792797036952929257L; + private final String _id; + + + public SwImageDescKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public SwImageDescKey(SwImageDescKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SwImageDescKey)) { + return false; + } + final SwImageDescKey other = (SwImageDescKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(SwImageDescKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Vdu.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Vdu.java new file mode 100644 index 0000000..0b54e0a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/Vdu.java @@ -0,0 +1,301 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.util.List; +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduBuilder.VduImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.BootOrder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.ConfigurablePropertiesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.IntCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.IntCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.MonitoringParameterKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The Virtualisation Deployment Unit (VDU) is a construct supporting the + * description of the deployment and operational behaviour of a VNF component, or + * the entire VNF if it was not componentized in components. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vdu {
+ *   key id;
+ *   min-elements 1;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list int-cpd {
+ *     key id;
+ *     min-elements 1;
+ *     leaf int-virtual-link-desc {
+ *       type leafref {
+ *         path ../../../int-virtual-link-desc/id;
+ *       }
+ *     }
+ *     leaf bitrate-requirement {
+ *       type uint64;
+ *       units Mbps;
+ *     }
+ *     uses virtual-network-interface-requirements;
+ *     leaf nicio-requirements {
+ *       type leafref {
+ *         path ../../../virtual-compute-desc/id;
+ *       }
+ *     }
+ *     leaf-list order {
+ *       type uint32;
+ *     }
+ *     uses cpd;
+ *     leaf security-group-rule-id {
+ *       type leafref {
+ *         path ../../../security-group-rule/id;
+ *       }
+ *     }
+ *   }
+ *   leaf virtual-compute-desc {
+ *     type leafref {
+ *       path ../../virtual-compute-desc/id;
+ *     }
+ *     must "../../virtual-compute-desc[id=current()]/virtual-memory/size >=../../sw-image-desc[id=current()/../sw-image-desc]/min-ram";
+ *   }
+ *   leaf-list virtual-storage-desc {
+ *     type leafref {
+ *       path ../../virtual-storage-desc/id;
+ *     }
+ *   }
+ *   list boot-order {
+ *     ordered-by user;
+ *     key key;
+ *     leaf key {
+ *       type uint32;
+ *     }
+ *     leaf value {
+ *       type leafref {
+ *         path ../../virtual-storage-desc;
+ *       }
+ *     }
+ *   }
+ *   leaf sw-image-desc {
+ *     type leafref {
+ *       path ../../sw-image-desc/id;
+ *     }
+ *   }
+ *   leaf-list nfvi-constraint {
+ *     type string;
+ *   }
+ *   list monitoring-parameter {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     uses monitoring-parameter;
+ *   }
+ *   list configurable-properties {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ *   leaf boot-data {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/vdu + * + *

To create instances of this class use {@link VduBuilder}. + * @see VduBuilder + * @see VduKey + * + */ +@JsonDeserialize(as = VduImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface Vdu + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu.class; + } + + /** + * Unique identifier of this VDU in VNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable name of the VDU. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Human readable description of the VDU. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * A internal-connection-point element is a type of connection point and describes + * network connectivity between a VDU instance and an internal Virtual Link or an + * external connection point. + * + * + * + * @return java.util.Map intCpd, or null if not present + */ + @Nullable Map getIntCpd(); + + /** + * @return java.util.Map intCpd, or an empty list if it is not present + */ + default @NonNull Map nonnullIntCpd() { + return CodeHelpers.nonnull(getIntCpd()); + } + + /** + * Describes CPU, Memory and acceleration requirements of the Virtualisation + * Container realizing this VDU. + * + * + * + * @return java.lang.String virtualComputeDesc, or null if not present + */ + @Nullable String getVirtualComputeDesc(); + + /** + * Describes storage requirements for a VirtualStorage instance attached to the + * virtualisation container created from virtualComputeDesc defined for this VDU. + * + * + * + * @return java.util.List virtualStorageDesc, or null if not present + */ + @Nullable List getVirtualStorageDesc(); + + /** + * The key indicates the boot index (lowest index defines highest boot priority). + * The Value references a descriptor from which a valid boot device is created e.g. + * VirtualStorageDesc from which a VirtualStorage instance is created. Editor's + * note: The boot-order node requires further study. + * + * + * + * @return java.util.List bootOrder, or null if not present + */ + @Nullable List getBootOrder(); + + /** + * @return java.util.List bootOrder, or an empty list if it is not present + */ + default @NonNull List nonnullBootOrder() { + return CodeHelpers.nonnull(getBootOrder()); + } + + /** + * Describes the software image which is directly loaded on the virtualisation + * container realising this Vdu. + * + * + * + * @return java.lang.String swImageDesc, or null if not present + */ + @Nullable String getSwImageDesc(); + + /** + * Describes constraints on the NFVI for the VNFC instance(s) created from this + * Vdu. For example, aspects of a secure hosting environment for the VNFC instance + * that involve additional entities or processes. + * + * + * + * @return java.util.List nfviConstraint, or null if not present + */ + @Nullable List getNfviConstraint(); + + /** + * @return java.util.Map monitoringParameter, or null if not present + */ + @Nullable Map getMonitoringParameter(); + + /** + * @return java.util.Map monitoringParameter, or an empty list if it is not present + */ + default @NonNull Map nonnullMonitoringParameter() { + return CodeHelpers.nonnull(getMonitoringParameter()); + } + + /** + * It provides VNFC configurable properties that can be modified using the + * ModifyVnfInfo operation. + * + * + * + * @return java.util.Map configurableProperties, or null if not present + */ + @Nullable Map getConfigurableProperties(); + + /** + * @return java.util.Map configurableProperties, or an empty list if it is not present + */ + default @NonNull Map nonnullConfigurableProperties() { + return CodeHelpers.nonnull(getConfigurableProperties()); + } + + /** + * Contains a string or a URL to a file contained in the VNF package used to + * customize a virtualised compute resource at boot time. The bootData may contain + * variable parts that are replaced by deployment specific values before being sent + * to the VIM. + * + * + * + * @return java.lang.String bootData, or null if not present + */ + @Nullable String getBootData(); + + @Override + VduKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduBuilder.java new file mode 100644 index 0000000..abddb80 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduBuilder.java @@ -0,0 +1,572 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.BootOrder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.ConfigurablePropertiesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.IntCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.IntCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.MonitoringParameterKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VduBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VduBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VduBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VduBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VduBuilder + * @see Builder + * + */ +public class VduBuilder implements Builder { + + private String _bootData; + private List _bootOrder; + private Map _configurableProperties; + private String _description; + private String _id; + private Map _intCpd; + private Map _monitoringParameter; + private String _name; + private List _nfviConstraint; + private String _swImageDesc; + private String _virtualComputeDesc; + private List _virtualStorageDesc; + private VduKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VduBuilder() { + } + + public VduBuilder(Vdu base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._bootData = base.getBootData(); + this._bootOrder = base.getBootOrder(); + this._configurableProperties = base.getConfigurableProperties(); + this._description = base.getDescription(); + this._intCpd = base.getIntCpd(); + this._monitoringParameter = base.getMonitoringParameter(); + this._name = base.getName(); + this._nfviConstraint = base.getNfviConstraint(); + this._swImageDesc = base.getSwImageDesc(); + this._virtualComputeDesc = base.getVirtualComputeDesc(); + this._virtualStorageDesc = base.getVirtualStorageDesc(); + } + + + public VduKey key() { + return key; + } + + public String getBootData() { + return _bootData; + } + + public List getBootOrder() { + return _bootOrder; + } + + public Map getConfigurableProperties() { + return _configurableProperties; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public Map getIntCpd() { + return _intCpd; + } + + public Map getMonitoringParameter() { + return _monitoringParameter; + } + + public String getName() { + return _name; + } + + public List getNfviConstraint() { + return _nfviConstraint; + } + + public String getSwImageDesc() { + return _swImageDesc; + } + + public String getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + public List getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VduBuilder withKey(final VduKey key) { + this.key = key; + return this; + } + + public VduBuilder setBootData(final String value) { + this._bootData = value; + return this; + } + public VduBuilder setBootOrder(final List values) { + this._bootOrder = values; + return this; + } + + public VduBuilder setConfigurableProperties(final Map values) { + this._configurableProperties = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setConfigurableProperties(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VduBuilder setConfigurableProperties(final List values) { + return setConfigurableProperties(CodeHelpers.compatMap(values)); + } + + public VduBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public VduBuilder setId(final String value) { + this._id = value; + return this; + } + public VduBuilder setIntCpd(final Map values) { + this._intCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIntCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VduBuilder setIntCpd(final List values) { + return setIntCpd(CodeHelpers.compatMap(values)); + } + public VduBuilder setMonitoringParameter(final Map values) { + this._monitoringParameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setMonitoringParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VduBuilder setMonitoringParameter(final List values) { + return setMonitoringParameter(CodeHelpers.compatMap(values)); + } + + public VduBuilder setName(final String value) { + this._name = value; + return this; + } + public VduBuilder setNfviConstraint(final List values) { + this._nfviConstraint = values; + return this; + } + + + public VduBuilder setSwImageDesc(final String value) { + this._swImageDesc = value; + return this; + } + + public VduBuilder setVirtualComputeDesc(final String value) { + this._virtualComputeDesc = value; + return this; + } + public VduBuilder setVirtualStorageDesc(final List values) { + this._virtualStorageDesc = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VduBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VduBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VduBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VduBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vdu build() { + return new VduImpl(this); + } + + public static final class VduImpl + extends AbstractAugmentable + implements Vdu { + + private final String _bootData; + private final List _bootOrder; + private final Map _configurableProperties; + private final String _description; + @JsonProperty("id") + private final String _id; + private final Map _intCpd; + private final Map _monitoringParameter; + @JsonProperty("name") + private final String _name; + private final List _nfviConstraint; + @JsonProperty("sw-image-desc") + private final String _swImageDesc; + private final String _virtualComputeDesc; + private final List _virtualStorageDesc; + private VduKey key; + + VduImpl(VduBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VduKey(base.getId()); + } + this._id = key.getId(); + this._bootData = base.getBootData(); + this._bootOrder = CodeHelpers.emptyToNull(base.getBootOrder()); + this._configurableProperties = CodeHelpers.emptyToNull(base.getConfigurableProperties()); + this._description = base.getDescription(); + this._intCpd = CodeHelpers.emptyToNull(base.getIntCpd()); + this._monitoringParameter = CodeHelpers.emptyToNull(base.getMonitoringParameter()); + this._name = base.getName(); + this._nfviConstraint = base.getNfviConstraint(); + this._swImageDesc = base.getSwImageDesc(); + this._virtualComputeDesc = base.getVirtualComputeDesc(); + this._virtualStorageDesc = base.getVirtualStorageDesc(); + } + + public VduImpl() { + this( new VduBuilder()); + } + + + @Override + public VduKey key() { + if ( ( key != null) && ( key.getId() == null) && ( _id != null) ) { + key = new VduKey(_id); + } + return key; + } + + @Override + public String getBootData() { + return _bootData; + } + + @Override + public List getBootOrder() { + return _bootOrder; + } + + @Override + public Map getConfigurableProperties() { + return _configurableProperties; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getIntCpd() { + return _intCpd; + } + + @Override + public Map getMonitoringParameter() { + return _monitoringParameter; + } + + @Override + public String getName() { + return _name; + } + + @Override + public List getNfviConstraint() { + return _nfviConstraint; + } + + @Override + public String getSwImageDesc() { + return _swImageDesc; + } + + @Override + public String getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + @Override + public List getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_bootData); + result = prime * result + Objects.hashCode(_bootOrder); + result = prime * result + Objects.hashCode(_configurableProperties); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_intCpd); + result = prime * result + Objects.hashCode(_monitoringParameter); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_nfviConstraint); + result = prime * result + Objects.hashCode(_swImageDesc); + result = prime * result + Objects.hashCode(_virtualComputeDesc); + result = prime * result + Objects.hashCode(_virtualStorageDesc); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vdu.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vdu other = (Vdu)obj; + if (!Objects.equals(_bootData, other.getBootData())) { + return false; + } + if (!Objects.equals(_bootOrder, other.getBootOrder())) { + return false; + } + if (!Objects.equals(_configurableProperties, other.getConfigurableProperties())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_intCpd, other.getIntCpd())) { + return false; + } + if (!Objects.equals(_monitoringParameter, other.getMonitoringParameter())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_nfviConstraint, other.getNfviConstraint())) { + return false; + } + if (!Objects.equals(_swImageDesc, other.getSwImageDesc())) { + return false; + } + if (!Objects.equals(_virtualComputeDesc, other.getVirtualComputeDesc())) { + return false; + } + if (!Objects.equals(_virtualStorageDesc, other.getVirtualStorageDesc())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VduImpl otherImpl = (VduImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vdu"); + CodeHelpers.appendValue(helper, "_bootData", _bootData); + CodeHelpers.appendValue(helper, "_bootOrder", _bootOrder); + CodeHelpers.appendValue(helper, "_configurableProperties", _configurableProperties); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_intCpd", _intCpd); + CodeHelpers.appendValue(helper, "_monitoringParameter", _monitoringParameter); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_nfviConstraint", _nfviConstraint); + CodeHelpers.appendValue(helper, "_swImageDesc", _swImageDesc); + CodeHelpers.appendValue(helper, "_virtualComputeDesc", _virtualComputeDesc); + CodeHelpers.appendValue(helper, "_virtualStorageDesc", _virtualStorageDesc); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduKey.java new file mode 100644 index 0000000..38cc37c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VduKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VduKey + implements Identifier { + private static final long serialVersionUID = 2655467629240519313L; + private final String _id; + + + public VduKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VduKey(VduKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VduKey)) { + return false; + } + final VduKey other = (VduKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VduKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDesc.java new file mode 100644 index 0000000..ffdd5a8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDesc.java @@ -0,0 +1,246 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescBuilder.VirtualComputeDescImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.LogicalNode; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.LogicalNodeKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.RequestAdditionalCapability; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.RequestAdditionalCapabilityKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualMemory; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Defines descriptors of virtual compute resources to be used by the VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-compute-desc {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   list logical-node {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list requirement-detail {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   list request-additional-capability {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf support-mandatory {
+ *       type boolean;
+ *     }
+ *     leaf min-version {
+ *       type string;
+ *     }
+ *     leaf preferred-version {
+ *       type string;
+ *     }
+ *     list target-performance-parameters {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   leaf compute-requirements {
+ *     type string;
+ *   }
+ *   container virtual-memory {
+ *     leaf size {
+ *       type decimal64 {
+ *         fraction-digits 1;
+ *         range 0..max;
+ *       }
+ *       units GB;
+ *       default 1;
+ *     }
+ *     leaf over-subscription-policy {
+ *       type string;
+ *     }
+ *     list vdu-mem-requirements {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf numa-enabled {
+ *       type boolean;
+ *     }
+ *   }
+ *   container virtual-cpu {
+ *     leaf cpu-architecture {
+ *       type string;
+ *     }
+ *     leaf num-virtual-cpu {
+ *       type uint16 {
+ *         range 1..max;
+ *       }
+ *       default 1;
+ *     }
+ *     leaf clock {
+ *       type uint32;
+ *       units MHz;
+ *     }
+ *     leaf oversubscription-policy {
+ *       type string;
+ *     }
+ *     list vdu-cpu-requirements {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     container pinning {
+ *       presence "Set to specify CPU pinning.";
+ *       leaf policy {
+ *         default dynamic;
+ *         type enumeration {
+ *           enum static;
+ *           enum dynamic;
+ *         }
+ *       }
+ *       list rule {
+ *         when "../policy = 'static'";
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc + * + *

To create instances of this class use {@link VirtualComputeDescBuilder}. + * @see VirtualComputeDescBuilder + * @see VirtualComputeDescKey + * + */ +@JsonDeserialize(as = VirtualComputeDescImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface VirtualComputeDesc + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-compute-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc.class; + } + + /** + * Unique identifier of this VirtualComputeDesc in the VNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The logical node requirements. + * + * + * + * @return java.util.Map logicalNode, or null if not present + */ + @Nullable Map getLogicalNode(); + + /** + * @return java.util.Map logicalNode, or an empty list if it is not present + */ + default @NonNull Map nonnullLogicalNode() { + return CodeHelpers.nonnull(getLogicalNode()); + } + + /** + * @return java.util.Map requestAdditionalCapability, or null if not present + */ + @Nullable Map getRequestAdditionalCapability(); + + /** + * @return java.util.Map requestAdditionalCapability, or an empty list if it is not present + */ + default @NonNull Map nonnullRequestAdditionalCapability() { + return CodeHelpers.nonnull(getRequestAdditionalCapability()); + } + + /** + * Specifies compute requirements. + * + * + * + * @return java.lang.String computeRequirements, or null if not present + */ + @Nullable String getComputeRequirements(); + + /** + * The virtual memory of the virtualised compute. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualMemory virtualMemory, or null if not present + */ + @Nullable VirtualMemory getVirtualMemory(); + + /** + * The virtual CPU(s)of the virtualised compute. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpu virtualCpu, or null if not present + */ + @Nullable VirtualCpu getVirtualCpu(); + + @Override + VirtualComputeDescKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescBuilder.java new file mode 100644 index 0000000..f2b07dd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescBuilder.java @@ -0,0 +1,416 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.LogicalNode; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.LogicalNodeKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.RequestAdditionalCapability; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.RequestAdditionalCapabilityKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualMemory; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualComputeDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualComputeDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualComputeDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualComputeDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualComputeDescBuilder + * @see Builder + * + */ +public class VirtualComputeDescBuilder implements Builder { + + private String _computeRequirements; + private String _id; + private Map _logicalNode; + private Map _requestAdditionalCapability; + private VirtualCpu _virtualCpu; + private VirtualMemory _virtualMemory; + private VirtualComputeDescKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualComputeDescBuilder() { + } + + public VirtualComputeDescBuilder(VirtualComputeDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._computeRequirements = base.getComputeRequirements(); + this._logicalNode = base.getLogicalNode(); + this._requestAdditionalCapability = base.getRequestAdditionalCapability(); + this._virtualCpu = base.getVirtualCpu(); + this._virtualMemory = base.getVirtualMemory(); + } + + + public VirtualComputeDescKey key() { + return key; + } + + public String getComputeRequirements() { + return _computeRequirements; + } + + public String getId() { + return _id; + } + + public Map getLogicalNode() { + return _logicalNode; + } + + public Map getRequestAdditionalCapability() { + return _requestAdditionalCapability; + } + + public VirtualCpu getVirtualCpu() { + return _virtualCpu; + } + + public VirtualMemory getVirtualMemory() { + return _virtualMemory; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualComputeDescBuilder withKey(final VirtualComputeDescKey key) { + this.key = key; + return this; + } + + public VirtualComputeDescBuilder setComputeRequirements(final String value) { + this._computeRequirements = value; + return this; + } + + public VirtualComputeDescBuilder setId(final String value) { + this._id = value; + return this; + } + public VirtualComputeDescBuilder setLogicalNode(final Map values) { + this._logicalNode = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLogicalNode(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualComputeDescBuilder setLogicalNode(final List values) { + return setLogicalNode(CodeHelpers.compatMap(values)); + } + public VirtualComputeDescBuilder setRequestAdditionalCapability(final Map values) { + this._requestAdditionalCapability = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setRequestAdditionalCapability(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualComputeDescBuilder setRequestAdditionalCapability(final List values) { + return setRequestAdditionalCapability(CodeHelpers.compatMap(values)); + } + + public VirtualComputeDescBuilder setVirtualCpu(final VirtualCpu value) { + this._virtualCpu = value; + return this; + } + + public VirtualComputeDescBuilder setVirtualMemory(final VirtualMemory value) { + this._virtualMemory = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualComputeDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualComputeDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualComputeDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualComputeDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualComputeDesc build() { + return new VirtualComputeDescImpl(this); + } + + public static final class VirtualComputeDescImpl + extends AbstractAugmentable + implements VirtualComputeDesc { + + private final String _computeRequirements; + @JsonProperty("id") + private final String _id; + private final Map _logicalNode; + private final Map _requestAdditionalCapability; + @JsonProperty("virtual-cpu") + private final VirtualCpu _virtualCpu; + @JsonProperty("virtual-memory") + private final VirtualMemory _virtualMemory; + private VirtualComputeDescKey key; + + VirtualComputeDescImpl(VirtualComputeDescBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualComputeDescKey(base.getId()); + } + this._id = key.getId(); + this._computeRequirements = base.getComputeRequirements(); + this._logicalNode = CodeHelpers.emptyToNull(base.getLogicalNode()); + this._requestAdditionalCapability = CodeHelpers.emptyToNull(base.getRequestAdditionalCapability()); + this._virtualCpu = base.getVirtualCpu(); + this._virtualMemory = base.getVirtualMemory(); + } + + + public VirtualComputeDescImpl() { + this( new VirtualComputeDescBuilder()); + } + + @Override + public VirtualComputeDescKey key() { + if ( ( key != null) && ( key.getId() == null) && ( _id != null) ) { + key = new VirtualComputeDescKey(_id); + } + return key; + } + + @Override + public String getComputeRequirements() { + return _computeRequirements; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getLogicalNode() { + return _logicalNode; + } + + @Override + public Map getRequestAdditionalCapability() { + return _requestAdditionalCapability; + } + + @Override + public VirtualCpu getVirtualCpu() { + return _virtualCpu; + } + + @Override + public VirtualMemory getVirtualMemory() { + return _virtualMemory; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_computeRequirements); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_logicalNode); + result = prime * result + Objects.hashCode(_requestAdditionalCapability); + result = prime * result + Objects.hashCode(_virtualCpu); + result = prime * result + Objects.hashCode(_virtualMemory); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualComputeDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualComputeDesc other = (VirtualComputeDesc)obj; + if (!Objects.equals(_computeRequirements, other.getComputeRequirements())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_logicalNode, other.getLogicalNode())) { + return false; + } + if (!Objects.equals(_requestAdditionalCapability, other.getRequestAdditionalCapability())) { + return false; + } + if (!Objects.equals(_virtualCpu, other.getVirtualCpu())) { + return false; + } + if (!Objects.equals(_virtualMemory, other.getVirtualMemory())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualComputeDescImpl otherImpl = (VirtualComputeDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualComputeDesc"); + CodeHelpers.appendValue(helper, "_computeRequirements", _computeRequirements); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_logicalNode", _logicalNode); + CodeHelpers.appendValue(helper, "_requestAdditionalCapability", _requestAdditionalCapability); + CodeHelpers.appendValue(helper, "_virtualCpu", _virtualCpu); + CodeHelpers.appendValue(helper, "_virtualMemory", _virtualMemory); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescKey.java new file mode 100644 index 0000000..4b13cfc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualComputeDescKey.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.KeyDeserializer; +import com.google.common.base.MoreObjects; + +import java.io.IOException; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualComputeDescKey extends KeyDeserializer + implements Identifier { + private static final long serialVersionUID = -1836114838188485829L; + private final String _id; + + + public VirtualComputeDescKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualComputeDescKey(VirtualComputeDescKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualComputeDescKey)) { + return false; + } + final VirtualComputeDescKey other = (VirtualComputeDescKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualComputeDescKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } + + @Override + public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException { + // TODO Auto-generated method stub + return this.toString(); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDesc.java new file mode 100644 index 0000000..79304ba --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDesc.java @@ -0,0 +1,159 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.StorageType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescBuilder.VirtualStorageDescImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc.VduStorageRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc.VduStorageRequirementsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Storage requirements for a Virtual Storage instance attached to the VNFC + * from this VDU + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-storage-desc {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf type-of-storage {
+ *     default root-storage;
+ *     type identityref {
+ *       base storage-type;
+ *     }
+ *   }
+ *   leaf size-of-storage {
+ *     type uint64;
+ *     units GB;
+ *     default 0;
+ *   }
+ *   list vdu-storage-requirements {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ *   leaf rdma-enabled {
+ *     type boolean;
+ *   }
+ *   leaf sw-image-desc {
+ *     type leafref {
+ *       path ../../sw-image-desc/id;
+ *     }
+ *     must "../size-of-storage >=../../sw-image-desc[id=current()]/min-disk";
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-storage-desc + * + *

To create instances of this class use {@link VirtualStorageDescBuilder}. + * @see VirtualStorageDescBuilder + * @see VirtualStorageDescKey + * + */ +@JsonDeserialize(as = VirtualStorageDescImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface VirtualStorageDesc + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-storage-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc.class; + } + + /** + * Unique identifier of this VirtualStorageDesc in the VNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Type of virtualised storage resource (e.g. volume, object). + * + * + * + * @return java.lang.Class typeOfStorage, or null if not present + */ + @Nullable Class getTypeOfStorage(); + + /** + * Size of virtualised storage resource (e.g. size of volume, in GB) + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 sizeOfStorage, or null if not present + */ + @Nullable Uint64 getSizeOfStorage(); + + /** + * Array of key-value pairs that articulate the storage deployment requirements. + * + * + * + * @return java.util.Map vduStorageRequirements, or null if not present + */ + @Nullable Map getVduStorageRequirements(); + + /** + * @return java.util.Map vduStorageRequirements, or an empty list if it is not present + */ + default @NonNull Map nonnullVduStorageRequirements() { + return CodeHelpers.nonnull(getVduStorageRequirements()); + } + + /** + * Indicate if the storage support RDMA. + * + * + * + * @return java.lang.Boolean rdmaEnabled, or null if not present + */ + @Nullable Boolean isRdmaEnabled(); + + /** + * Software image to be loaded on the VirtualStorage resource created based on this + * VirtualStorageDesc. + * + * + * + * @return java.lang.String swImageDesc, or null if not present + */ + @Nullable String getSwImageDesc(); + + @Override + VirtualStorageDescKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescBuilder.java new file mode 100644 index 0000000..4690e4d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescBuilder.java @@ -0,0 +1,409 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.StorageType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc.VduStorageRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc.VduStorageRequirementsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link VirtualStorageDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualStorageDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualStorageDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualStorageDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualStorageDescBuilder + * @see Builder + * + */ +public class VirtualStorageDescBuilder implements Builder { + + private String _id; + private Uint64 _sizeOfStorage; + private String _swImageDesc; + private Class _typeOfStorage; + private Map _vduStorageRequirements; + private Boolean _rdmaEnabled; + private VirtualStorageDescKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualStorageDescBuilder() { + } + + public VirtualStorageDescBuilder(VirtualStorageDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._sizeOfStorage = base.getSizeOfStorage(); + this._swImageDesc = base.getSwImageDesc(); + this._typeOfStorage = base.getTypeOfStorage(); + this._vduStorageRequirements = base.getVduStorageRequirements(); + this._rdmaEnabled = base.isRdmaEnabled(); + } + + + public VirtualStorageDescKey key() { + return key; + } + + public String getId() { + return _id; + } + + public Uint64 getSizeOfStorage() { + return _sizeOfStorage; + } + + public String getSwImageDesc() { + return _swImageDesc; + } + + public Class getTypeOfStorage() { + return _typeOfStorage; + } + + public Map getVduStorageRequirements() { + return _vduStorageRequirements; + } + + public Boolean isRdmaEnabled() { + return _rdmaEnabled; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualStorageDescBuilder withKey(final VirtualStorageDescKey key) { + this.key = key; + return this; + } + + public VirtualStorageDescBuilder setId(final String value) { + this._id = value; + return this; + } + + public VirtualStorageDescBuilder setSizeOfStorage(final Uint64 value) { + this._sizeOfStorage = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setSizeOfStorage(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualStorageDescBuilder setSizeOfStorage(final BigInteger value) { + return setSizeOfStorage(CodeHelpers.compatUint(value)); + } + + public VirtualStorageDescBuilder setSwImageDesc(final String value) { + this._swImageDesc = value; + return this; + } + + public VirtualStorageDescBuilder setTypeOfStorage(final Class value) { + this._typeOfStorage = value; + return this; + } + public VirtualStorageDescBuilder setVduStorageRequirements(final Map values) { + this._vduStorageRequirements = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVduStorageRequirements(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualStorageDescBuilder setVduStorageRequirements(final List values) { + return setVduStorageRequirements(CodeHelpers.compatMap(values)); + } + + public VirtualStorageDescBuilder setRdmaEnabled(final Boolean value) { + this._rdmaEnabled = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualStorageDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualStorageDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualStorageDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualStorageDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualStorageDesc build() { + return new VirtualStorageDescImpl(this); + } + + public static final class VirtualStorageDescImpl + extends AbstractAugmentable + implements VirtualStorageDesc { + + @JsonProperty("id") + private final String _id; + @JsonProperty("size-of-storage") + private final Uint64 _sizeOfStorage; + private final String _swImageDesc; + private final Class _typeOfStorage; + private final Map _vduStorageRequirements; + private final Boolean _rdmaEnabled; + private VirtualStorageDescKey key; + + VirtualStorageDescImpl(VirtualStorageDescBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualStorageDescKey(base.getId()); + } + this._id = key.getId(); + this._sizeOfStorage = base.getSizeOfStorage(); + this._swImageDesc = base.getSwImageDesc(); + this._typeOfStorage = base.getTypeOfStorage(); + this._vduStorageRequirements = CodeHelpers.emptyToNull(base.getVduStorageRequirements()); + this._rdmaEnabled = base.isRdmaEnabled(); + } + + public VirtualStorageDescImpl() { + this( new VirtualStorageDescBuilder()); + } + + @Override + public VirtualStorageDescKey key() { + if ( ( key != null) && ( key.getId() == null) && ( _id != null) ) { + key = new VirtualStorageDescKey(_id); + } + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Uint64 getSizeOfStorage() { + return _sizeOfStorage; + } + + @Override + public String getSwImageDesc() { + return _swImageDesc; + } + + @Override + public Class getTypeOfStorage() { + return _typeOfStorage; + } + + @Override + public Map getVduStorageRequirements() { + return _vduStorageRequirements; + } + + @Override + public Boolean isRdmaEnabled() { + return _rdmaEnabled; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_sizeOfStorage); + result = prime * result + Objects.hashCode(_swImageDesc); + result = prime * result + Objects.hashCode(_typeOfStorage); + result = prime * result + Objects.hashCode(_vduStorageRequirements); + result = prime * result + Objects.hashCode(_rdmaEnabled); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualStorageDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualStorageDesc other = (VirtualStorageDesc)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_sizeOfStorage, other.getSizeOfStorage())) { + return false; + } + if (!Objects.equals(_swImageDesc, other.getSwImageDesc())) { + return false; + } + if (!Objects.equals(_typeOfStorage, other.getTypeOfStorage())) { + return false; + } + if (!Objects.equals(_vduStorageRequirements, other.getVduStorageRequirements())) { + return false; + } + if (!Objects.equals(_rdmaEnabled, other.isRdmaEnabled())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualStorageDescImpl otherImpl = (VirtualStorageDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualStorageDesc"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_sizeOfStorage", _sizeOfStorage); + CodeHelpers.appendValue(helper, "_swImageDesc", _swImageDesc); + CodeHelpers.appendValue(helper, "_typeOfStorage", _typeOfStorage); + CodeHelpers.appendValue(helper, "_vduStorageRequirements", _vduStorageRequirements); + CodeHelpers.appendValue(helper, "_rdmaEnabled", _rdmaEnabled); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescKey.java new file mode 100644 index 0000000..a11f827 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/VirtualStorageDescKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualStorageDescKey + implements Identifier { + private static final long serialVersionUID = -3095943427735575648L; + private final String _id; + + + public VirtualStorageDescKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualStorageDescKey(VirtualStorageDescKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualStorageDescKey)) { + return false; + } + final VirtualStorageDescKey other = (VirtualStorageDescKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualStorageDescKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/Flavour.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/Flavour.java new file mode 100644 index 0000000..9ade2b9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/Flavour.java @@ -0,0 +1,90 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.flavour.Qos; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes a specific flavour of the VL with specific bitrate requirements. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list flavour {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   container qos {
+ *     presence "VL QoS parameters";
+ *     leaf latency {
+ *       type uint32;
+ *       units ms;
+ *     }
+ *     leaf packet-delay-variation {
+ *       type uint32;
+ *       units ms;
+ *     }
+ *     leaf packet-loss-ratio {
+ *       type decimal64 {
+ *         fraction-digits 2;
+ *         range 0..1.00;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/int-virtual-link-desc/flavour + * + *

To create instances of this class use {@link FlavourBuilder}. + * @see FlavourBuilder + * @see FlavourKey + * + */ +public interface Flavour + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("flavour"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.Flavour.class; + } + + /** + * Identifies a flavour within a VnfVirtualLinkDesc. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * QoS of the VL. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.flavour.Qos qos, or null if not present + */ + @Nullable Qos getQos(); + + @Override + FlavourKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourBuilder.java new file mode 100644 index 0000000..64c45a7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourBuilder.java @@ -0,0 +1,272 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.flavour.Qos; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link FlavourBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     FlavourBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new FlavourBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of FlavourBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see FlavourBuilder + * @see Builder + * + */ +public class FlavourBuilder implements Builder { + + private String _id; + private Qos _qos; + private FlavourKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public FlavourBuilder() { + } + + public FlavourBuilder(Flavour base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._qos = base.getQos(); + } + + + public FlavourKey key() { + return key; + } + + public String getId() { + return _id; + } + + public Qos getQos() { + return _qos; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public FlavourBuilder withKey(final FlavourKey key) { + this.key = key; + return this; + } + + public FlavourBuilder setId(final String value) { + this._id = value; + return this; + } + + public FlavourBuilder setQos(final Qos value) { + this._qos = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public FlavourBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public FlavourBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public FlavourBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private FlavourBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Flavour build() { + return new FlavourImpl(this); + } + + private static final class FlavourImpl + extends AbstractAugmentable + implements Flavour { + + private final String _id; + private final Qos _qos; + private final FlavourKey key; + + FlavourImpl(FlavourBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new FlavourKey(base.getId()); + } + this._id = key.getId(); + this._qos = base.getQos(); + } + + @Override + public FlavourKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Qos getQos() { + return _qos; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_qos); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Flavour.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Flavour other = (Flavour)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_qos, other.getQos())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + FlavourImpl otherImpl = (FlavourImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Flavour"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_qos", _qos); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourKey.java new file mode 100644 index 0000000..4f11a8c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/FlavourKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class FlavourKey + implements Identifier { + private static final long serialVersionUID = 3845688501799640719L; + private final String _id; + + + public FlavourKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public FlavourKey(FlavourKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof FlavourKey)) { + return false; + } + final FlavourKey other = (FlavourKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(FlavourKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParameters.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParameters.java new file mode 100644 index 0000000..d898376 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParameters.java @@ -0,0 +1,65 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list monitoring-parameters {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   uses monitoring-parameter;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/int-virtual-link-desc/monitoring-parameters + * + *

To create instances of this class use {@link MonitoringParametersBuilder}. + * @see MonitoringParametersBuilder + * @see MonitoringParametersKey + * + */ +public interface MonitoringParameters + extends + ChildOf, + Augmentable, + MonitoringParameter, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitoring-parameters"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.MonitoringParameters.class; + } + + /** + * Unique identifier of the monitoring parameter. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + MonitoringParametersKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersBuilder.java new file mode 100644 index 0000000..187f218 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersBuilder.java @@ -0,0 +1,355 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link MonitoringParametersBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MonitoringParametersBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MonitoringParametersBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MonitoringParametersBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MonitoringParametersBuilder + * @see Builder + * + */ +public class MonitoringParametersBuilder implements Builder { + + private Uint64 _collectionPeriod; + private String _id; + private String _name; + private String _performanceMetric; + private MonitoringParametersKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MonitoringParametersBuilder() { + } + public MonitoringParametersBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter arg) { + this._name = arg.getName(); + this._performanceMetric = arg.getPerformanceMetric(); + this._collectionPeriod = arg.getCollectionPeriod(); + } + + public MonitoringParametersBuilder(MonitoringParameters base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._collectionPeriod = base.getCollectionPeriod(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter) { + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getName(); + this._performanceMetric = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getPerformanceMetric(); + this._collectionPeriod = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getCollectionPeriod(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter]"); + } + + public MonitoringParametersKey key() { + return key; + } + + public Uint64 getCollectionPeriod() { + return _collectionPeriod; + } + + public String getId() { + return _id; + } + + public String getName() { + return _name; + } + + public String getPerformanceMetric() { + return _performanceMetric; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public MonitoringParametersBuilder withKey(final MonitoringParametersKey key) { + this.key = key; + return this; + } + + public MonitoringParametersBuilder setCollectionPeriod(final Uint64 value) { + this._collectionPeriod = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setCollectionPeriod(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoringParametersBuilder setCollectionPeriod(final BigInteger value) { + return setCollectionPeriod(CodeHelpers.compatUint(value)); + } + + public MonitoringParametersBuilder setId(final String value) { + this._id = value; + return this; + } + + public MonitoringParametersBuilder setName(final String value) { + this._name = value; + return this; + } + + public MonitoringParametersBuilder setPerformanceMetric(final String value) { + this._performanceMetric = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MonitoringParametersBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoringParametersBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MonitoringParametersBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MonitoringParametersBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MonitoringParameters build() { + return new MonitoringParametersImpl(this); + } + + private static final class MonitoringParametersImpl + extends AbstractAugmentable + implements MonitoringParameters { + + private final Uint64 _collectionPeriod; + private final String _id; + private final String _name; + private final String _performanceMetric; + private final MonitoringParametersKey key; + + MonitoringParametersImpl(MonitoringParametersBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new MonitoringParametersKey(base.getId()); + } + this._id = key.getId(); + this._collectionPeriod = base.getCollectionPeriod(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + @Override + public MonitoringParametersKey key() { + return key; + } + + @Override + public Uint64 getCollectionPeriod() { + return _collectionPeriod; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getPerformanceMetric() { + return _performanceMetric; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_collectionPeriod); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_performanceMetric); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MonitoringParameters.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MonitoringParameters other = (MonitoringParameters)obj; + if (!Objects.equals(_collectionPeriod, other.getCollectionPeriod())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_performanceMetric, other.getPerformanceMetric())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MonitoringParametersImpl otherImpl = (MonitoringParametersImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MonitoringParameters"); + CodeHelpers.appendValue(helper, "_collectionPeriod", _collectionPeriod); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_performanceMetric", _performanceMetric); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersKey.java new file mode 100644 index 0000000..d3f71e5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/MonitoringParametersKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class MonitoringParametersKey + implements Identifier { + private static final long serialVersionUID = 4943139000410270101L; + private final String _id; + + + public MonitoringParametersKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public MonitoringParametersKey(MonitoringParametersKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof MonitoringParametersKey)) { + return false; + } + final MonitoringParametersKey other = (MonitoringParametersKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(MonitoringParametersKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/Qos.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/Qos.java new file mode 100644 index 0000000..90264fd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/Qos.java @@ -0,0 +1,87 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.flavour; +import java.lang.Class; +import java.lang.Override; +import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.Flavour; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * QoS of the VL. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container qos {
+ *   presence "VL QoS parameters";
+ *   leaf latency {
+ *     type uint32;
+ *     units ms;
+ *   }
+ *   leaf packet-delay-variation {
+ *     type uint32;
+ *     units ms;
+ *   }
+ *   leaf packet-loss-ratio {
+ *     type decimal64 {
+ *       fraction-digits 2;
+ *       range 0..1.00;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/int-virtual-link-desc/flavour/qos + * + *

To create instances of this class use {@link QosBuilder}. + * @see QosBuilder + * + */ +public interface Qos + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("qos"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.flavour.Qos.class; + } + + /** + * Specifies the maximum latency in ms. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 latency, or null if not present + */ + @Nullable Uint32 getLatency(); + + /** + * Specifies the maximum jitter in ms. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 packetDelayVariation, or null if not present + */ + @Nullable Uint32 getPacketDelayVariation(); + + /** + * Specifies the maximum packet loss ratio. + * + * + * + * @return java.math.BigDecimal packetLossRatio, or null if not present + */ + @Nullable BigDecimal getPacketLossRatio(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/QosBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/QosBuilder.java new file mode 100644 index 0000000..e3ee140 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/_int/virtual/link/desc/flavour/QosBuilder.java @@ -0,0 +1,322 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd._int.virtual.link.desc.flavour; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Range; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link QosBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     QosBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new QosBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of QosBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see QosBuilder + * @see Builder + * + */ +public class QosBuilder implements Builder { + + private Uint32 _latency; + private Uint32 _packetDelayVariation; + private BigDecimal _packetLossRatio; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public QosBuilder() { + } + + public QosBuilder(Qos base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._latency = base.getLatency(); + this._packetDelayVariation = base.getPacketDelayVariation(); + this._packetLossRatio = base.getPacketLossRatio(); + } + + + public Uint32 getLatency() { + return _latency; + } + + public Uint32 getPacketDelayVariation() { + return _packetDelayVariation; + } + + public BigDecimal getPacketLossRatio() { + return _packetLossRatio; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public QosBuilder setLatency(final Uint32 value) { + this._latency = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLatency(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public QosBuilder setLatency(final Long value) { + return setLatency(CodeHelpers.compatUint(value)); + } + + public QosBuilder setPacketDelayVariation(final Uint32 value) { + this._packetDelayVariation = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setPacketDelayVariation(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public QosBuilder setPacketDelayVariation(final Long value) { + return setPacketDelayVariation(CodeHelpers.compatUint(value)); + } + + private static final Range[] CHECKPACKETLOSSRATIORANGE_RANGES; + static { + @SuppressWarnings("unchecked") + final Range[] a = (Range[]) Array.newInstance(Range.class, 1); + a[0] = Range.closed(java.math.BigDecimal.ZERO, new java.math.BigDecimal("1.00")); + CHECKPACKETLOSSRATIORANGE_RANGES = a; + } + private static void checkPacketLossRatioRange(final java.math.BigDecimal value) { + for (Range r : CHECKPACKETLOSSRATIORANGE_RANGES) { + if (r.contains(value)) { + return; + } + } + CodeHelpers.throwInvalidRange(CHECKPACKETLOSSRATIORANGE_RANGES, value); + } + + public QosBuilder setPacketLossRatio(final BigDecimal value) { + if (value != null) { + checkPacketLossRatioRange(value); + + } + this._packetLossRatio = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public QosBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public QosBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public QosBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private QosBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Qos build() { + return new QosImpl(this); + } + + private static final class QosImpl + extends AbstractAugmentable + implements Qos { + + private final Uint32 _latency; + private final Uint32 _packetDelayVariation; + private final BigDecimal _packetLossRatio; + + QosImpl(QosBuilder base) { + super(base.augmentation); + this._latency = base.getLatency(); + this._packetDelayVariation = base.getPacketDelayVariation(); + this._packetLossRatio = base.getPacketLossRatio(); + } + + @Override + public Uint32 getLatency() { + return _latency; + } + + @Override + public Uint32 getPacketDelayVariation() { + return _packetDelayVariation; + } + + @Override + public BigDecimal getPacketLossRatio() { + return _packetLossRatio; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_latency); + result = prime * result + Objects.hashCode(_packetDelayVariation); + result = prime * result + Objects.hashCode(_packetLossRatio); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Qos.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Qos other = (Qos)obj; + if (!Objects.equals(_latency, other.getLatency())) { + return false; + } + if (!Objects.equals(_packetDelayVariation, other.getPacketDelayVariation())) { + return false; + } + if (!Objects.equals(_packetLossRatio, other.getPacketLossRatio())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + QosImpl otherImpl = (QosImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Qos"); + CodeHelpers.appendValue(helper, "_latency", _latency); + CodeHelpers.appendValue(helper, "_packetDelayVariation", _packetDelayVariation); + CodeHelpers.appendValue(helper, "_packetLossRatio", _packetLossRatio); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurableProperty.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurableProperty.java new file mode 100644 index 0000000..e835883 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurableProperty.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * It provides VNF specific configurable properties that can be modified using the + * ModifyVnfConfiguration operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list additional-configurable-property {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/configurable-properties/additional-configurable-property + * + *

To create instances of this class use {@link AdditionalConfigurablePropertyBuilder}. + * @see AdditionalConfigurablePropertyBuilder + * @see AdditionalConfigurablePropertyKey + * + */ +public interface AdditionalConfigurableProperty + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("additional-configurable-property"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties.AdditionalConfigurableProperty.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + AdditionalConfigurablePropertyKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyBuilder.java new file mode 100644 index 0000000..02a4b83 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AdditionalConfigurablePropertyBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AdditionalConfigurablePropertyBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AdditionalConfigurablePropertyBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AdditionalConfigurablePropertyBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AdditionalConfigurablePropertyBuilder + * @see Builder + * + */ +public class AdditionalConfigurablePropertyBuilder implements Builder { + + private String _key; + private String _value; + private AdditionalConfigurablePropertyKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AdditionalConfigurablePropertyBuilder() { + } + + public AdditionalConfigurablePropertyBuilder(AdditionalConfigurableProperty base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public AdditionalConfigurablePropertyKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AdditionalConfigurablePropertyBuilder withKey(final AdditionalConfigurablePropertyKey key) { + this.key = key; + return this; + } + + public AdditionalConfigurablePropertyBuilder setKey(final String value) { + this._key = value; + return this; + } + + public AdditionalConfigurablePropertyBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AdditionalConfigurablePropertyBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AdditionalConfigurablePropertyBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AdditionalConfigurablePropertyBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AdditionalConfigurablePropertyBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AdditionalConfigurableProperty build() { + return new AdditionalConfigurablePropertyImpl(this); + } + + private static final class AdditionalConfigurablePropertyImpl + extends AbstractAugmentable + implements AdditionalConfigurableProperty { + + private final String _key; + private final String _value; + private final AdditionalConfigurablePropertyKey key; + + AdditionalConfigurablePropertyImpl(AdditionalConfigurablePropertyBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AdditionalConfigurablePropertyKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public AdditionalConfigurablePropertyKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AdditionalConfigurableProperty.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AdditionalConfigurableProperty other = (AdditionalConfigurableProperty)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AdditionalConfigurablePropertyImpl otherImpl = (AdditionalConfigurablePropertyImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AdditionalConfigurableProperty"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyKey.java new file mode 100644 index 0000000..efc9f17 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/configurable/properties/AdditionalConfigurablePropertyKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.configurable.properties; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AdditionalConfigurablePropertyKey + implements Identifier { + private static final long serialVersionUID = -4035791184852901377L; + private final String _key; + + + public AdditionalConfigurablePropertyKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AdditionalConfigurablePropertyKey(AdditionalConfigurablePropertyKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AdditionalConfigurablePropertyKey)) { + return false; + } + final AdditionalConfigurablePropertyKey other = (AdditionalConfigurablePropertyKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AdditionalConfigurablePropertyKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroup.java new file mode 100644 index 0000000..a9e71f0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroup.java @@ -0,0 +1,99 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The AffinityOrAntiAffinityGroup describes the affinity or anti-affinity + * relationship applicable between the virtualization containers to be created + * based on different VDUs, or between internal VLs to be created based on + * different VnfVirtualLinkDesc(s). Per VNF, the affinity/anti-affinity rules + * defined using this information element, using the + * LocalAffinityOrAntiAffinityRule information element, and using the placement + * constraints in the GrantLifecycleOperation as defined in ETSI GS NFV-IFA 007 + * [i.3] should be conflict-free. In case of conflicts, the placement constraints + * in the GrantLifecycleOperation shall take precedence. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf type {
+ *     type affinity-type;
+ *   }
+ *   leaf scope {
+ *     type affinity-scope;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/affinity-or-anti-affinity-group + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupBuilder}. + * @see AffinityOrAntiAffinityGroupBuilder + * @see AffinityOrAntiAffinityGroupKey + * + */ +public interface AffinityOrAntiAffinityGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.AffinityOrAntiAffinityGroup.class; + } + + /** + * Identifies an affinity or anti-affinity group to which the affinity or + * anti-affinity rule applies. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Specifies whether the rule is an affinity rule or an anti-affinity rule. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType type, or null if not present + */ + @Nullable AffinityType getType(); + + /** + * Specifies the scope of the rule, possible values are 'NFVI-PoP', 'Zone', + * 'ZoneGroup', 'NFVI-node'. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope scope, or null if not present + */ + @Nullable AffinityScope getScope(); + + @Override + AffinityOrAntiAffinityGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupBuilder.java new file mode 100644 index 0000000..cc2b4b1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupBuilder implements Builder { + + private String _id; + private AffinityScope _scope; + private AffinityType _type; + private AffinityOrAntiAffinityGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupBuilder() { + } + + public AffinityOrAntiAffinityGroupBuilder(AffinityOrAntiAffinityGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._scope = base.getScope(); + this._type = base.getType(); + } + + + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + public String getId() { + return _id; + } + + public AffinityScope getScope() { + return _scope; + } + + public AffinityType getType() { + return _type; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupBuilder withKey(final AffinityOrAntiAffinityGroupKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setId(final String value) { + this._id = value; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setScope(final AffinityScope value) { + this._scope = value; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setType(final AffinityType value) { + this._type = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroup build() { + return new AffinityOrAntiAffinityGroupImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroup { + + private final String _id; + private final AffinityScope _scope; + private final AffinityType _type; + private final AffinityOrAntiAffinityGroupKey key; + + AffinityOrAntiAffinityGroupImpl(AffinityOrAntiAffinityGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupKey(base.getId()); + } + this._id = key.getId(); + this._scope = base.getScope(); + this._type = base.getType(); + } + + @Override + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public AffinityScope getScope() { + return _scope; + } + + @Override + public AffinityType getType() { + return _type; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_scope); + result = prime * result + Objects.hashCode(_type); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroup other = (AffinityOrAntiAffinityGroup)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_scope, other.getScope())) { + return false; + } + if (!Objects.equals(_type, other.getType())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupImpl otherImpl = (AffinityOrAntiAffinityGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroup"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_scope", _scope); + CodeHelpers.appendValue(helper, "_type", _type); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupKey.java new file mode 100644 index 0000000..3aeda5c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/AffinityOrAntiAffinityGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupKey + implements Identifier { + private static final long serialVersionUID = -4909084403753675647L; + private final String _id; + + + public AffinityOrAntiAffinityGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupKey(AffinityOrAntiAffinityGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupKey)) { + return false; + } + final AffinityOrAntiAffinityGroupKey other = (AffinityOrAntiAffinityGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/Indicator.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/Indicator.java new file mode 100644 index 0000000..76580f6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/Indicator.java @@ -0,0 +1,174 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Declares the VNF indicators that are supported by this VNF (specific to this + * DF). + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list indicator {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf indicator-value {
+ *     type string;
+ *   }
+ *   leaf source {
+ *     type enumeration {
+ *       enum vnf;
+ *       enum em;
+ *       enum both;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/indicator + * + *

To create instances of this class use {@link IndicatorBuilder}. + * @see IndicatorBuilder + * @see IndicatorKey + * + */ +public interface Indicator + extends + ChildOf, + Augmentable, + Identifiable +{ + + + public enum Source implements Enumeration { + Vnf(0, "vnf"), + + Em(1, "em"), + + Both(2, "both") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Source enumItem : Source.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Source(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Source item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Source item, or null if no such item exists + */ + public static Source forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("indicator"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.Indicator.class; + } + + /** + * Unique identifier. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The human readable name of the VnfIndicator. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Defines the allowed values or value ranges of this indicator. + * + * + * + * @return java.lang.String indicatorValue, or null if not present + */ + @Nullable String getIndicatorValue(); + + /** + * Describe the source of the indicator. The possible values are: • VNF. • EM. • + * Both. This tells the consumer where to send the subscription request. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.Indicator.Source source, or null if not present + */ + @Nullable Source getSource(); + + @Override + IndicatorKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorBuilder.java new file mode 100644 index 0000000..f3e37a1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorBuilder.java @@ -0,0 +1,317 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link IndicatorBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     IndicatorBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new IndicatorBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of IndicatorBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see IndicatorBuilder + * @see Builder + * + */ +public class IndicatorBuilder implements Builder { + + private String _id; + private String _indicatorValue; + private String _name; + private Indicator.Source _source; + private IndicatorKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public IndicatorBuilder() { + } + + public IndicatorBuilder(Indicator base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._indicatorValue = base.getIndicatorValue(); + this._name = base.getName(); + this._source = base.getSource(); + } + + + public IndicatorKey key() { + return key; + } + + public String getId() { + return _id; + } + + public String getIndicatorValue() { + return _indicatorValue; + } + + public String getName() { + return _name; + } + + public Indicator.Source getSource() { + return _source; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public IndicatorBuilder withKey(final IndicatorKey key) { + this.key = key; + return this; + } + + public IndicatorBuilder setId(final String value) { + this._id = value; + return this; + } + + public IndicatorBuilder setIndicatorValue(final String value) { + this._indicatorValue = value; + return this; + } + + public IndicatorBuilder setName(final String value) { + this._name = value; + return this; + } + + public IndicatorBuilder setSource(final Indicator.Source value) { + this._source = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public IndicatorBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public IndicatorBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public IndicatorBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private IndicatorBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Indicator build() { + return new IndicatorImpl(this); + } + + private static final class IndicatorImpl + extends AbstractAugmentable + implements Indicator { + + private final String _id; + private final String _indicatorValue; + private final String _name; + private final Indicator.Source _source; + private final IndicatorKey key; + + IndicatorImpl(IndicatorBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new IndicatorKey(base.getId()); + } + this._id = key.getId(); + this._indicatorValue = base.getIndicatorValue(); + this._name = base.getName(); + this._source = base.getSource(); + } + + @Override + public IndicatorKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getIndicatorValue() { + return _indicatorValue; + } + + @Override + public String getName() { + return _name; + } + + @Override + public Indicator.Source getSource() { + return _source; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_indicatorValue); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_source); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Indicator.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Indicator other = (Indicator)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_indicatorValue, other.getIndicatorValue())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_source, other.getSource())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + IndicatorImpl otherImpl = (IndicatorImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Indicator"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_indicatorValue", _indicatorValue); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_source", _source); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorKey.java new file mode 100644 index 0000000..3276755 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/IndicatorKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class IndicatorKey + implements Identifier { + private static final long serialVersionUID = 2687907149552019284L; + private final String _id; + + + public IndicatorKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public IndicatorKey(IndicatorKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof IndicatorKey)) { + return false; + } + final IndicatorKey other = (IndicatorKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(IndicatorKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevel.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevel.java new file mode 100644 index 0000000..8062017 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevel.java @@ -0,0 +1,149 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.ScalingInfo; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.ScalingInfoKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.VduLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.VduLevelKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the various levels of resources that can be used to instantiate the + * VNF using this flavour. Examples: Small, Medium, Large. If there is only one + * 'instantiationLevel' entry, it shall be treated as the default instantiation + * level for this DF. The InstantiationLevel information element describes a given + * level of resources to be instantiated within a deployment flavour in term of + * number of VNFC instances to be created from each VDU. All the VDUs referenced + * the level shall be part of the corresponding deployment flavour and their + * shall be within the range (min/max) for this deployment flavour. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list instantiation-level {
+ *   key id;
+ *   min-elements 1;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list vdu-level {
+ *     key vdu-id;
+ *     min-elements 1;
+ *     leaf vdu-id {
+ *       type leafref {
+ *         path ../../../../vdu/id;
+ *       }
+ *     }
+ *     leaf number-of-instances {
+ *       type uint16;
+ *       must ". <= ../../../../df/vdu-profile[id=current()/../vdu-id]/max-number-of-instances";
+ *       must ". >= ../../../../df/vdu-profile[id=current()/../vdu-id]/min-number-of-instances";
+ *       default 1;
+ *     }
+ *   }
+ *   list scaling-info {
+ *     key scaling-aspect-id;
+ *     leaf scaling-aspect-id {
+ *       type leafref {
+ *         path ../../../scaling-aspect/id;
+ *       }
+ *     }
+ *     leaf scale-level {
+ *       type uint32;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/instantiation-level + * + *

To create instances of this class use {@link InstantiationLevelBuilder}. + * @see InstantiationLevelBuilder + * @see InstantiationLevelKey + * + */ +public interface InstantiationLevel + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("instantiation-level"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.InstantiationLevel.class; + } + + /** + * Uniquely identifies a level with the DF. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable description of the instantiation level + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Sets the number of instances for the VDU in this instantiation level. + * + * + * + * @return java.util.Map vduLevel, or null if not present + */ + @Nullable Map getVduLevel(); + + /** + * @return java.util.Map vduLevel, or an empty list if it is not present + */ + default @NonNull Map nonnullVduLevel() { + return CodeHelpers.nonnull(getVduLevel()); + } + + /** + * The InstantiationLevel information element describes a given level of resources + * to be instantiated within a DF in term of the number of VNFC instances to be + * created from each VDU. + * + * + * + * @return java.util.Map scalingInfo, or null if not present + */ + @Nullable Map getScalingInfo(); + + /** + * @return java.util.Map scalingInfo, or an empty list if it is not present + */ + default @NonNull Map nonnullScalingInfo() { + return CodeHelpers.nonnull(getScalingInfo()); + } + + @Override + InstantiationLevelKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelBuilder.java new file mode 100644 index 0000000..919665a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelBuilder.java @@ -0,0 +1,356 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.ScalingInfo; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.ScalingInfoKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.VduLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.VduLevelKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link InstantiationLevelBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     InstantiationLevelBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new InstantiationLevelBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of InstantiationLevelBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see InstantiationLevelBuilder + * @see Builder + * + */ +public class InstantiationLevelBuilder implements Builder { + + private String _description; + private String _id; + private Map _scalingInfo; + private Map _vduLevel; + private InstantiationLevelKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public InstantiationLevelBuilder() { + } + + public InstantiationLevelBuilder(InstantiationLevel base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._description = base.getDescription(); + this._scalingInfo = base.getScalingInfo(); + this._vduLevel = base.getVduLevel(); + } + + + public InstantiationLevelKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public Map getScalingInfo() { + return _scalingInfo; + } + + public Map getVduLevel() { + return _vduLevel; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public InstantiationLevelBuilder withKey(final InstantiationLevelKey key) { + this.key = key; + return this; + } + + public InstantiationLevelBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public InstantiationLevelBuilder setId(final String value) { + this._id = value; + return this; + } + public InstantiationLevelBuilder setScalingInfo(final Map values) { + this._scalingInfo = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setScalingInfo(Map)} instead. + */ + @Deprecated(forRemoval = true) + public InstantiationLevelBuilder setScalingInfo(final List values) { + return setScalingInfo(CodeHelpers.compatMap(values)); + } + public InstantiationLevelBuilder setVduLevel(final Map values) { + this._vduLevel = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVduLevel(Map)} instead. + */ + @Deprecated(forRemoval = true) + public InstantiationLevelBuilder setVduLevel(final List values) { + return setVduLevel(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public InstantiationLevelBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public InstantiationLevelBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public InstantiationLevelBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private InstantiationLevelBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public InstantiationLevel build() { + return new InstantiationLevelImpl(this); + } + + private static final class InstantiationLevelImpl + extends AbstractAugmentable + implements InstantiationLevel { + + private final String _description; + private final String _id; + private final Map _scalingInfo; + private final Map _vduLevel; + private final InstantiationLevelKey key; + + InstantiationLevelImpl(InstantiationLevelBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new InstantiationLevelKey(base.getId()); + } + this._id = key.getId(); + this._description = base.getDescription(); + this._scalingInfo = CodeHelpers.emptyToNull(base.getScalingInfo()); + this._vduLevel = CodeHelpers.emptyToNull(base.getVduLevel()); + } + + @Override + public InstantiationLevelKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getScalingInfo() { + return _scalingInfo; + } + + @Override + public Map getVduLevel() { + return _vduLevel; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_scalingInfo); + result = prime * result + Objects.hashCode(_vduLevel); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!InstantiationLevel.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + InstantiationLevel other = (InstantiationLevel)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_scalingInfo, other.getScalingInfo())) { + return false; + } + if (!Objects.equals(_vduLevel, other.getVduLevel())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + InstantiationLevelImpl otherImpl = (InstantiationLevelImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("InstantiationLevel"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_scalingInfo", _scalingInfo); + CodeHelpers.appendValue(helper, "_vduLevel", _vduLevel); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelKey.java new file mode 100644 index 0000000..3a8e870 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/InstantiationLevelKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class InstantiationLevelKey + implements Identifier { + private static final long serialVersionUID = -861901485313746004L; + private final String _id; + + + public InstantiationLevelKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public InstantiationLevelKey(InstantiationLevelKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof InstantiationLevelKey)) { + return false; + } + final InstantiationLevelKey other = (InstantiationLevelKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(InstantiationLevelKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfiguration.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfiguration.java new file mode 100644 index 0000000..441316f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfiguration.java @@ -0,0 +1,241 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeExtVnfConnectivityOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeVnfFlavourOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.HealVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.InstantiateVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.OperateVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfToLevelOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.TerminateVnfOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This information element is a container for all attributes that affect the + * invocation of the VNF Lifecycle Management operations, structured by operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container lcm-operations-configuration {
+ *   container instantiate-vnf-op-config {
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   container scale-vnf-op-config {
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf scaling-by-more-than-one-step-supported {
+ *       type boolean;
+ *       default false;
+ *     }
+ *   }
+ *   container scale-vnf-to-level-op-config {
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf arbitrary-target-levels-supported {
+ *       type boolean;
+ *       default false;
+ *     }
+ *   }
+ *   container heal-vnf-op-config {
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf-list cause {
+ *       type string;
+ *     }
+ *   }
+ *   container terminate-vnf-op-config {
+ *     leaf min-graceful-termination {
+ *       type yang:timeticks;
+ *       default 1;
+ *     }
+ *     leaf max-recommended-graceful-termination {
+ *       type yang:timeticks;
+ *     }
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   container operate-vnf-op-config {
+ *     leaf min-graceful-stop-timeout {
+ *       type yang:timeticks;
+ *       default 1;
+ *     }
+ *     leaf max-recommended-graceful-stop-timeout {
+ *       type yang:timeticks;
+ *     }
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   container change-vnf-flavour-op-config {
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   container change-ext-vnf-connectivity-op-config {
+ *     list parameter {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration + * + *

To create instances of this class use {@link LcmOperationsConfigurationBuilder}. + * @see LcmOperationsConfigurationBuilder + * + */ +public interface LcmOperationsConfiguration + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("lcm-operations-configuration"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration.class; + } + + /** + * Configuration parameters for the InstantiateVnf operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.InstantiateVnfOpConfig instantiateVnfOpConfig, or null if not present + */ + @Nullable InstantiateVnfOpConfig getInstantiateVnfOpConfig(); + + /** + * Configuration parameters for the ScaleVnf operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfOpConfig scaleVnfOpConfig, or null if not present + */ + @Nullable ScaleVnfOpConfig getScaleVnfOpConfig(); + + /** + * This information element defines attributes that affect the invocation of the + * ScaleVnfToLevel operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfToLevelOpConfig scaleVnfToLevelOpConfig, or null if not present + */ + @Nullable ScaleVnfToLevelOpConfig getScaleVnfToLevelOpConfig(); + + /** + * This information element defines attributes that affect the invocation of the + * HealVnf operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.HealVnfOpConfig healVnfOpConfig, or null if not present + */ + @Nullable HealVnfOpConfig getHealVnfOpConfig(); + + /** + * This information element defines attributes that affect the invocation of the + * TerminateVnf operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.TerminateVnfOpConfig terminateVnfOpConfig, or null if not present + */ + @Nullable TerminateVnfOpConfig getTerminateVnfOpConfig(); + + /** + * This information element defines attributes that affect the invocation of the + * OperateVnf operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.OperateVnfOpConfig operateVnfOpConfig, or null if not present + */ + @Nullable OperateVnfOpConfig getOperateVnfOpConfig(); + + /** + * Configuration parameters for the ChangeVnfFlavour operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeVnfFlavourOpConfig changeVnfFlavourOpConfig, or null if not present + */ + @Nullable ChangeVnfFlavourOpConfig getChangeVnfFlavourOpConfig(); + + /** + * Configuration parameters for the ChangeExtVnfConnectivity operation. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeExtVnfConnectivityOpConfig changeExtVnfConnectivityOpConfig, or null if not present + */ + @Nullable ChangeExtVnfConnectivityOpConfig getChangeExtVnfConnectivityOpConfig(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfigurationBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfigurationBuilder.java new file mode 100644 index 0000000..6f4f4d1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/LcmOperationsConfigurationBuilder.java @@ -0,0 +1,396 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeExtVnfConnectivityOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeVnfFlavourOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.HealVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.InstantiateVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.OperateVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfToLevelOpConfig; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.TerminateVnfOpConfig; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link LcmOperationsConfigurationBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     LcmOperationsConfigurationBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new LcmOperationsConfigurationBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of LcmOperationsConfigurationBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see LcmOperationsConfigurationBuilder + * @see Builder + * + */ +public class LcmOperationsConfigurationBuilder implements Builder { + + private ChangeExtVnfConnectivityOpConfig _changeExtVnfConnectivityOpConfig; + private ChangeVnfFlavourOpConfig _changeVnfFlavourOpConfig; + private HealVnfOpConfig _healVnfOpConfig; + private InstantiateVnfOpConfig _instantiateVnfOpConfig; + private OperateVnfOpConfig _operateVnfOpConfig; + private ScaleVnfOpConfig _scaleVnfOpConfig; + private ScaleVnfToLevelOpConfig _scaleVnfToLevelOpConfig; + private TerminateVnfOpConfig _terminateVnfOpConfig; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public LcmOperationsConfigurationBuilder() { + } + + public LcmOperationsConfigurationBuilder(LcmOperationsConfiguration base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._changeExtVnfConnectivityOpConfig = base.getChangeExtVnfConnectivityOpConfig(); + this._changeVnfFlavourOpConfig = base.getChangeVnfFlavourOpConfig(); + this._healVnfOpConfig = base.getHealVnfOpConfig(); + this._instantiateVnfOpConfig = base.getInstantiateVnfOpConfig(); + this._operateVnfOpConfig = base.getOperateVnfOpConfig(); + this._scaleVnfOpConfig = base.getScaleVnfOpConfig(); + this._scaleVnfToLevelOpConfig = base.getScaleVnfToLevelOpConfig(); + this._terminateVnfOpConfig = base.getTerminateVnfOpConfig(); + } + + + public ChangeExtVnfConnectivityOpConfig getChangeExtVnfConnectivityOpConfig() { + return _changeExtVnfConnectivityOpConfig; + } + + public ChangeVnfFlavourOpConfig getChangeVnfFlavourOpConfig() { + return _changeVnfFlavourOpConfig; + } + + public HealVnfOpConfig getHealVnfOpConfig() { + return _healVnfOpConfig; + } + + public InstantiateVnfOpConfig getInstantiateVnfOpConfig() { + return _instantiateVnfOpConfig; + } + + public OperateVnfOpConfig getOperateVnfOpConfig() { + return _operateVnfOpConfig; + } + + public ScaleVnfOpConfig getScaleVnfOpConfig() { + return _scaleVnfOpConfig; + } + + public ScaleVnfToLevelOpConfig getScaleVnfToLevelOpConfig() { + return _scaleVnfToLevelOpConfig; + } + + public TerminateVnfOpConfig getTerminateVnfOpConfig() { + return _terminateVnfOpConfig; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public LcmOperationsConfigurationBuilder setChangeExtVnfConnectivityOpConfig(final ChangeExtVnfConnectivityOpConfig value) { + this._changeExtVnfConnectivityOpConfig = value; + return this; + } + + public LcmOperationsConfigurationBuilder setChangeVnfFlavourOpConfig(final ChangeVnfFlavourOpConfig value) { + this._changeVnfFlavourOpConfig = value; + return this; + } + + public LcmOperationsConfigurationBuilder setHealVnfOpConfig(final HealVnfOpConfig value) { + this._healVnfOpConfig = value; + return this; + } + + public LcmOperationsConfigurationBuilder setInstantiateVnfOpConfig(final InstantiateVnfOpConfig value) { + this._instantiateVnfOpConfig = value; + return this; + } + + public LcmOperationsConfigurationBuilder setOperateVnfOpConfig(final OperateVnfOpConfig value) { + this._operateVnfOpConfig = value; + return this; + } + + public LcmOperationsConfigurationBuilder setScaleVnfOpConfig(final ScaleVnfOpConfig value) { + this._scaleVnfOpConfig = value; + return this; + } + + public LcmOperationsConfigurationBuilder setScaleVnfToLevelOpConfig(final ScaleVnfToLevelOpConfig value) { + this._scaleVnfToLevelOpConfig = value; + return this; + } + + public LcmOperationsConfigurationBuilder setTerminateVnfOpConfig(final TerminateVnfOpConfig value) { + this._terminateVnfOpConfig = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public LcmOperationsConfigurationBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public LcmOperationsConfigurationBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public LcmOperationsConfigurationBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private LcmOperationsConfigurationBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public LcmOperationsConfiguration build() { + return new LcmOperationsConfigurationImpl(this); + } + + private static final class LcmOperationsConfigurationImpl + extends AbstractAugmentable + implements LcmOperationsConfiguration { + + private final ChangeExtVnfConnectivityOpConfig _changeExtVnfConnectivityOpConfig; + private final ChangeVnfFlavourOpConfig _changeVnfFlavourOpConfig; + private final HealVnfOpConfig _healVnfOpConfig; + private final InstantiateVnfOpConfig _instantiateVnfOpConfig; + private final OperateVnfOpConfig _operateVnfOpConfig; + private final ScaleVnfOpConfig _scaleVnfOpConfig; + private final ScaleVnfToLevelOpConfig _scaleVnfToLevelOpConfig; + private final TerminateVnfOpConfig _terminateVnfOpConfig; + + LcmOperationsConfigurationImpl(LcmOperationsConfigurationBuilder base) { + super(base.augmentation); + this._changeExtVnfConnectivityOpConfig = base.getChangeExtVnfConnectivityOpConfig(); + this._changeVnfFlavourOpConfig = base.getChangeVnfFlavourOpConfig(); + this._healVnfOpConfig = base.getHealVnfOpConfig(); + this._instantiateVnfOpConfig = base.getInstantiateVnfOpConfig(); + this._operateVnfOpConfig = base.getOperateVnfOpConfig(); + this._scaleVnfOpConfig = base.getScaleVnfOpConfig(); + this._scaleVnfToLevelOpConfig = base.getScaleVnfToLevelOpConfig(); + this._terminateVnfOpConfig = base.getTerminateVnfOpConfig(); + } + + @Override + public ChangeExtVnfConnectivityOpConfig getChangeExtVnfConnectivityOpConfig() { + return _changeExtVnfConnectivityOpConfig; + } + + @Override + public ChangeVnfFlavourOpConfig getChangeVnfFlavourOpConfig() { + return _changeVnfFlavourOpConfig; + } + + @Override + public HealVnfOpConfig getHealVnfOpConfig() { + return _healVnfOpConfig; + } + + @Override + public InstantiateVnfOpConfig getInstantiateVnfOpConfig() { + return _instantiateVnfOpConfig; + } + + @Override + public OperateVnfOpConfig getOperateVnfOpConfig() { + return _operateVnfOpConfig; + } + + @Override + public ScaleVnfOpConfig getScaleVnfOpConfig() { + return _scaleVnfOpConfig; + } + + @Override + public ScaleVnfToLevelOpConfig getScaleVnfToLevelOpConfig() { + return _scaleVnfToLevelOpConfig; + } + + @Override + public TerminateVnfOpConfig getTerminateVnfOpConfig() { + return _terminateVnfOpConfig; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_changeExtVnfConnectivityOpConfig); + result = prime * result + Objects.hashCode(_changeVnfFlavourOpConfig); + result = prime * result + Objects.hashCode(_healVnfOpConfig); + result = prime * result + Objects.hashCode(_instantiateVnfOpConfig); + result = prime * result + Objects.hashCode(_operateVnfOpConfig); + result = prime * result + Objects.hashCode(_scaleVnfOpConfig); + result = prime * result + Objects.hashCode(_scaleVnfToLevelOpConfig); + result = prime * result + Objects.hashCode(_terminateVnfOpConfig); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!LcmOperationsConfiguration.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + LcmOperationsConfiguration other = (LcmOperationsConfiguration)obj; + if (!Objects.equals(_changeExtVnfConnectivityOpConfig, other.getChangeExtVnfConnectivityOpConfig())) { + return false; + } + if (!Objects.equals(_changeVnfFlavourOpConfig, other.getChangeVnfFlavourOpConfig())) { + return false; + } + if (!Objects.equals(_healVnfOpConfig, other.getHealVnfOpConfig())) { + return false; + } + if (!Objects.equals(_instantiateVnfOpConfig, other.getInstantiateVnfOpConfig())) { + return false; + } + if (!Objects.equals(_operateVnfOpConfig, other.getOperateVnfOpConfig())) { + return false; + } + if (!Objects.equals(_scaleVnfOpConfig, other.getScaleVnfOpConfig())) { + return false; + } + if (!Objects.equals(_scaleVnfToLevelOpConfig, other.getScaleVnfToLevelOpConfig())) { + return false; + } + if (!Objects.equals(_terminateVnfOpConfig, other.getTerminateVnfOpConfig())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + LcmOperationsConfigurationImpl otherImpl = (LcmOperationsConfigurationImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LcmOperationsConfiguration"); + CodeHelpers.appendValue(helper, "_changeExtVnfConnectivityOpConfig", _changeExtVnfConnectivityOpConfig); + CodeHelpers.appendValue(helper, "_changeVnfFlavourOpConfig", _changeVnfFlavourOpConfig); + CodeHelpers.appendValue(helper, "_healVnfOpConfig", _healVnfOpConfig); + CodeHelpers.appendValue(helper, "_instantiateVnfOpConfig", _instantiateVnfOpConfig); + CodeHelpers.appendValue(helper, "_operateVnfOpConfig", _operateVnfOpConfig); + CodeHelpers.appendValue(helper, "_scaleVnfOpConfig", _scaleVnfOpConfig); + CodeHelpers.appendValue(helper, "_scaleVnfToLevelOpConfig", _scaleVnfToLevelOpConfig); + CodeHelpers.appendValue(helper, "_terminateVnfOpConfig", _terminateVnfOpConfig); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameter.java new file mode 100644 index 0000000..8b52ec4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameter.java @@ -0,0 +1,65 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Defines the virtualised resources monitoring parameters on VNF level. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list monitoring-parameter {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   uses monitoring-parameter;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/monitoring-parameter + * + *

To create instances of this class use {@link MonitoringParameterBuilder}. + * @see MonitoringParameterBuilder + * @see MonitoringParameterKey + * + */ +public interface MonitoringParameter + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitoring-parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.MonitoringParameter.class; + } + + /** + * Unique identifier of the monitoring parameter. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + MonitoringParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterBuilder.java new file mode 100644 index 0000000..5093145 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterBuilder.java @@ -0,0 +1,355 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link MonitoringParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MonitoringParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MonitoringParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MonitoringParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MonitoringParameterBuilder + * @see Builder + * + */ +public class MonitoringParameterBuilder implements Builder { + + private Uint64 _collectionPeriod; + private String _id; + private String _name; + private String _performanceMetric; + private MonitoringParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MonitoringParameterBuilder() { + } + public MonitoringParameterBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter arg) { + this._name = arg.getName(); + this._performanceMetric = arg.getPerformanceMetric(); + this._collectionPeriod = arg.getCollectionPeriod(); + } + + public MonitoringParameterBuilder(MonitoringParameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._collectionPeriod = base.getCollectionPeriod(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter) { + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getName(); + this._performanceMetric = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getPerformanceMetric(); + this._collectionPeriod = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getCollectionPeriod(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter]"); + } + + public MonitoringParameterKey key() { + return key; + } + + public Uint64 getCollectionPeriod() { + return _collectionPeriod; + } + + public String getId() { + return _id; + } + + public String getName() { + return _name; + } + + public String getPerformanceMetric() { + return _performanceMetric; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public MonitoringParameterBuilder withKey(final MonitoringParameterKey key) { + this.key = key; + return this; + } + + public MonitoringParameterBuilder setCollectionPeriod(final Uint64 value) { + this._collectionPeriod = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setCollectionPeriod(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoringParameterBuilder setCollectionPeriod(final BigInteger value) { + return setCollectionPeriod(CodeHelpers.compatUint(value)); + } + + public MonitoringParameterBuilder setId(final String value) { + this._id = value; + return this; + } + + public MonitoringParameterBuilder setName(final String value) { + this._name = value; + return this; + } + + public MonitoringParameterBuilder setPerformanceMetric(final String value) { + this._performanceMetric = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MonitoringParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoringParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MonitoringParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MonitoringParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MonitoringParameter build() { + return new MonitoringParameterImpl(this); + } + + private static final class MonitoringParameterImpl + extends AbstractAugmentable + implements MonitoringParameter { + + private final Uint64 _collectionPeriod; + private final String _id; + private final String _name; + private final String _performanceMetric; + private final MonitoringParameterKey key; + + MonitoringParameterImpl(MonitoringParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new MonitoringParameterKey(base.getId()); + } + this._id = key.getId(); + this._collectionPeriod = base.getCollectionPeriod(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + @Override + public MonitoringParameterKey key() { + return key; + } + + @Override + public Uint64 getCollectionPeriod() { + return _collectionPeriod; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getPerformanceMetric() { + return _performanceMetric; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_collectionPeriod); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_performanceMetric); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MonitoringParameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MonitoringParameter other = (MonitoringParameter)obj; + if (!Objects.equals(_collectionPeriod, other.getCollectionPeriod())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_performanceMetric, other.getPerformanceMetric())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MonitoringParameterImpl otherImpl = (MonitoringParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MonitoringParameter"); + CodeHelpers.appendValue(helper, "_collectionPeriod", _collectionPeriod); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_performanceMetric", _performanceMetric); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterKey.java new file mode 100644 index 0000000..8c31fec --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/MonitoringParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class MonitoringParameterKey + implements Identifier { + private static final long serialVersionUID = 7526161979845181524L; + private final String _id; + + + public MonitoringParameterKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public MonitoringParameterKey(MonitoringParameterKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof MonitoringParameterKey)) { + return false; + } + final MonitoringParameterKey other = (MonitoringParameterKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(MonitoringParameterKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspect.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspect.java new file mode 100644 index 0000000..4aa767e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspect.java @@ -0,0 +1,165 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.AspectDeltaDetails; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * The scaling aspects supported by this DF of the VNF. scalingAspect shall be + * present if the VNF supports scaling. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list scaling-aspect {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   leaf max-scale-level {
+ *     type uint32 {
+ *       range 1..max;
+ *     }
+ *   }
+ *   container aspect-delta-details {
+ *     list deltas {
+ *       key id;
+ *       min-elements 1;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       list vdu-delta {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../../../../vdu/id;
+ *           }
+ *         }
+ *         leaf number-of-instances {
+ *           type uint32 {
+ *             range 0..max;
+ *           }
+ *         }
+ *       }
+ *       list virtual-link-bit-rate-delta {
+ *         key id;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         container bit-rate-requirements {
+ *           leaf root {
+ *             type uint32;
+ *             units bits/sec;
+ *           }
+ *           leaf leaf {
+ *             type uint32;
+ *             units bits/sec;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     leaf step-deltas {
+ *       type leafref {
+ *         path ../deltas/id;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/scaling-aspect + * + *

To create instances of this class use {@link ScalingAspectBuilder}. + * @see ScalingAspectBuilder + * @see ScalingAspectKey + * + */ +public interface ScalingAspect + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scaling-aspect"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.ScalingAspect.class; + } + + /** + * Unique identifier of this aspect in the VNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable name of the aspect. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Human readable description of the aspect. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * The maximum scaleLevel for total number of scaling steps that can be applied + * w.r.t. this aspect. The value of this attribute corresponds to the number of + * scaling steps can be applied to this aspect when scaling it from the minimum + * scale level (i.e. 0) to the maximum scale level defined by this attribute. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 maxScaleLevel, or null if not present + */ + @Nullable Uint32 getMaxScaleLevel(); + + /** + * A specification of the deltas in terms of number of instances of VNFCs and + * virtual link bit rates that correspond to the scaling steps of this aspect. A + * cardinality of zero indicates that this mapping has to be specified in a + * lifecycle management script or be otherwise known to the VNFM. The information + * in this attribute, if provided, shall be consistent with the information + * provided in the 'InstantiationLevel' information element. If this attribute is + * provided, it shall be provided for all scaling aspects. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.AspectDeltaDetails aspectDeltaDetails, or null if not present + */ + @Nullable AspectDeltaDetails getAspectDeltaDetails(); + + @Override + ScalingAspectKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectBuilder.java new file mode 100644 index 0000000..9e37d56 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectBuilder.java @@ -0,0 +1,366 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.AspectDeltaDetails; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link ScalingAspectBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ScalingAspectBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ScalingAspectBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ScalingAspectBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ScalingAspectBuilder + * @see Builder + * + */ +public class ScalingAspectBuilder implements Builder { + + private AspectDeltaDetails _aspectDeltaDetails; + private String _description; + private String _id; + private Uint32 _maxScaleLevel; + private String _name; + private ScalingAspectKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ScalingAspectBuilder() { + } + + public ScalingAspectBuilder(ScalingAspect base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._aspectDeltaDetails = base.getAspectDeltaDetails(); + this._description = base.getDescription(); + this._maxScaleLevel = base.getMaxScaleLevel(); + this._name = base.getName(); + } + + + public ScalingAspectKey key() { + return key; + } + + public AspectDeltaDetails getAspectDeltaDetails() { + return _aspectDeltaDetails; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public Uint32 getMaxScaleLevel() { + return _maxScaleLevel; + } + + public String getName() { + return _name; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ScalingAspectBuilder withKey(final ScalingAspectKey key) { + this.key = key; + return this; + } + + public ScalingAspectBuilder setAspectDeltaDetails(final AspectDeltaDetails value) { + this._aspectDeltaDetails = value; + return this; + } + + public ScalingAspectBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public ScalingAspectBuilder setId(final String value) { + this._id = value; + return this; + } + + private static void checkMaxScaleLevelRange(final long value) { + if (value >= 1L) { + return; + } + CodeHelpers.throwInvalidRange("[[1..4294967295]]", value); + } + + public ScalingAspectBuilder setMaxScaleLevel(final Uint32 value) { + if (value != null) { + checkMaxScaleLevelRange(value.longValue()); + + } + this._maxScaleLevel = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMaxScaleLevel(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public ScalingAspectBuilder setMaxScaleLevel(final Long value) { + return setMaxScaleLevel(CodeHelpers.compatUint(value)); + } + + public ScalingAspectBuilder setName(final String value) { + this._name = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ScalingAspectBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ScalingAspectBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ScalingAspectBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ScalingAspectBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ScalingAspect build() { + return new ScalingAspectImpl(this); + } + + private static final class ScalingAspectImpl + extends AbstractAugmentable + implements ScalingAspect { + + private final AspectDeltaDetails _aspectDeltaDetails; + private final String _description; + private final String _id; + private final Uint32 _maxScaleLevel; + private final String _name; + private final ScalingAspectKey key; + + ScalingAspectImpl(ScalingAspectBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ScalingAspectKey(base.getId()); + } + this._id = key.getId(); + this._aspectDeltaDetails = base.getAspectDeltaDetails(); + this._description = base.getDescription(); + this._maxScaleLevel = base.getMaxScaleLevel(); + this._name = base.getName(); + } + + @Override + public ScalingAspectKey key() { + return key; + } + + @Override + public AspectDeltaDetails getAspectDeltaDetails() { + return _aspectDeltaDetails; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Uint32 getMaxScaleLevel() { + return _maxScaleLevel; + } + + @Override + public String getName() { + return _name; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_aspectDeltaDetails); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_maxScaleLevel); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ScalingAspect.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ScalingAspect other = (ScalingAspect)obj; + if (!Objects.equals(_aspectDeltaDetails, other.getAspectDeltaDetails())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_maxScaleLevel, other.getMaxScaleLevel())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ScalingAspectImpl otherImpl = (ScalingAspectImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ScalingAspect"); + CodeHelpers.appendValue(helper, "_aspectDeltaDetails", _aspectDeltaDetails); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_maxScaleLevel", _maxScaleLevel); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectKey.java new file mode 100644 index 0000000..bd62e2c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/ScalingAspectKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ScalingAspectKey + implements Identifier { + private static final long serialVersionUID = 2014464420224184770L; + private final String _id; + + + public ScalingAspectKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ScalingAspectKey(ScalingAspectKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ScalingAspectKey)) { + return false; + } + final ScalingAspectKey other = (ScalingAspectKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ScalingAspectKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfaces.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfaces.java new file mode 100644 index 0000000..f5314f7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfaces.java @@ -0,0 +1,175 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces.InterfaceDetails; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces.InterfaceDetailsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Indicates which interfaces the VNF produces and provides additional details on + * how to access the interface endpoints. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list supported-vnf-interfaces {
+ *   key name;
+ *   leaf name {
+ *     type enumeration {
+ *       enum vnf-configuration;
+ *       enum vnf-indicator;
+ *     }
+ *   }
+ *   leaf-list cpd-id {
+ *     type leafref {
+ *       path ../../../ext-cpd/id;
+ *     }
+ *   }
+ *   list interface-details {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/supported-vnf-interfaces + * + *

To create instances of this class use {@link SupportedVnfInterfacesBuilder}. + * @see SupportedVnfInterfacesBuilder + * @see SupportedVnfInterfacesKey + * + */ +public interface SupportedVnfInterfaces + extends + ChildOf, + Augmentable, + Identifiable +{ + + + public enum Name implements Enumeration { + VnfConfiguration(0, "vnf-configuration"), + + VnfIndicator(1, "vnf-indicator") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Name enumItem : Name.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Name(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Name item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Name item, or null if no such item exists + */ + public static Name forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("supported-vnf-interfaces"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.SupportedVnfInterfaces.class; + } + + /** + * Identifies an interface produced by the VNF. Valid values: - VNF_CONFIGURATION - + * VNF_INDICATOR + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.SupportedVnfInterfaces.Name name, or null if not present + */ + @Nullable Name getName(); + + /** + * References one or more CPDs from which to instantiate external CPs through which + * interface endpoints on the VNF side can be reached by the VNFM. + * + * + * + * @return java.util.List cpdId, or null if not present + */ + @Nullable List getCpdId(); + + /** + * @return java.util.Map interfaceDetails, or null if not present + */ + @Nullable Map getInterfaceDetails(); + + /** + * @return java.util.Map interfaceDetails, or an empty list if it is not present + */ + default @NonNull Map nonnullInterfaceDetails() { + return CodeHelpers.nonnull(getInterfaceDetails()); + } + + @Override + SupportedVnfInterfacesKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesBuilder.java new file mode 100644 index 0000000..482b6e4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesBuilder.java @@ -0,0 +1,315 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces.InterfaceDetails; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces.InterfaceDetailsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link SupportedVnfInterfacesBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SupportedVnfInterfacesBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SupportedVnfInterfacesBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SupportedVnfInterfacesBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SupportedVnfInterfacesBuilder + * @see Builder + * + */ +public class SupportedVnfInterfacesBuilder implements Builder { + + private List _cpdId; + private Map _interfaceDetails; + private SupportedVnfInterfaces.Name _name; + private SupportedVnfInterfacesKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SupportedVnfInterfacesBuilder() { + } + + public SupportedVnfInterfacesBuilder(SupportedVnfInterfaces base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._name = base.getName(); + this._cpdId = base.getCpdId(); + this._interfaceDetails = base.getInterfaceDetails(); + } + + + public SupportedVnfInterfacesKey key() { + return key; + } + + public List getCpdId() { + return _cpdId; + } + + public Map getInterfaceDetails() { + return _interfaceDetails; + } + + public SupportedVnfInterfaces.Name getName() { + return _name; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public SupportedVnfInterfacesBuilder withKey(final SupportedVnfInterfacesKey key) { + this.key = key; + return this; + } + public SupportedVnfInterfacesBuilder setCpdId(final List values) { + this._cpdId = values; + return this; + } + + public SupportedVnfInterfacesBuilder setInterfaceDetails(final Map values) { + this._interfaceDetails = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setInterfaceDetails(Map)} instead. + */ + @Deprecated(forRemoval = true) + public SupportedVnfInterfacesBuilder setInterfaceDetails(final List values) { + return setInterfaceDetails(CodeHelpers.compatMap(values)); + } + + public SupportedVnfInterfacesBuilder setName(final SupportedVnfInterfaces.Name value) { + this._name = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SupportedVnfInterfacesBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SupportedVnfInterfacesBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SupportedVnfInterfacesBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SupportedVnfInterfacesBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public SupportedVnfInterfaces build() { + return new SupportedVnfInterfacesImpl(this); + } + + private static final class SupportedVnfInterfacesImpl + extends AbstractAugmentable + implements SupportedVnfInterfaces { + + private final List _cpdId; + + private final Map _interfaceDetails; + private final SupportedVnfInterfaces.Name _name; + private final SupportedVnfInterfacesKey key; + + SupportedVnfInterfacesImpl(SupportedVnfInterfacesBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new SupportedVnfInterfacesKey(base.getName()); + } + this._name = key.getName(); + this._cpdId = base.getCpdId(); + this._interfaceDetails = CodeHelpers.emptyToNull(base.getInterfaceDetails()); + } + + @Override + public SupportedVnfInterfacesKey key() { + return key; + } + + @Override + public List getCpdId() { + return _cpdId; + } + + @Override + public Map getInterfaceDetails() { + return _interfaceDetails; + } + + @Override + public SupportedVnfInterfaces.Name getName() { + return _name; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpdId); + result = prime * result + Objects.hashCode(_interfaceDetails); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!SupportedVnfInterfaces.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + SupportedVnfInterfaces other = (SupportedVnfInterfaces)obj; + if (!Objects.equals(_cpdId, other.getCpdId())) { + return false; + } + if (!Objects.equals(_interfaceDetails, other.getInterfaceDetails())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SupportedVnfInterfacesImpl otherImpl = (SupportedVnfInterfacesImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("SupportedVnfInterfaces"); + CodeHelpers.appendValue(helper, "_cpdId", _cpdId); + CodeHelpers.appendValue(helper, "_interfaceDetails", _interfaceDetails); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesKey.java new file mode 100644 index 0000000..2b50ecb --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/SupportedVnfInterfacesKey.java @@ -0,0 +1,76 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.KeyDeserializer; +import com.google.common.base.MoreObjects; + +import java.io.IOException; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class SupportedVnfInterfacesKey extends KeyDeserializer + implements Identifier { + private static final long serialVersionUID = -2854504684379865139L; + private final SupportedVnfInterfaces.Name _name; + + + public SupportedVnfInterfacesKey() { + this._name = null; + } + + public SupportedVnfInterfacesKey(SupportedVnfInterfaces.Name _name) { + + this._name = _name; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public SupportedVnfInterfacesKey(SupportedVnfInterfacesKey source) { + this._name = source._name; + } + + + public SupportedVnfInterfaces.Name getName() { + return _name; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_name); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SupportedVnfInterfacesKey)) { + return false; + } + final SupportedVnfInterfacesKey other = (SupportedVnfInterfacesKey) obj; + if (!Objects.equals(_name, other._name)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(SupportedVnfInterfacesKey.class); + CodeHelpers.appendValue(helper, "_name", _name); + return helper.toString(); + } + + @Override + public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException { + // TODO Auto-generated method stub + return this.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfile.java new file mode 100644 index 0000000..34ac515 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfile.java @@ -0,0 +1,125 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VduProfileBuilder.VduProfileImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The Vduprofile describes additional instantiation data for a given VDU used in + * deployment flavour. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vdu-profile {
+ *   key id;
+ *   min-elements 1;
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../vdu/id;
+ *     }
+ *   }
+ *   leaf min-number-of-instances {
+ *     type uint16;
+ *     default 1;
+ *   }
+ *   leaf max-number-of-instances {
+ *     type uint16;
+ *     default 1;
+ *     must ". >= ../min-number-of-instances";
+ *   }
+ *   uses local-affinity-or-anti-affinity-rule;
+ *   list affinity-or-anti-affinity-group {
+ *     key id;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../affinity-or-anti-affinity-group/id;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/vdu-profile + * + *

To create instances of this class use {@link VduProfileBuilder}. + * @see VduProfileBuilder + * @see VduProfileKey + * + */ +@JsonDeserialize(as = VduProfileImpl.class) +@JsonIgnoreProperties(value = {"localAffinityOrAntiAffinityRule"}, ignoreUnknown = true) +public interface VduProfile + extends + ChildOf, + Augmentable, + LocalAffinityOrAntiAffinityRule, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VduProfile.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Minimum number of instances of the VNFC based on this VDU that is permitted to + * exist for this flavour. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 minNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMinNumberOfInstances(); + + /** + * @return org.opendaylight.yangtools.yang.common.Uint16 maxNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMaxNumberOfInstances(); + + /** + * Identifier(s) of the affinity or anti-affinity group(s) the VDU belongs to. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroup, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroup(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroup() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroup()); + } + + @Override + VduProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileBuilder.java new file mode 100644 index 0000000..c108b16 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileBuilder.java @@ -0,0 +1,433 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRuleBuilder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link VduProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VduProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VduProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VduProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VduProfileBuilder + * @see Builder + * + */ +public class VduProfileBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroup; + private String _id; + private Map _localAffinityOrAntiAffinityRule; + private Uint16 _maxNumberOfInstances; + private Uint16 _minNumberOfInstances; + private VduProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VduProfileBuilder() { + } + public VduProfileBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule arg) { + this._localAffinityOrAntiAffinityRule = arg.getLocalAffinityOrAntiAffinityRule(); + } + + public VduProfileBuilder(VduProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroup = base.getAffinityOrAntiAffinityGroup(); + this._localAffinityOrAntiAffinityRule = base.getLocalAffinityOrAntiAffinityRule(); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule) { + this._localAffinityOrAntiAffinityRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule)arg).getLocalAffinityOrAntiAffinityRule(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule]"); + } + + public VduProfileKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + public String getId() { + return _id; + } + + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VduProfileBuilder withKey(final VduProfileKey key) { + this.key = key; + return this; + } + public VduProfileBuilder setAffinityOrAntiAffinityGroup(final Map values) { + this._affinityOrAntiAffinityGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VduProfileBuilder setAffinityOrAntiAffinityGroup(final List values) { + return setAffinityOrAntiAffinityGroup(CodeHelpers.compatMap(values)); + } + + public VduProfileBuilder setId(final String value) { + this._id = value; + return this; + } + public VduProfileBuilder setLocalAffinityOrAntiAffinityRule(final Map values) { + this._localAffinityOrAntiAffinityRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLocalAffinityOrAntiAffinityRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VduProfileBuilder setLocalAffinityOrAntiAffinityRule(final List values) { + return setLocalAffinityOrAntiAffinityRule(CodeHelpers.compatMap(values)); + } + + public VduProfileBuilder setMaxNumberOfInstances(final Uint16 value) { + this._maxNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMaxNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public VduProfileBuilder setMaxNumberOfInstances(final Integer value) { + return setMaxNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public VduProfileBuilder setMinNumberOfInstances(final Uint16 value) { + this._minNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMinNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public VduProfileBuilder setMinNumberOfInstances(final Integer value) { + return setMinNumberOfInstances(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VduProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VduProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VduProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VduProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VduProfile build() { + return new VduProfileImpl(this); + } + + public static final class VduProfileImpl + extends AbstractAugmentable + implements VduProfile { + + private final Map _affinityOrAntiAffinityGroup; + private final String _id; + @JsonDeserialize(keyUsing = LocalAffinityOrAntiAffinityRuleKey.class) + private final Map _localAffinityOrAntiAffinityRule; + private final Uint16 _maxNumberOfInstances; + private final Uint16 _minNumberOfInstances; + private final VduProfileKey key; + + VduProfileImpl(VduProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VduProfileKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroup = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroup()); + this._localAffinityOrAntiAffinityRule = CodeHelpers.emptyToNull(base.getLocalAffinityOrAntiAffinityRule()); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + } + + public VduProfileImpl() { + this( new VduProfileBuilder()); + } + + @Override + public VduProfileKey key() { + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + @Override + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + @Override + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroup); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_localAffinityOrAntiAffinityRule); + result = prime * result + Objects.hashCode(_maxNumberOfInstances); + result = prime * result + Objects.hashCode(_minNumberOfInstances); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VduProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VduProfile other = (VduProfile)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroup, other.getAffinityOrAntiAffinityGroup())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_localAffinityOrAntiAffinityRule, other.getLocalAffinityOrAntiAffinityRule())) { + return false; + } + if (!Objects.equals(_maxNumberOfInstances, other.getMaxNumberOfInstances())) { + return false; + } + if (!Objects.equals(_minNumberOfInstances, other.getMinNumberOfInstances())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VduProfileImpl otherImpl = (VduProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VduProfile"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroup", _affinityOrAntiAffinityGroup); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_localAffinityOrAntiAffinityRule", _localAffinityOrAntiAffinityRule); + CodeHelpers.appendValue(helper, "_maxNumberOfInstances", _maxNumberOfInstances); + CodeHelpers.appendValue(helper, "_minNumberOfInstances", _minNumberOfInstances); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileKey.java new file mode 100644 index 0000000..195989f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VduProfileKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VduProfileKey + implements Identifier { + private static final long serialVersionUID = -5202129500566804515L; + private final String _id; + + + public VduProfileKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VduProfileKey(VduProfileKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VduProfileKey)) { + return false; + } + final VduProfileKey other = (VduProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VduProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfile.java new file mode 100644 index 0000000..6de00da --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfile.java @@ -0,0 +1,229 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import java.lang.Class; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduBuilder.VduImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfileBuilder.VirtualLinkProfileImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MaxBitRateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MinBitRateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.VirtualLinkProtocolData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Defines the internal VLD along with additional data which is used in this DF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-profile {
+ *   key "id flavour";
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../int-virtual-link-desc/id;
+ *     }
+ *   }
+ *   leaf flavour {
+ *     type leafref {
+ *       path ../../../flavour/id;
+ *     }
+ *   }
+ *   uses local-affinity-or-anti-affinity-rule;
+ *   list affinity-or-anti-affinity-group {
+ *     key id;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../affinity-or-anti-affinity-group/id;
+ *       }
+ *     }
+ *   }
+ *   container max-bit-rate-requirements {
+ *     leaf root {
+ *       type uint32;
+ *     }
+ *     leaf leaf {
+ *       type uint32;
+ *     }
+ *   }
+ *   container min-bit-rate-requirements {
+ *     leaf root {
+ *       type uint32;
+ *     }
+ *     leaf leaf {
+ *       type uint32;
+ *     }
+ *   }
+ *   container virtual-link-protocol-data {
+ *     leaf associated-layer-protocol {
+ *       type identityref {
+ *         base layer-protocol;
+ *       }
+ *     }
+ *     container l2-protocol-data {
+ *       when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf network-type {
+ *         type enumeration {
+ *           enum flat;
+ *           enum vlan;
+ *           enum vxlan;
+ *           enum gre;
+ *         }
+ *       }
+ *       leaf vlan-transparent {
+ *         type boolean;
+ *       }
+ *       leaf mtu {
+ *         type uint16;
+ *       }
+ *     }
+ *     container l3-protocol-data {
+ *       when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf ip-version {
+ *         type enumeration {
+ *           enum ipv4;
+ *           enum ipv6;
+ *         }
+ *         default ipv4;
+ *       }
+ *       leaf cidr {
+ *         type string;
+ *       }
+ *       leaf-list ip-allocation-pools {
+ *         type string;
+ *       }
+ *       leaf gateway-ip {
+ *         type inet:ip-address;
+ *       }
+ *       leaf dhcp-enabled {
+ *         type boolean;
+ *         default true;
+ *       }
+ *       leaf ipv6-address-mode {
+ *         when "../ip-version = 'ipv6'";
+ *         type enumeration {
+ *           enum slaac;
+ *           enum dhcpv6-stateful;
+ *           enum dhcpv6-stateless;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/virtual-link-profile + * + *

To create instances of this class use {@link VirtualLinkProfileBuilder}. + * @see VirtualLinkProfileBuilder + * @see VirtualLinkProfileKey + * + */ +@JsonDeserialize(as = VirtualLinkProfileImpl.class) +@JsonIgnoreProperties(value = {"localAffinityOrAntiAffinityRule"}, ignoreUnknown = true) +public interface VirtualLinkProfile + extends + ChildOf, + Augmentable, + LocalAffinityOrAntiAffinityRule, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfile.class; + } + + /** + * Uniquely identifies a Vnf VLD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Identifies a flavour within the VnfVirtualLinkDesc. + * + * + * + * @return java.lang.Object flavour, or null if not present + */ + @Nullable Object getFlavour(); + + /** + * Identifier(s) of the affinity or anti-affinity group(s) the VnfVirtualLinkDesc + * belongs to. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroup, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroup(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroup() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroup()); + } + + /** + * Specifies the maximum bitrate requirements for a VL instantiated according to + * this profile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MaxBitRateRequirements maxBitRateRequirements, or null if not present + */ + @Nullable MaxBitRateRequirements getMaxBitRateRequirements(); + + /** + * Specifies the minimum bitrate requirements for a VL instantiated according to + * this profile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MinBitRateRequirements minBitRateRequirements, or null if not present + */ + @Nullable MinBitRateRequirements getMinBitRateRequirements(); + + /** + * Specifies the protocol data for a VL instantiated according to this profile. + * Cardinality 0 is used when no protocol data needs to be specified. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.VirtualLinkProtocolData virtualLinkProtocolData, or null if not present + */ + @Nullable VirtualLinkProtocolData getVirtualLinkProtocolData(); + + @Override + VirtualLinkProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileBuilder.java new file mode 100644 index 0000000..1f08cbc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileBuilder.java @@ -0,0 +1,458 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MaxBitRateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MinBitRateRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.VirtualLinkProtocolData; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkProfileBuilder + * @see Builder + * + */ +public class VirtualLinkProfileBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroup; + private Object _flavour; + private String _id; + private Map _localAffinityOrAntiAffinityRule; + private MaxBitRateRequirements _maxBitRateRequirements; + private MinBitRateRequirements _minBitRateRequirements; + private VirtualLinkProtocolData _virtualLinkProtocolData; + private VirtualLinkProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkProfileBuilder() { + } + public VirtualLinkProfileBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule arg) { + this._localAffinityOrAntiAffinityRule = arg.getLocalAffinityOrAntiAffinityRule(); + } + + public VirtualLinkProfileBuilder(VirtualLinkProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._flavour = base.getFlavour(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroup = base.getAffinityOrAntiAffinityGroup(); + this._localAffinityOrAntiAffinityRule = base.getLocalAffinityOrAntiAffinityRule(); + this._maxBitRateRequirements = base.getMaxBitRateRequirements(); + this._minBitRateRequirements = base.getMinBitRateRequirements(); + this._virtualLinkProtocolData = base.getVirtualLinkProtocolData(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule) { + this._localAffinityOrAntiAffinityRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule)arg).getLocalAffinityOrAntiAffinityRule(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LocalAffinityOrAntiAffinityRule]"); + } + + public VirtualLinkProfileKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + public Object getFlavour() { + return _flavour; + } + + public String getId() { + return _id; + } + + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + public MaxBitRateRequirements getMaxBitRateRequirements() { + return _maxBitRateRequirements; + } + + public MinBitRateRequirements getMinBitRateRequirements() { + return _minBitRateRequirements; + } + + public VirtualLinkProtocolData getVirtualLinkProtocolData() { + return _virtualLinkProtocolData; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkProfileBuilder withKey(final VirtualLinkProfileKey key) { + this.key = key; + return this; + } + public VirtualLinkProfileBuilder setAffinityOrAntiAffinityGroup(final Map values) { + this._affinityOrAntiAffinityGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProfileBuilder setAffinityOrAntiAffinityGroup(final List values) { + return setAffinityOrAntiAffinityGroup(CodeHelpers.compatMap(values)); + } + + public VirtualLinkProfileBuilder setFlavour(final Object value) { + this._flavour = value; + return this; + } + + public VirtualLinkProfileBuilder setId(final String value) { + this._id = value; + return this; + } + public VirtualLinkProfileBuilder setLocalAffinityOrAntiAffinityRule(final Map values) { + this._localAffinityOrAntiAffinityRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLocalAffinityOrAntiAffinityRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProfileBuilder setLocalAffinityOrAntiAffinityRule(final List values) { + return setLocalAffinityOrAntiAffinityRule(CodeHelpers.compatMap(values)); + } + + public VirtualLinkProfileBuilder setMaxBitRateRequirements(final MaxBitRateRequirements value) { + this._maxBitRateRequirements = value; + return this; + } + + public VirtualLinkProfileBuilder setMinBitRateRequirements(final MinBitRateRequirements value) { + this._minBitRateRequirements = value; + return this; + } + + public VirtualLinkProfileBuilder setVirtualLinkProtocolData(final VirtualLinkProtocolData value) { + this._virtualLinkProtocolData = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkProfile build() { + return new VirtualLinkProfileImpl(this); + } + + public static final class VirtualLinkProfileImpl + extends AbstractAugmentable + implements VirtualLinkProfile { + + private final Map _affinityOrAntiAffinityGroup; + private Object _flavour; + private final String _id; + private final Map _localAffinityOrAntiAffinityRule; + private final MaxBitRateRequirements _maxBitRateRequirements; + private final MinBitRateRequirements _minBitRateRequirements; + private final VirtualLinkProtocolData _virtualLinkProtocolData; + private VirtualLinkProfileKey key; + + VirtualLinkProfileImpl(VirtualLinkProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkProfileKey(base.getFlavour(), base.getId()); + } + this._flavour = key.getFlavour(); + this._id = key.getId(); + this._affinityOrAntiAffinityGroup = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroup()); + this._localAffinityOrAntiAffinityRule = CodeHelpers.emptyToNull(base.getLocalAffinityOrAntiAffinityRule()); + this._maxBitRateRequirements = base.getMaxBitRateRequirements(); + this._minBitRateRequirements = base.getMinBitRateRequirements(); + this._virtualLinkProtocolData = base.getVirtualLinkProtocolData(); + } + + public VirtualLinkProfileImpl() { + this( new VirtualLinkProfileBuilder()); + } + + @Override + public VirtualLinkProfileKey key() { + if ( ( key != null) && ( key.getId() == null) && ( _id != null) ) { + if(_flavour == null) + _flavour=""; + key = new VirtualLinkProfileKey(_flavour, _id); + } + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + @Override + public Object getFlavour() { + return _flavour; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getLocalAffinityOrAntiAffinityRule() { + return _localAffinityOrAntiAffinityRule; + } + + @Override + public MaxBitRateRequirements getMaxBitRateRequirements() { + return _maxBitRateRequirements; + } + + @Override + public MinBitRateRequirements getMinBitRateRequirements() { + return _minBitRateRequirements; + } + + @Override + public VirtualLinkProtocolData getVirtualLinkProtocolData() { + return _virtualLinkProtocolData; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroup); + result = prime * result + Objects.hashCode(_flavour); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_localAffinityOrAntiAffinityRule); + result = prime * result + Objects.hashCode(_maxBitRateRequirements); + result = prime * result + Objects.hashCode(_minBitRateRequirements); + result = prime * result + Objects.hashCode(_virtualLinkProtocolData); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkProfile other = (VirtualLinkProfile)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroup, other.getAffinityOrAntiAffinityGroup())) { + return false; + } + if (!Objects.equals(_flavour, other.getFlavour())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_localAffinityOrAntiAffinityRule, other.getLocalAffinityOrAntiAffinityRule())) { + return false; + } + if (!Objects.equals(_maxBitRateRequirements, other.getMaxBitRateRequirements())) { + return false; + } + if (!Objects.equals(_minBitRateRequirements, other.getMinBitRateRequirements())) { + return false; + } + if (!Objects.equals(_virtualLinkProtocolData, other.getVirtualLinkProtocolData())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkProfileImpl otherImpl = (VirtualLinkProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkProfile"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroup", _affinityOrAntiAffinityGroup); + CodeHelpers.appendValue(helper, "_flavour", _flavour); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_localAffinityOrAntiAffinityRule", _localAffinityOrAntiAffinityRule); + CodeHelpers.appendValue(helper, "_maxBitRateRequirements", _maxBitRateRequirements); + CodeHelpers.appendValue(helper, "_minBitRateRequirements", _minBitRateRequirements); + CodeHelpers.appendValue(helper, "_virtualLinkProtocolData", _virtualLinkProtocolData); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileKey.java new file mode 100644 index 0000000..292171a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/VirtualLinkProfileKey.java @@ -0,0 +1,95 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.KeyDeserializer; +import com.google.common.base.MoreObjects; + +import java.io.IOException; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkProfileKey extends KeyDeserializer + implements Identifier { + private static final long serialVersionUID = 1298066409440857060L; + private final String _id; + private final Object _flavour; + + + public VirtualLinkProfileKey() { + // This might be also null, or not id/flavor not final. + this._id = ""; + this._flavour = ""; + } + + public VirtualLinkProfileKey(Object _flavour, String _id) { + + this._id = _id; + this._flavour = _flavour; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkProfileKey(VirtualLinkProfileKey source) { + this._id = source._id; + this._flavour = source._flavour; + } + + + public String getId() { + return _id; + } + + public Object getFlavour() { + return _flavour; + } + + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_flavour); + return result; + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkProfileKey)) { + return false; + } + final VirtualLinkProfileKey other = (VirtualLinkProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + if (!Objects.equals(_flavour, other._flavour)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_flavour", _flavour); + return helper.toString(); + } + + @Override + public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException { + // TODO Auto-generated method stub + return this.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfo.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfo.java new file mode 100644 index 0000000..730fded --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfo.java @@ -0,0 +1,80 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.InstantiationLevel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * The InstantiationLevel information element describes a given level of resources + * to be instantiated within a DF in term of the number of VNFC instances to be + * created from each VDU. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list scaling-info {
+ *   key scaling-aspect-id;
+ *   leaf scaling-aspect-id {
+ *     type leafref {
+ *       path ../../../scaling-aspect/id;
+ *     }
+ *   }
+ *   leaf scale-level {
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/instantiation-level/scaling-info + * + *

To create instances of this class use {@link ScalingInfoBuilder}. + * @see ScalingInfoBuilder + * @see ScalingInfoKey + * + */ +public interface ScalingInfo + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scaling-info"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.ScalingInfo.class; + } + + /** + * Identifier of the scaling aspect. + * + * + * + * @return java.lang.String scalingAspectId, or null if not present + */ + @Nullable String getScalingAspectId(); + + /** + * The scale level, greater than or equal to 0. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 scaleLevel, or null if not present + */ + @Nullable Uint32 getScaleLevel(); + + @Override + ScalingInfoKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoBuilder.java new file mode 100644 index 0000000..88469c0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoBuilder.java @@ -0,0 +1,285 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link ScalingInfoBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ScalingInfoBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ScalingInfoBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ScalingInfoBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ScalingInfoBuilder + * @see Builder + * + */ +public class ScalingInfoBuilder implements Builder { + + private Uint32 _scaleLevel; + private String _scalingAspectId; + private ScalingInfoKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ScalingInfoBuilder() { + } + + public ScalingInfoBuilder(ScalingInfo base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._scalingAspectId = base.getScalingAspectId(); + this._scaleLevel = base.getScaleLevel(); + } + + + public ScalingInfoKey key() { + return key; + } + + public Uint32 getScaleLevel() { + return _scaleLevel; + } + + public String getScalingAspectId() { + return _scalingAspectId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ScalingInfoBuilder withKey(final ScalingInfoKey key) { + this.key = key; + return this; + } + + public ScalingInfoBuilder setScaleLevel(final Uint32 value) { + this._scaleLevel = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setScaleLevel(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public ScalingInfoBuilder setScaleLevel(final Long value) { + return setScaleLevel(CodeHelpers.compatUint(value)); + } + + public ScalingInfoBuilder setScalingAspectId(final String value) { + this._scalingAspectId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ScalingInfoBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ScalingInfoBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ScalingInfoBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ScalingInfoBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ScalingInfo build() { + return new ScalingInfoImpl(this); + } + + private static final class ScalingInfoImpl + extends AbstractAugmentable + implements ScalingInfo { + + private final Uint32 _scaleLevel; + private final String _scalingAspectId; + private final ScalingInfoKey key; + + ScalingInfoImpl(ScalingInfoBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ScalingInfoKey(base.getScalingAspectId()); + } + this._scalingAspectId = key.getScalingAspectId(); + this._scaleLevel = base.getScaleLevel(); + } + + @Override + public ScalingInfoKey key() { + return key; + } + + @Override + public Uint32 getScaleLevel() { + return _scaleLevel; + } + + @Override + public String getScalingAspectId() { + return _scalingAspectId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_scaleLevel); + result = prime * result + Objects.hashCode(_scalingAspectId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ScalingInfo.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ScalingInfo other = (ScalingInfo)obj; + if (!Objects.equals(_scaleLevel, other.getScaleLevel())) { + return false; + } + if (!Objects.equals(_scalingAspectId, other.getScalingAspectId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ScalingInfoImpl otherImpl = (ScalingInfoImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ScalingInfo"); + CodeHelpers.appendValue(helper, "_scaleLevel", _scaleLevel); + CodeHelpers.appendValue(helper, "_scalingAspectId", _scalingAspectId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoKey.java new file mode 100644 index 0000000..f0ef9c4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/ScalingInfoKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ScalingInfoKey + implements Identifier { + private static final long serialVersionUID = -1279594473036189260L; + private final String _scalingAspectId; + + + public ScalingInfoKey(String _scalingAspectId) { + + this._scalingAspectId = _scalingAspectId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ScalingInfoKey(ScalingInfoKey source) { + this._scalingAspectId = source._scalingAspectId; + } + + + public String getScalingAspectId() { + return _scalingAspectId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_scalingAspectId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ScalingInfoKey)) { + return false; + } + final ScalingInfoKey other = (ScalingInfoKey) obj; + if (!Objects.equals(_scalingAspectId, other._scalingAspectId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ScalingInfoKey.class); + CodeHelpers.appendValue(helper, "_scalingAspectId", _scalingAspectId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevel.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevel.java new file mode 100644 index 0000000..a1f3c4b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevel.java @@ -0,0 +1,82 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.InstantiationLevel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Sets the number of instances for the VDU in this instantiation level. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vdu-level {
+ *   key vdu-id;
+ *   min-elements 1;
+ *   leaf vdu-id {
+ *     type leafref {
+ *       path ../../../../vdu/id;
+ *     }
+ *   }
+ *   leaf number-of-instances {
+ *     type uint16;
+ *     must ". <= ../../../../df/vdu-profile[id=current()/../vdu-id]/max-number-of-instances";
+ *     must ". >= ../../../../df/vdu-profile[id=current()/../vdu-id]/min-number-of-instances";
+ *     default 1;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/instantiation-level/vdu-level + * + *

To create instances of this class use {@link VduLevelBuilder}. + * @see VduLevelBuilder + * @see VduLevelKey + * + */ +public interface VduLevel + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu-level"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level.VduLevel.class; + } + + /** + * Uniquely identifies a VDU. + * + * + * + * @return java.lang.String vduId, or null if not present + */ + @Nullable String getVduId(); + + /** + * Number of instances of VNFC based on this VDU to deploy for this level. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 numberOfInstances, or null if not present + */ + @Nullable Uint16 getNumberOfInstances(); + + @Override + VduLevelKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelBuilder.java new file mode 100644 index 0000000..95e331f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelBuilder.java @@ -0,0 +1,285 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link VduLevelBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VduLevelBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VduLevelBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VduLevelBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VduLevelBuilder + * @see Builder + * + */ +public class VduLevelBuilder implements Builder { + + private Uint16 _numberOfInstances; + private String _vduId; + private VduLevelKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VduLevelBuilder() { + } + + public VduLevelBuilder(VduLevel base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._vduId = base.getVduId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + + public VduLevelKey key() { + return key; + } + + public Uint16 getNumberOfInstances() { + return _numberOfInstances; + } + + public String getVduId() { + return _vduId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VduLevelBuilder withKey(final VduLevelKey key) { + this.key = key; + return this; + } + + public VduLevelBuilder setNumberOfInstances(final Uint16 value) { + this._numberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public VduLevelBuilder setNumberOfInstances(final Integer value) { + return setNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public VduLevelBuilder setVduId(final String value) { + this._vduId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VduLevelBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VduLevelBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VduLevelBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VduLevelBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VduLevel build() { + return new VduLevelImpl(this); + } + + private static final class VduLevelImpl + extends AbstractAugmentable + implements VduLevel { + + private final Uint16 _numberOfInstances; + private final String _vduId; + private final VduLevelKey key; + + VduLevelImpl(VduLevelBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VduLevelKey(base.getVduId()); + } + this._vduId = key.getVduId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + @Override + public VduLevelKey key() { + return key; + } + + @Override + public Uint16 getNumberOfInstances() { + return _numberOfInstances; + } + + @Override + public String getVduId() { + return _vduId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_numberOfInstances); + result = prime * result + Objects.hashCode(_vduId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VduLevel.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VduLevel other = (VduLevel)obj; + if (!Objects.equals(_numberOfInstances, other.getNumberOfInstances())) { + return false; + } + if (!Objects.equals(_vduId, other.getVduId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VduLevelImpl otherImpl = (VduLevelImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VduLevel"); + CodeHelpers.appendValue(helper, "_numberOfInstances", _numberOfInstances); + CodeHelpers.appendValue(helper, "_vduId", _vduId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelKey.java new file mode 100644 index 0000000..1727daf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/instantiation/level/VduLevelKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.instantiation.level; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VduLevelKey + implements Identifier { + private static final long serialVersionUID = 7472299403991418175L; + private final String _vduId; + + + public VduLevelKey(String _vduId) { + + this._vduId = _vduId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VduLevelKey(VduLevelKey source) { + this._vduId = source._vduId; + } + + + public String getVduId() { + return _vduId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_vduId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VduLevelKey)) { + return false; + } + final VduLevelKey other = (VduLevelKey) obj; + if (!Objects.equals(_vduId, other._vduId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VduLevelKey.class); + CodeHelpers.appendValue(helper, "_vduId", _vduId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfig.java new file mode 100644 index 0000000..80049e8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfig.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config.ParameterKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Configuration parameters for the ChangeExtVnfConnectivity operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container change-ext-vnf-connectivity-op-config {
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/change-ext-vnf-connectivity-op-config + * + *

To create instances of this class use {@link ChangeExtVnfConnectivityOpConfigBuilder}. + * @see ChangeExtVnfConnectivityOpConfigBuilder + * + */ +public interface ChangeExtVnfConnectivityOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("change-ext-vnf-connectivity-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeExtVnfConnectivityOpConfig.class; + } + + /** + * Array of KVP requirements for VNF-specific parameters to be passed when invoking + * the ChangeExtVnfConnectivity operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfigBuilder.java new file mode 100644 index 0000000..5c4969a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeExtVnfConnectivityOpConfigBuilder.java @@ -0,0 +1,247 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config.ParameterKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ChangeExtVnfConnectivityOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ChangeExtVnfConnectivityOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ChangeExtVnfConnectivityOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ChangeExtVnfConnectivityOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ChangeExtVnfConnectivityOpConfigBuilder + * @see Builder + * + */ +public class ChangeExtVnfConnectivityOpConfigBuilder implements Builder { + + private Map _parameter; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ChangeExtVnfConnectivityOpConfigBuilder() { + } + + public ChangeExtVnfConnectivityOpConfigBuilder(ChangeExtVnfConnectivityOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._parameter = base.getParameter(); + } + + + public Map getParameter() { + return _parameter; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ChangeExtVnfConnectivityOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ChangeExtVnfConnectivityOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ChangeExtVnfConnectivityOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ChangeExtVnfConnectivityOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ChangeExtVnfConnectivityOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ChangeExtVnfConnectivityOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ChangeExtVnfConnectivityOpConfig build() { + return new ChangeExtVnfConnectivityOpConfigImpl(this); + } + + private static final class ChangeExtVnfConnectivityOpConfigImpl + extends AbstractAugmentable + implements ChangeExtVnfConnectivityOpConfig { + + private final Map _parameter; + + ChangeExtVnfConnectivityOpConfigImpl(ChangeExtVnfConnectivityOpConfigBuilder base) { + super(base.augmentation); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + } + + @Override + public Map getParameter() { + return _parameter; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ChangeExtVnfConnectivityOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ChangeExtVnfConnectivityOpConfig other = (ChangeExtVnfConnectivityOpConfig)obj; + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ChangeExtVnfConnectivityOpConfigImpl otherImpl = (ChangeExtVnfConnectivityOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ChangeExtVnfConnectivityOpConfig"); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfig.java new file mode 100644 index 0000000..b506cf5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfig.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config.ParameterKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Configuration parameters for the ChangeVnfFlavour operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container change-vnf-flavour-op-config {
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/change-vnf-flavour-op-config + * + *

To create instances of this class use {@link ChangeVnfFlavourOpConfigBuilder}. + * @see ChangeVnfFlavourOpConfigBuilder + * + */ +public interface ChangeVnfFlavourOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("change-vnf-flavour-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeVnfFlavourOpConfig.class; + } + + /** + * Array of KVP requirements for VNF-specific parameters to be passed when invoking + * the OperateVnf operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfigBuilder.java new file mode 100644 index 0000000..09a4cf2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ChangeVnfFlavourOpConfigBuilder.java @@ -0,0 +1,247 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config.ParameterKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ChangeVnfFlavourOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ChangeVnfFlavourOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ChangeVnfFlavourOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ChangeVnfFlavourOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ChangeVnfFlavourOpConfigBuilder + * @see Builder + * + */ +public class ChangeVnfFlavourOpConfigBuilder implements Builder { + + private Map _parameter; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ChangeVnfFlavourOpConfigBuilder() { + } + + public ChangeVnfFlavourOpConfigBuilder(ChangeVnfFlavourOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._parameter = base.getParameter(); + } + + + public Map getParameter() { + return _parameter; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ChangeVnfFlavourOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ChangeVnfFlavourOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ChangeVnfFlavourOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ChangeVnfFlavourOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ChangeVnfFlavourOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ChangeVnfFlavourOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ChangeVnfFlavourOpConfig build() { + return new ChangeVnfFlavourOpConfigImpl(this); + } + + private static final class ChangeVnfFlavourOpConfigImpl + extends AbstractAugmentable + implements ChangeVnfFlavourOpConfig { + + private final Map _parameter; + + ChangeVnfFlavourOpConfigImpl(ChangeVnfFlavourOpConfigBuilder base) { + super(base.augmentation); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + } + + @Override + public Map getParameter() { + return _parameter; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ChangeVnfFlavourOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ChangeVnfFlavourOpConfig other = (ChangeVnfFlavourOpConfig)obj; + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ChangeVnfFlavourOpConfigImpl otherImpl = (ChangeVnfFlavourOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ChangeVnfFlavourOpConfig"); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfig.java new file mode 100644 index 0000000..dfe422c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfig.java @@ -0,0 +1,88 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config.ParameterKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This information element defines attributes that affect the invocation of the + * HealVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container heal-vnf-op-config {
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ *   leaf-list cause {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/heal-vnf-op-config + * + *

To create instances of this class use {@link HealVnfOpConfigBuilder}. + * @see HealVnfOpConfigBuilder + * + */ +public interface HealVnfOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("heal-vnf-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.HealVnfOpConfig.class; + } + + /** + * Array of KVP requirements for VNF-specific parameters to be passed when invoking + * the HealVnf operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + + /** + * Supported 'cause' parameter values. + * + * + * + * @return java.util.List cause, or null if not present + */ + @Nullable List getCause(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfigBuilder.java new file mode 100644 index 0000000..ddfb8f9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/HealVnfOpConfigBuilder.java @@ -0,0 +1,270 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config.ParameterKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link HealVnfOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     HealVnfOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new HealVnfOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of HealVnfOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see HealVnfOpConfigBuilder + * @see Builder + * + */ +public class HealVnfOpConfigBuilder implements Builder { + + private List _cause; + private Map _parameter; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public HealVnfOpConfigBuilder() { + } + + public HealVnfOpConfigBuilder(HealVnfOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cause = base.getCause(); + this._parameter = base.getParameter(); + } + + + public List getCause() { + return _cause; + } + + public Map getParameter() { + return _parameter; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public HealVnfOpConfigBuilder setCause(final List values) { + this._cause = values; + return this; + } + + public HealVnfOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public HealVnfOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public HealVnfOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public HealVnfOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public HealVnfOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private HealVnfOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public HealVnfOpConfig build() { + return new HealVnfOpConfigImpl(this); + } + + private static final class HealVnfOpConfigImpl + extends AbstractAugmentable + implements HealVnfOpConfig { + + private final List _cause; + private final Map _parameter; + + HealVnfOpConfigImpl(HealVnfOpConfigBuilder base) { + super(base.augmentation); + this._cause = base.getCause(); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + } + + @Override + public List getCause() { + return _cause; + } + + @Override + public Map getParameter() { + return _parameter; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cause); + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!HealVnfOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + HealVnfOpConfig other = (HealVnfOpConfig)obj; + if (!Objects.equals(_cause, other.getCause())) { + return false; + } + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + HealVnfOpConfigImpl otherImpl = (HealVnfOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("HealVnfOpConfig"); + CodeHelpers.appendValue(helper, "_cause", _cause); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfig.java new file mode 100644 index 0000000..d1c1f61 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfig.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config.ParameterKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Configuration parameters for the InstantiateVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container instantiate-vnf-op-config {
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/instantiate-vnf-op-config + * + *

To create instances of this class use {@link InstantiateVnfOpConfigBuilder}. + * @see InstantiateVnfOpConfigBuilder + * + */ +public interface InstantiateVnfOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("instantiate-vnf-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.InstantiateVnfOpConfig.class; + } + + /** + * Array of KVP requirements for VNF-specific parameters to be passed when invoking + * the InstantiateVnf operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfigBuilder.java new file mode 100644 index 0000000..e081bd8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/InstantiateVnfOpConfigBuilder.java @@ -0,0 +1,247 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config.ParameterKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link InstantiateVnfOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     InstantiateVnfOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new InstantiateVnfOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of InstantiateVnfOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see InstantiateVnfOpConfigBuilder + * @see Builder + * + */ +public class InstantiateVnfOpConfigBuilder implements Builder { + + private Map _parameter; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public InstantiateVnfOpConfigBuilder() { + } + + public InstantiateVnfOpConfigBuilder(InstantiateVnfOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._parameter = base.getParameter(); + } + + + public Map getParameter() { + return _parameter; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public InstantiateVnfOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public InstantiateVnfOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public InstantiateVnfOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public InstantiateVnfOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public InstantiateVnfOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private InstantiateVnfOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public InstantiateVnfOpConfig build() { + return new InstantiateVnfOpConfigImpl(this); + } + + private static final class InstantiateVnfOpConfigImpl + extends AbstractAugmentable + implements InstantiateVnfOpConfig { + + private final Map _parameter; + + InstantiateVnfOpConfigImpl(InstantiateVnfOpConfigBuilder base) { + super(base.augmentation); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + } + + @Override + public Map getParameter() { + return _parameter; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!InstantiateVnfOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + InstantiateVnfOpConfig other = (InstantiateVnfOpConfig)obj; + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + InstantiateVnfOpConfigImpl otherImpl = (InstantiateVnfOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("InstantiateVnfOpConfig"); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfig.java new file mode 100644 index 0000000..2f91bdd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfig.java @@ -0,0 +1,104 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config.ParameterKey; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This information element defines attributes that affect the invocation of the + * OperateVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container operate-vnf-op-config {
+ *   leaf min-graceful-stop-timeout {
+ *     type yang:timeticks;
+ *     default 1;
+ *   }
+ *   leaf max-recommended-graceful-stop-timeout {
+ *     type yang:timeticks;
+ *   }
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/operate-vnf-op-config + * + *

To create instances of this class use {@link OperateVnfOpConfigBuilder}. + * @see OperateVnfOpConfigBuilder + * + */ +public interface OperateVnfOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("operate-vnf-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.OperateVnfOpConfig.class; + } + + /** + * Minimum timeout value for graceful stop of a VNF instance. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks minGracefulStopTimeout, or null if not present + */ + @Nullable Timeticks getMinGracefulStopTimeout(); + + /** + * Maximum recommended timeout value that can be needed to gracefully stop a VNF + * instance of a particular type under certain conditions, such as maximum load + * condition. This is provided by VNF provider as information for the operator + * facilitating the selection of optimal timeout value. This value is not used as + * constraint. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks maxRecommendedGracefulStopTimeout, or null if not present + */ + @Nullable Timeticks getMaxRecommendedGracefulStopTimeout(); + + /** + * Array of KVP requirements for VNF-specific parameters to be passed when invoking + * the OperateVnf operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfigBuilder.java new file mode 100644 index 0000000..53792e6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/OperateVnfOpConfigBuilder.java @@ -0,0 +1,294 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config.ParameterKey; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link OperateVnfOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     OperateVnfOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new OperateVnfOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of OperateVnfOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see OperateVnfOpConfigBuilder + * @see Builder + * + */ +public class OperateVnfOpConfigBuilder implements Builder { + + private Timeticks _maxRecommendedGracefulStopTimeout; + private Timeticks _minGracefulStopTimeout; + private Map _parameter; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public OperateVnfOpConfigBuilder() { + } + + public OperateVnfOpConfigBuilder(OperateVnfOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._maxRecommendedGracefulStopTimeout = base.getMaxRecommendedGracefulStopTimeout(); + this._minGracefulStopTimeout = base.getMinGracefulStopTimeout(); + this._parameter = base.getParameter(); + } + + + public Timeticks getMaxRecommendedGracefulStopTimeout() { + return _maxRecommendedGracefulStopTimeout; + } + + public Timeticks getMinGracefulStopTimeout() { + return _minGracefulStopTimeout; + } + + public Map getParameter() { + return _parameter; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public OperateVnfOpConfigBuilder setMaxRecommendedGracefulStopTimeout(final Timeticks value) { + this._maxRecommendedGracefulStopTimeout = value; + return this; + } + + public OperateVnfOpConfigBuilder setMinGracefulStopTimeout(final Timeticks value) { + this._minGracefulStopTimeout = value; + return this; + } + public OperateVnfOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public OperateVnfOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public OperateVnfOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public OperateVnfOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public OperateVnfOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private OperateVnfOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public OperateVnfOpConfig build() { + return new OperateVnfOpConfigImpl(this); + } + + private static final class OperateVnfOpConfigImpl + extends AbstractAugmentable + implements OperateVnfOpConfig { + + private final Timeticks _maxRecommendedGracefulStopTimeout; + private final Timeticks _minGracefulStopTimeout; + private final Map _parameter; + + OperateVnfOpConfigImpl(OperateVnfOpConfigBuilder base) { + super(base.augmentation); + this._maxRecommendedGracefulStopTimeout = base.getMaxRecommendedGracefulStopTimeout(); + this._minGracefulStopTimeout = base.getMinGracefulStopTimeout(); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + } + + @Override + public Timeticks getMaxRecommendedGracefulStopTimeout() { + return _maxRecommendedGracefulStopTimeout; + } + + @Override + public Timeticks getMinGracefulStopTimeout() { + return _minGracefulStopTimeout; + } + + @Override + public Map getParameter() { + return _parameter; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_maxRecommendedGracefulStopTimeout); + result = prime * result + Objects.hashCode(_minGracefulStopTimeout); + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!OperateVnfOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + OperateVnfOpConfig other = (OperateVnfOpConfig)obj; + if (!Objects.equals(_maxRecommendedGracefulStopTimeout, other.getMaxRecommendedGracefulStopTimeout())) { + return false; + } + if (!Objects.equals(_minGracefulStopTimeout, other.getMinGracefulStopTimeout())) { + return false; + } + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + OperateVnfOpConfigImpl otherImpl = (OperateVnfOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("OperateVnfOpConfig"); + CodeHelpers.appendValue(helper, "_maxRecommendedGracefulStopTimeout", _maxRecommendedGracefulStopTimeout); + CodeHelpers.appendValue(helper, "_minGracefulStopTimeout", _minGracefulStopTimeout); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfig.java new file mode 100644 index 0000000..bc81277 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfig.java @@ -0,0 +1,89 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config.ParameterKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Configuration parameters for the ScaleVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container scale-vnf-op-config {
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ *   leaf scaling-by-more-than-one-step-supported {
+ *     type boolean;
+ *     default false;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/scale-vnf-op-config + * + *

To create instances of this class use {@link ScaleVnfOpConfigBuilder}. + * @see ScaleVnfOpConfigBuilder + * + */ +public interface ScaleVnfOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scale-vnf-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfOpConfig.class; + } + + /** + * Array of KVP requirements for VNFspecific parameters to be passed when invoking + * the ScaleVnf operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + + /** + * Signals whether passing a value larger than one in the numScalingSteps parameter + * of the ScaleVnf operation is supported by this VNF. Default is FALSE, i.e. 'not + * supported'. + * + * + * + * @return java.lang.Boolean scalingByMoreThanOneStepSupported, or null if not present + */ + @Nullable Boolean isScalingByMoreThanOneStepSupported(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfigBuilder.java new file mode 100644 index 0000000..4b6ca3e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfOpConfigBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config.ParameterKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ScaleVnfOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ScaleVnfOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ScaleVnfOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ScaleVnfOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ScaleVnfOpConfigBuilder + * @see Builder + * + */ +public class ScaleVnfOpConfigBuilder implements Builder { + + private Map _parameter; + private Boolean _scalingByMoreThanOneStepSupported; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ScaleVnfOpConfigBuilder() { + } + + public ScaleVnfOpConfigBuilder(ScaleVnfOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._parameter = base.getParameter(); + this._scalingByMoreThanOneStepSupported = base.isScalingByMoreThanOneStepSupported(); + } + + + public Map getParameter() { + return _parameter; + } + + public Boolean isScalingByMoreThanOneStepSupported() { + return _scalingByMoreThanOneStepSupported; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ScaleVnfOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ScaleVnfOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + public ScaleVnfOpConfigBuilder setScalingByMoreThanOneStepSupported(final Boolean value) { + this._scalingByMoreThanOneStepSupported = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ScaleVnfOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ScaleVnfOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ScaleVnfOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ScaleVnfOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ScaleVnfOpConfig build() { + return new ScaleVnfOpConfigImpl(this); + } + + private static final class ScaleVnfOpConfigImpl + extends AbstractAugmentable + implements ScaleVnfOpConfig { + + private final Map _parameter; + private final Boolean _scalingByMoreThanOneStepSupported; + + ScaleVnfOpConfigImpl(ScaleVnfOpConfigBuilder base) { + super(base.augmentation); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + this._scalingByMoreThanOneStepSupported = base.isScalingByMoreThanOneStepSupported(); + } + + @Override + public Map getParameter() { + return _parameter; + } + + @Override + public Boolean isScalingByMoreThanOneStepSupported() { + return _scalingByMoreThanOneStepSupported; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(_scalingByMoreThanOneStepSupported); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ScaleVnfOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ScaleVnfOpConfig other = (ScaleVnfOpConfig)obj; + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (!Objects.equals(_scalingByMoreThanOneStepSupported, other.isScalingByMoreThanOneStepSupported())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ScaleVnfOpConfigImpl otherImpl = (ScaleVnfOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ScaleVnfOpConfig"); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "_scalingByMoreThanOneStepSupported", _scalingByMoreThanOneStepSupported); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfig.java new file mode 100644 index 0000000..e671466 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfig.java @@ -0,0 +1,89 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config.ParameterKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This information element defines attributes that affect the invocation of the + * ScaleVnfToLevel operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container scale-vnf-to-level-op-config {
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ *   leaf arbitrary-target-levels-supported {
+ *     type boolean;
+ *     default false;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/scale-vnf-to-level-op-config + * + *

To create instances of this class use {@link ScaleVnfToLevelOpConfigBuilder}. + * @see ScaleVnfToLevelOpConfigBuilder + * + */ +public interface ScaleVnfToLevelOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scale-vnf-to-level-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfToLevelOpConfig.class; + } + + /** + * Array of KVP requirements for VNF-specific parameters to be passed when invoking + * the ScaleVnfToLevel operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + + /** + * Signals whether scaling according to the parameter 'scaleInfo' is supported by + * this VNF. + * + * + * + * @return java.lang.Boolean arbitraryTargetLevelsSupported, or null if not present + */ + @Nullable Boolean isArbitraryTargetLevelsSupported(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfigBuilder.java new file mode 100644 index 0000000..918160a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/ScaleVnfToLevelOpConfigBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config.ParameterKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ScaleVnfToLevelOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ScaleVnfToLevelOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ScaleVnfToLevelOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ScaleVnfToLevelOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ScaleVnfToLevelOpConfigBuilder + * @see Builder + * + */ +public class ScaleVnfToLevelOpConfigBuilder implements Builder { + + private Map _parameter; + private Boolean _arbitraryTargetLevelsSupported; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ScaleVnfToLevelOpConfigBuilder() { + } + + public ScaleVnfToLevelOpConfigBuilder(ScaleVnfToLevelOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._parameter = base.getParameter(); + this._arbitraryTargetLevelsSupported = base.isArbitraryTargetLevelsSupported(); + } + + + public Map getParameter() { + return _parameter; + } + + public Boolean isArbitraryTargetLevelsSupported() { + return _arbitraryTargetLevelsSupported; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ScaleVnfToLevelOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ScaleVnfToLevelOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + public ScaleVnfToLevelOpConfigBuilder setArbitraryTargetLevelsSupported(final Boolean value) { + this._arbitraryTargetLevelsSupported = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ScaleVnfToLevelOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ScaleVnfToLevelOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ScaleVnfToLevelOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ScaleVnfToLevelOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ScaleVnfToLevelOpConfig build() { + return new ScaleVnfToLevelOpConfigImpl(this); + } + + private static final class ScaleVnfToLevelOpConfigImpl + extends AbstractAugmentable + implements ScaleVnfToLevelOpConfig { + + private final Map _parameter; + private final Boolean _arbitraryTargetLevelsSupported; + + ScaleVnfToLevelOpConfigImpl(ScaleVnfToLevelOpConfigBuilder base) { + super(base.augmentation); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + this._arbitraryTargetLevelsSupported = base.isArbitraryTargetLevelsSupported(); + } + + @Override + public Map getParameter() { + return _parameter; + } + + @Override + public Boolean isArbitraryTargetLevelsSupported() { + return _arbitraryTargetLevelsSupported; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(_arbitraryTargetLevelsSupported); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ScaleVnfToLevelOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ScaleVnfToLevelOpConfig other = (ScaleVnfToLevelOpConfig)obj; + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (!Objects.equals(_arbitraryTargetLevelsSupported, other.isArbitraryTargetLevelsSupported())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ScaleVnfToLevelOpConfigImpl otherImpl = (ScaleVnfToLevelOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ScaleVnfToLevelOpConfig"); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "_arbitraryTargetLevelsSupported", _arbitraryTargetLevelsSupported); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfig.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfig.java new file mode 100644 index 0000000..2ab67c1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfig.java @@ -0,0 +1,104 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.LcmOperationsConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config.ParameterKey; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This information element defines attributes that affect the invocation of the + * TerminateVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container terminate-vnf-op-config {
+ *   leaf min-graceful-termination {
+ *     type yang:timeticks;
+ *     default 1;
+ *   }
+ *   leaf max-recommended-graceful-termination {
+ *     type yang:timeticks;
+ *   }
+ *   list parameter {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/terminate-vnf-op-config + * + *

To create instances of this class use {@link TerminateVnfOpConfigBuilder}. + * @see TerminateVnfOpConfigBuilder + * + */ +public interface TerminateVnfOpConfig + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("terminate-vnf-op-config"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.TerminateVnfOpConfig.class; + } + + /** + * Minimum timeout value for graceful termination of a VNF instance. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks minGracefulTermination, or null if not present + */ + @Nullable Timeticks getMinGracefulTermination(); + + /** + * Maximum recommended timeout value that can be needed to gracefully terminate a + * VNF instance of a particular type under certain conditions, such as maximum load + * condition. This is provided by VNF provider as information for the operator + * facilitating the selection of optimal timeout value. This value is not used as + * constraint. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks maxRecommendedGracefulTermination, or null if not present + */ + @Nullable Timeticks getMaxRecommendedGracefulTermination(); + + /** + * Array of KVP requirements for VNF-specific parameters to be passed when invoking + * the TerminateVnf operation. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfigBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfigBuilder.java new file mode 100644 index 0000000..856bf8d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/TerminateVnfOpConfigBuilder.java @@ -0,0 +1,294 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config.ParameterKey; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Timeticks; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link TerminateVnfOpConfigBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     TerminateVnfOpConfigBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new TerminateVnfOpConfigBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of TerminateVnfOpConfigBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see TerminateVnfOpConfigBuilder + * @see Builder + * + */ +public class TerminateVnfOpConfigBuilder implements Builder { + + private Timeticks _maxRecommendedGracefulTermination; + private Timeticks _minGracefulTermination; + private Map _parameter; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public TerminateVnfOpConfigBuilder() { + } + + public TerminateVnfOpConfigBuilder(TerminateVnfOpConfig base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._maxRecommendedGracefulTermination = base.getMaxRecommendedGracefulTermination(); + this._minGracefulTermination = base.getMinGracefulTermination(); + this._parameter = base.getParameter(); + } + + + public Timeticks getMaxRecommendedGracefulTermination() { + return _maxRecommendedGracefulTermination; + } + + public Timeticks getMinGracefulTermination() { + return _minGracefulTermination; + } + + public Map getParameter() { + return _parameter; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public TerminateVnfOpConfigBuilder setMaxRecommendedGracefulTermination(final Timeticks value) { + this._maxRecommendedGracefulTermination = value; + return this; + } + + public TerminateVnfOpConfigBuilder setMinGracefulTermination(final Timeticks value) { + this._minGracefulTermination = value; + return this; + } + public TerminateVnfOpConfigBuilder setParameter(final Map values) { + this._parameter = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setParameter(Map)} instead. + */ + @Deprecated(forRemoval = true) + public TerminateVnfOpConfigBuilder setParameter(final List values) { + return setParameter(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public TerminateVnfOpConfigBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public TerminateVnfOpConfigBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public TerminateVnfOpConfigBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private TerminateVnfOpConfigBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public TerminateVnfOpConfig build() { + return new TerminateVnfOpConfigImpl(this); + } + + private static final class TerminateVnfOpConfigImpl + extends AbstractAugmentable + implements TerminateVnfOpConfig { + + private final Timeticks _maxRecommendedGracefulTermination; + private final Timeticks _minGracefulTermination; + private final Map _parameter; + + TerminateVnfOpConfigImpl(TerminateVnfOpConfigBuilder base) { + super(base.augmentation); + this._maxRecommendedGracefulTermination = base.getMaxRecommendedGracefulTermination(); + this._minGracefulTermination = base.getMinGracefulTermination(); + this._parameter = CodeHelpers.emptyToNull(base.getParameter()); + } + + @Override + public Timeticks getMaxRecommendedGracefulTermination() { + return _maxRecommendedGracefulTermination; + } + + @Override + public Timeticks getMinGracefulTermination() { + return _minGracefulTermination; + } + + @Override + public Map getParameter() { + return _parameter; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_maxRecommendedGracefulTermination); + result = prime * result + Objects.hashCode(_minGracefulTermination); + result = prime * result + Objects.hashCode(_parameter); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!TerminateVnfOpConfig.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + TerminateVnfOpConfig other = (TerminateVnfOpConfig)obj; + if (!Objects.equals(_maxRecommendedGracefulTermination, other.getMaxRecommendedGracefulTermination())) { + return false; + } + if (!Objects.equals(_minGracefulTermination, other.getMinGracefulTermination())) { + return false; + } + if (!Objects.equals(_parameter, other.getParameter())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + TerminateVnfOpConfigImpl otherImpl = (TerminateVnfOpConfigImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("TerminateVnfOpConfig"); + CodeHelpers.appendValue(helper, "_maxRecommendedGracefulTermination", _maxRecommendedGracefulTermination); + CodeHelpers.appendValue(helper, "_minGracefulTermination", _minGracefulTermination); + CodeHelpers.appendValue(helper, "_parameter", _parameter); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/Parameter.java new file mode 100644 index 0000000..9cd9567 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeExtVnfConnectivityOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNF-specific parameters to be passed when + * the ChangeExtVnfConnectivity operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/change-ext-vnf-connectivity-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterBuilder.java new file mode 100644 index 0000000..7091e93 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterKey.java new file mode 100644 index 0000000..5141052 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/ext/vnf/connectivity/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.ext.vnf.connectivity.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/Parameter.java new file mode 100644 index 0000000..24786be --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ChangeVnfFlavourOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNF-specific parameters to be passed when + * the OperateVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/change-vnf-flavour-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterBuilder.java new file mode 100644 index 0000000..02feffd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterKey.java new file mode 100644 index 0000000..b4cb41d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/change/vnf/flavour/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.change.vnf.flavour.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/Parameter.java new file mode 100644 index 0000000..537aa11 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.HealVnfOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNF-specific parameters to be passed when + * the HealVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/heal-vnf-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterBuilder.java new file mode 100644 index 0000000..d59daa9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterKey.java new file mode 100644 index 0000000..68e9fe1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/heal/vnf/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.heal.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/Parameter.java new file mode 100644 index 0000000..7ae9b88 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.InstantiateVnfOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNF-specific parameters to be passed when + * the InstantiateVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/instantiate-vnf-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterBuilder.java new file mode 100644 index 0000000..1011d86 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterKey.java new file mode 100644 index 0000000..ac48d14 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/instantiate/vnf/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.instantiate.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/Parameter.java new file mode 100644 index 0000000..4400bd6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.OperateVnfOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNF-specific parameters to be passed when + * the OperateVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/operate-vnf-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterBuilder.java new file mode 100644 index 0000000..4eccc6b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterKey.java new file mode 100644 index 0000000..5d6ebe0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/operate/vnf/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.operate.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/Parameter.java new file mode 100644 index 0000000..73ca7f7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNFspecific parameters to be passed when invoking + * the ScaleVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/scale-vnf-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterBuilder.java new file mode 100644 index 0000000..718c9fa --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterKey.java new file mode 100644 index 0000000..f7edc13 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/Parameter.java new file mode 100644 index 0000000..22f5356 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.ScaleVnfToLevelOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNF-specific parameters to be passed when + * the ScaleVnfToLevel operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/scale-vnf-to-level-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterBuilder.java new file mode 100644 index 0000000..cf2061e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterKey.java new file mode 100644 index 0000000..ab1489a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/scale/vnf/to/level/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.scale.vnf.to.level.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/Parameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/Parameter.java new file mode 100644 index 0000000..cb7b69e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/Parameter.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.TerminateVnfOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements for VNF-specific parameters to be passed when + * the TerminateVnf operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list parameter {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/lcm-operations-configuration/terminate-vnf-op-config/parameter + * + *

To create instances of this class use {@link ParameterBuilder}. + * @see ParameterBuilder + * @see ParameterKey + * + */ +public interface Parameter + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config.Parameter.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterBuilder.java new file mode 100644 index 0000000..be9b414 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ParameterBuilder + * @see Builder + * + */ +public class ParameterBuilder implements Builder { + + private String _key; + private String _value; + private ParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ParameterBuilder() { + } + + public ParameterBuilder(Parameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ParameterKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ParameterBuilder withKey(final ParameterKey key) { + this.key = key; + return this; + } + + public ParameterBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ParameterBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Parameter build() { + return new ParameterImpl(this); + } + + private static final class ParameterImpl + extends AbstractAugmentable + implements Parameter { + + private final String _key; + private final String _value; + private final ParameterKey key; + + ParameterImpl(ParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ParameterKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ParameterKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Parameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Parameter other = (Parameter)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ParameterImpl otherImpl = (ParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Parameter"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterKey.java new file mode 100644 index 0000000..95a215f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/lcm/operations/configuration/terminate/vnf/op/config/ParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.terminate.vnf.op.config; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ParameterKey + implements Identifier { + private static final long serialVersionUID = 8946355449704281588L; + private final String _key; + + + public ParameterKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ParameterKey(ParameterKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ParameterKey)) { + return false; + } + final ParameterKey other = (ParameterKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ParameterKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetails.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetails.java new file mode 100644 index 0000000..5e7f60e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetails.java @@ -0,0 +1,126 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.ScalingAspect; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.Deltas; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.DeltasKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * A specification of the deltas in terms of number of instances of VNFCs and + * virtual link bit rates that correspond to the scaling steps of this aspect. A + * cardinality of zero indicates that this mapping has to be specified in a + * lifecycle management script or be otherwise known to the VNFM. The information + * in this attribute, if provided, shall be consistent with the information + * provided in the 'InstantiationLevel' information element. If this attribute is + * provided, it shall be provided for all scaling aspects. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container aspect-delta-details {
+ *   list deltas {
+ *     key id;
+ *     min-elements 1;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list vdu-delta {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../../../../vdu/id;
+ *         }
+ *       }
+ *       leaf number-of-instances {
+ *         type uint32 {
+ *           range 0..max;
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-bit-rate-delta {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       container bit-rate-requirements {
+ *         leaf root {
+ *           type uint32;
+ *           units bits/sec;
+ *         }
+ *         leaf leaf {
+ *           type uint32;
+ *           units bits/sec;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   leaf step-deltas {
+ *     type leafref {
+ *       path ../deltas/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/scaling-aspect/aspect-delta-details + * + *

To create instances of this class use {@link AspectDeltaDetailsBuilder}. + * @see AspectDeltaDetailsBuilder + * + */ +public interface AspectDeltaDetails + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("aspect-delta-details"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.AspectDeltaDetails.class; + } + + /** + * Declares different scaling deltas, each of which is applied for one or more + * scaling steps of this aspect. + * + * + * + * @return java.util.Map deltas, or null if not present + */ + @Nullable Map getDeltas(); + + /** + * @return java.util.Map deltas, or an empty list if it is not present + */ + default @NonNull Map nonnullDeltas() { + return CodeHelpers.nonnull(getDeltas()); + } + + /** + * Identifiers of the individual scaling deltas to be applied for the subsequent + * scaling steps of this aspect. The first entry in the array shall correspond to + * the first scaling step (between scale levels 0 to 1) and the last entry in the + * array shall correspond to the last scaling step (between maxScaleLevel-1 and + * maxScaleLevel). Each referenced scaling delta shall be declared in the 'deltas' + * attribute. + * + * + * + * @return java.lang.String stepDeltas, or null if not present + */ + @Nullable String getStepDeltas(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetailsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetailsBuilder.java new file mode 100644 index 0000000..2107d7e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/AspectDeltaDetailsBuilder.java @@ -0,0 +1,270 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.Deltas; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.DeltasKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AspectDeltaDetailsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AspectDeltaDetailsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AspectDeltaDetailsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AspectDeltaDetailsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AspectDeltaDetailsBuilder + * @see Builder + * + */ +public class AspectDeltaDetailsBuilder implements Builder { + + private Map _deltas; + private String _stepDeltas; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AspectDeltaDetailsBuilder() { + } + + public AspectDeltaDetailsBuilder(AspectDeltaDetails base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._deltas = base.getDeltas(); + this._stepDeltas = base.getStepDeltas(); + } + + + public Map getDeltas() { + return _deltas; + } + + public String getStepDeltas() { + return _stepDeltas; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AspectDeltaDetailsBuilder setDeltas(final Map values) { + this._deltas = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDeltas(Map)} instead. + */ + @Deprecated(forRemoval = true) + public AspectDeltaDetailsBuilder setDeltas(final List values) { + return setDeltas(CodeHelpers.compatMap(values)); + } + + public AspectDeltaDetailsBuilder setStepDeltas(final String value) { + this._stepDeltas = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AspectDeltaDetailsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AspectDeltaDetailsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AspectDeltaDetailsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AspectDeltaDetailsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AspectDeltaDetails build() { + return new AspectDeltaDetailsImpl(this); + } + + private static final class AspectDeltaDetailsImpl + extends AbstractAugmentable + implements AspectDeltaDetails { + + private final Map _deltas; + private final String _stepDeltas; + + AspectDeltaDetailsImpl(AspectDeltaDetailsBuilder base) { + super(base.augmentation); + this._deltas = CodeHelpers.emptyToNull(base.getDeltas()); + this._stepDeltas = base.getStepDeltas(); + } + + @Override + public Map getDeltas() { + return _deltas; + } + + @Override + public String getStepDeltas() { + return _stepDeltas; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_deltas); + result = prime * result + Objects.hashCode(_stepDeltas); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AspectDeltaDetails.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AspectDeltaDetails other = (AspectDeltaDetails)obj; + if (!Objects.equals(_deltas, other.getDeltas())) { + return false; + } + if (!Objects.equals(_stepDeltas, other.getStepDeltas())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AspectDeltaDetailsImpl otherImpl = (AspectDeltaDetailsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AspectDeltaDetails"); + CodeHelpers.appendValue(helper, "_deltas", _deltas); + CodeHelpers.appendValue(helper, "_stepDeltas", _stepDeltas); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/Deltas.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/Deltas.java new file mode 100644 index 0000000..052d046 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/Deltas.java @@ -0,0 +1,133 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.AspectDeltaDetails; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VduDelta; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VduDeltaKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VirtualLinkBitRateDelta; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VirtualLinkBitRateDeltaKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Declares different scaling deltas, each of which is applied for one or more + * scaling steps of this aspect. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list deltas {
+ *   key id;
+ *   min-elements 1;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   list vdu-delta {
+ *     key id;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../../../../vdu/id;
+ *       }
+ *     }
+ *     leaf number-of-instances {
+ *       type uint32 {
+ *         range 0..max;
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-bit-rate-delta {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     container bit-rate-requirements {
+ *       leaf root {
+ *         type uint32;
+ *         units bits/sec;
+ *       }
+ *       leaf leaf {
+ *         type uint32;
+ *         units bits/sec;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/scaling-aspect/aspect-delta-details/deltas + * + *

To create instances of this class use {@link DeltasBuilder}. + * @see DeltasBuilder + * @see DeltasKey + * + */ +public interface Deltas + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("deltas"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.Deltas.class; + } + + /** + * Identifier of this scaling delta. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The number of VNFC instances based on particular VDUs to be created or removed. + * + * + * + * @return java.util.Map vduDelta, or null if not present + */ + @Nullable Map getVduDelta(); + + /** + * @return java.util.Map vduDelta, or an empty list if it is not present + */ + default @NonNull Map nonnullVduDelta() { + return CodeHelpers.nonnull(getVduDelta()); + } + + /** + * The bitrate to be added or removed to virtual links created from particular + * virtual link descriptors. + * + * + * + * @return java.util.Map virtualLinkBitRateDelta, or null if not present + */ + @Nullable Map getVirtualLinkBitRateDelta(); + + /** + * @return java.util.Map virtualLinkBitRateDelta, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkBitRateDelta() { + return CodeHelpers.nonnull(getVirtualLinkBitRateDelta()); + } + + @Override + DeltasKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasBuilder.java new file mode 100644 index 0000000..c015e89 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasBuilder.java @@ -0,0 +1,333 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VduDelta; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VduDeltaKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VirtualLinkBitRateDelta; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VirtualLinkBitRateDeltaKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link DeltasBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DeltasBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DeltasBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DeltasBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DeltasBuilder + * @see Builder + * + */ +public class DeltasBuilder implements Builder { + + private String _id; + private Map _vduDelta; + private Map _virtualLinkBitRateDelta; + private DeltasKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DeltasBuilder() { + } + + public DeltasBuilder(Deltas base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._vduDelta = base.getVduDelta(); + this._virtualLinkBitRateDelta = base.getVirtualLinkBitRateDelta(); + } + + + public DeltasKey key() { + return key; + } + + public String getId() { + return _id; + } + + public Map getVduDelta() { + return _vduDelta; + } + + public Map getVirtualLinkBitRateDelta() { + return _virtualLinkBitRateDelta; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public DeltasBuilder withKey(final DeltasKey key) { + this.key = key; + return this; + } + + public DeltasBuilder setId(final String value) { + this._id = value; + return this; + } + public DeltasBuilder setVduDelta(final Map values) { + this._vduDelta = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVduDelta(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DeltasBuilder setVduDelta(final List values) { + return setVduDelta(CodeHelpers.compatMap(values)); + } + public DeltasBuilder setVirtualLinkBitRateDelta(final Map values) { + this._virtualLinkBitRateDelta = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkBitRateDelta(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DeltasBuilder setVirtualLinkBitRateDelta(final List values) { + return setVirtualLinkBitRateDelta(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DeltasBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DeltasBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DeltasBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DeltasBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Deltas build() { + return new DeltasImpl(this); + } + + private static final class DeltasImpl + extends AbstractAugmentable + implements Deltas { + + private final String _id; + private final Map _vduDelta; + private final Map _virtualLinkBitRateDelta; + private final DeltasKey key; + + DeltasImpl(DeltasBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new DeltasKey(base.getId()); + } + this._id = key.getId(); + this._vduDelta = CodeHelpers.emptyToNull(base.getVduDelta()); + this._virtualLinkBitRateDelta = CodeHelpers.emptyToNull(base.getVirtualLinkBitRateDelta()); + } + + @Override + public DeltasKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getVduDelta() { + return _vduDelta; + } + + @Override + public Map getVirtualLinkBitRateDelta() { + return _virtualLinkBitRateDelta; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_vduDelta); + result = prime * result + Objects.hashCode(_virtualLinkBitRateDelta); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Deltas.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Deltas other = (Deltas)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_vduDelta, other.getVduDelta())) { + return false; + } + if (!Objects.equals(_virtualLinkBitRateDelta, other.getVirtualLinkBitRateDelta())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DeltasImpl otherImpl = (DeltasImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Deltas"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_vduDelta", _vduDelta); + CodeHelpers.appendValue(helper, "_virtualLinkBitRateDelta", _virtualLinkBitRateDelta); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasKey.java new file mode 100644 index 0000000..6461900 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/DeltasKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class DeltasKey + implements Identifier { + private static final long serialVersionUID = 2961737683842932339L; + private final String _id; + + + public DeltasKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public DeltasKey(DeltasKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DeltasKey)) { + return false; + } + final DeltasKey other = (DeltasKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(DeltasKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDelta.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDelta.java new file mode 100644 index 0000000..727eed3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDelta.java @@ -0,0 +1,81 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.Deltas; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * The number of VNFC instances based on particular VDUs to be created or removed. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vdu-delta {
+ *   key id;
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../../../../vdu/id;
+ *     }
+ *   }
+ *   leaf number-of-instances {
+ *     type uint32 {
+ *       range 0..max;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/scaling-aspect/aspect-delta-details/deltas/vdu-delta + * + *

To create instances of this class use {@link VduDeltaBuilder}. + * @see VduDeltaBuilder + * @see VduDeltaKey + * + */ +public interface VduDelta + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu-delta"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VduDelta.class; + } + + /** + * Uniquely identifies a VDU. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Number of instances of VNFC based on this VDU to deploy for an instantiation + * level or for a scaling delta. Shall be zero or greater. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 numberOfInstances, or null if not present + */ + @Nullable Uint32 getNumberOfInstances(); + + @Override + VduDeltaKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaBuilder.java new file mode 100644 index 0000000..f2479f6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaBuilder.java @@ -0,0 +1,292 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link VduDeltaBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VduDeltaBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VduDeltaBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VduDeltaBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VduDeltaBuilder + * @see Builder + * + */ +public class VduDeltaBuilder implements Builder { + + private String _id; + private Uint32 _numberOfInstances; + private VduDeltaKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VduDeltaBuilder() { + } + + public VduDeltaBuilder(VduDelta base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + + public VduDeltaKey key() { + return key; + } + + public String getId() { + return _id; + } + + public Uint32 getNumberOfInstances() { + return _numberOfInstances; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VduDeltaBuilder withKey(final VduDeltaKey key) { + this.key = key; + return this; + } + + public VduDeltaBuilder setId(final String value) { + this._id = value; + return this; + } + + private static void checkNumberOfInstancesRange(final long value) { + } + + public VduDeltaBuilder setNumberOfInstances(final Uint32 value) { + if (value != null) { + checkNumberOfInstancesRange(value.longValue()); + + } + this._numberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumberOfInstances(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public VduDeltaBuilder setNumberOfInstances(final Long value) { + return setNumberOfInstances(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VduDeltaBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VduDeltaBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VduDeltaBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VduDeltaBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VduDelta build() { + return new VduDeltaImpl(this); + } + + private static final class VduDeltaImpl + extends AbstractAugmentable + implements VduDelta { + + private final String _id; + private final Uint32 _numberOfInstances; + private final VduDeltaKey key; + + VduDeltaImpl(VduDeltaBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VduDeltaKey(base.getId()); + } + this._id = key.getId(); + this._numberOfInstances = base.getNumberOfInstances(); + } + + @Override + public VduDeltaKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Uint32 getNumberOfInstances() { + return _numberOfInstances; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_numberOfInstances); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VduDelta.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VduDelta other = (VduDelta)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_numberOfInstances, other.getNumberOfInstances())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VduDeltaImpl otherImpl = (VduDeltaImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VduDelta"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_numberOfInstances", _numberOfInstances); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaKey.java new file mode 100644 index 0000000..6d40bce --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VduDeltaKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VduDeltaKey + implements Identifier { + private static final long serialVersionUID = -914817658662368518L; + private final String _id; + + + public VduDeltaKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VduDeltaKey(VduDeltaKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VduDeltaKey)) { + return false; + } + final VduDeltaKey other = (VduDeltaKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VduDeltaKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDelta.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDelta.java new file mode 100644 index 0000000..0a3ea08 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDelta.java @@ -0,0 +1,85 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.Deltas; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.virtual.link.bit.rate.delta.BitRateRequirements; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The bitrate to be added or removed to virtual links created from particular + * virtual link descriptors. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-bit-rate-delta {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   container bit-rate-requirements {
+ *     leaf root {
+ *       type uint32;
+ *       units bits/sec;
+ *     }
+ *     leaf leaf {
+ *       type uint32;
+ *       units bits/sec;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/scaling-aspect/aspect-delta-details/deltas/virtual-link-bit-rate-delta + * + *

To create instances of this class use {@link VirtualLinkBitRateDeltaBuilder}. + * @see VirtualLinkBitRateDeltaBuilder + * @see VirtualLinkBitRateDeltaKey + * + */ +public interface VirtualLinkBitRateDelta + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-bit-rate-delta"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VirtualLinkBitRateDelta.class; + } + + /** + * Uniquely identifies a VnfVirtualLinkDesc. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Bitrate requirements for an instantiation level or bitrate delta for a scaling + * step. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.virtual.link.bit.rate.delta.BitRateRequirements bitRateRequirements, or null if not present + */ + @Nullable BitRateRequirements getBitRateRequirements(); + + @Override + VirtualLinkBitRateDeltaKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaBuilder.java new file mode 100644 index 0000000..e76f4f3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaBuilder.java @@ -0,0 +1,272 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.virtual.link.bit.rate.delta.BitRateRequirements; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkBitRateDeltaBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkBitRateDeltaBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkBitRateDeltaBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkBitRateDeltaBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkBitRateDeltaBuilder + * @see Builder + * + */ +public class VirtualLinkBitRateDeltaBuilder implements Builder { + + private BitRateRequirements _bitRateRequirements; + private String _id; + private VirtualLinkBitRateDeltaKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkBitRateDeltaBuilder() { + } + + public VirtualLinkBitRateDeltaBuilder(VirtualLinkBitRateDelta base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._bitRateRequirements = base.getBitRateRequirements(); + } + + + public VirtualLinkBitRateDeltaKey key() { + return key; + } + + public BitRateRequirements getBitRateRequirements() { + return _bitRateRequirements; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkBitRateDeltaBuilder withKey(final VirtualLinkBitRateDeltaKey key) { + this.key = key; + return this; + } + + public VirtualLinkBitRateDeltaBuilder setBitRateRequirements(final BitRateRequirements value) { + this._bitRateRequirements = value; + return this; + } + + public VirtualLinkBitRateDeltaBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkBitRateDeltaBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkBitRateDeltaBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkBitRateDeltaBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkBitRateDeltaBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkBitRateDelta build() { + return new VirtualLinkBitRateDeltaImpl(this); + } + + private static final class VirtualLinkBitRateDeltaImpl + extends AbstractAugmentable + implements VirtualLinkBitRateDelta { + + private final BitRateRequirements _bitRateRequirements; + private final String _id; + private final VirtualLinkBitRateDeltaKey key; + + VirtualLinkBitRateDeltaImpl(VirtualLinkBitRateDeltaBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkBitRateDeltaKey(base.getId()); + } + this._id = key.getId(); + this._bitRateRequirements = base.getBitRateRequirements(); + } + + @Override + public VirtualLinkBitRateDeltaKey key() { + return key; + } + + @Override + public BitRateRequirements getBitRateRequirements() { + return _bitRateRequirements; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_bitRateRequirements); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkBitRateDelta.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkBitRateDelta other = (VirtualLinkBitRateDelta)obj; + if (!Objects.equals(_bitRateRequirements, other.getBitRateRequirements())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkBitRateDeltaImpl otherImpl = (VirtualLinkBitRateDeltaImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkBitRateDelta"); + CodeHelpers.appendValue(helper, "_bitRateRequirements", _bitRateRequirements); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaKey.java new file mode 100644 index 0000000..34000dc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/VirtualLinkBitRateDeltaKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkBitRateDeltaKey + implements Identifier { + private static final long serialVersionUID = 1534832672872143650L; + private final String _id; + + + public VirtualLinkBitRateDeltaKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkBitRateDeltaKey(VirtualLinkBitRateDeltaKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkBitRateDeltaKey)) { + return false; + } + final VirtualLinkBitRateDeltaKey other = (VirtualLinkBitRateDeltaKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkBitRateDeltaKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirements.java new file mode 100644 index 0000000..dbe14dd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirements.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.virtual.link.bit.rate.delta; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.VirtualLinkBitRateDelta; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Bitrate requirements for an instantiation level or bitrate delta for a scaling + * step. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container bit-rate-requirements {
+ *   leaf root {
+ *     type uint32;
+ *     units bits/sec;
+ *   }
+ *   leaf leaf {
+ *     type uint32;
+ *     units bits/sec;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/scaling-aspect/aspect-delta-details/deltas/virtual-link-bit-rate-delta/bit-rate-requirements + * + *

To create instances of this class use {@link BitRateRequirementsBuilder}. + * @see BitRateRequirementsBuilder + * + */ +public interface BitRateRequirements + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("bit-rate-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.virtual.link.bit.rate.delta.BitRateRequirements.class; + } + + /** + * Throughput requirement of the link (e.g. bitrate of E-Line, root bitrate of + * E-Tree, aggregate capacity of E-LAN). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 root, or null if not present + */ + @Nullable Uint32 getRoot(); + + /** + * Throughput requirement of leaf connections to the link when applicable to the + * connectivity type (e.g. for E-Tree and E-LAN branches). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 leaf, or null if not present + */ + @Nullable Uint32 getLeaf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirementsBuilder.java new file mode 100644 index 0000000..dd8e11e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/scaling/aspect/aspect/delta/details/deltas/virtual/link/bit/rate/delta/BitRateRequirementsBuilder.java @@ -0,0 +1,276 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.scaling.aspect.aspect.delta.details.deltas.virtual.link.bit.rate.delta; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link BitRateRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     BitRateRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new BitRateRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of BitRateRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see BitRateRequirementsBuilder + * @see Builder + * + */ +public class BitRateRequirementsBuilder implements Builder { + + private Uint32 _leaf; + private Uint32 _root; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public BitRateRequirementsBuilder() { + } + + public BitRateRequirementsBuilder(BitRateRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + + public Uint32 getLeaf() { + return _leaf; + } + + public Uint32 getRoot() { + return _root; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public BitRateRequirementsBuilder setLeaf(final Uint32 value) { + this._leaf = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLeaf(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public BitRateRequirementsBuilder setLeaf(final Long value) { + return setLeaf(CodeHelpers.compatUint(value)); + } + + public BitRateRequirementsBuilder setRoot(final Uint32 value) { + this._root = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setRoot(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public BitRateRequirementsBuilder setRoot(final Long value) { + return setRoot(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public BitRateRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public BitRateRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public BitRateRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private BitRateRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public BitRateRequirements build() { + return new BitRateRequirementsImpl(this); + } + + private static final class BitRateRequirementsImpl + extends AbstractAugmentable + implements BitRateRequirements { + + private final Uint32 _leaf; + private final Uint32 _root; + + BitRateRequirementsImpl(BitRateRequirementsBuilder base) { + super(base.augmentation); + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + @Override + public Uint32 getLeaf() { + return _leaf; + } + + @Override + public Uint32 getRoot() { + return _root; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_leaf); + result = prime * result + Objects.hashCode(_root); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!BitRateRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + BitRateRequirements other = (BitRateRequirements)obj; + if (!Objects.equals(_leaf, other.getLeaf())) { + return false; + } + if (!Objects.equals(_root, other.getRoot())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + BitRateRequirementsImpl otherImpl = (BitRateRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("BitRateRequirements"); + CodeHelpers.appendValue(helper, "_leaf", _leaf); + CodeHelpers.appendValue(helper, "_root", _root); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetails.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetails.java new file mode 100644 index 0000000..e26ada4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetails.java @@ -0,0 +1,66 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.SupportedVnfInterfaces; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list interface-details {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/supported-vnf-interfaces/interface-details + * + *

To create instances of this class use {@link InterfaceDetailsBuilder}. + * @see InterfaceDetailsBuilder + * @see InterfaceDetailsKey + * + */ +public interface InterfaceDetails + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("interface-details"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces.InterfaceDetails.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + InterfaceDetailsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsBuilder.java new file mode 100644 index 0000000..422f5b9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link InterfaceDetailsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     InterfaceDetailsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new InterfaceDetailsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of InterfaceDetailsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see InterfaceDetailsBuilder + * @see Builder + * + */ +public class InterfaceDetailsBuilder implements Builder { + + private String _key; + private String _value; + private InterfaceDetailsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public InterfaceDetailsBuilder() { + } + + public InterfaceDetailsBuilder(InterfaceDetails base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public InterfaceDetailsKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public InterfaceDetailsBuilder withKey(final InterfaceDetailsKey key) { + this.key = key; + return this; + } + + public InterfaceDetailsBuilder setKey(final String value) { + this._key = value; + return this; + } + + public InterfaceDetailsBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public InterfaceDetailsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public InterfaceDetailsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public InterfaceDetailsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private InterfaceDetailsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public InterfaceDetails build() { + return new InterfaceDetailsImpl(this); + } + + private static final class InterfaceDetailsImpl + extends AbstractAugmentable + implements InterfaceDetails { + + private final String _key; + private final String _value; + private final InterfaceDetailsKey key; + + InterfaceDetailsImpl(InterfaceDetailsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new InterfaceDetailsKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public InterfaceDetailsKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!InterfaceDetails.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + InterfaceDetails other = (InterfaceDetails)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + InterfaceDetailsImpl otherImpl = (InterfaceDetailsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("InterfaceDetails"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsKey.java new file mode 100644 index 0000000..bd839a5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/supported/vnf/interfaces/InterfaceDetailsKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.supported.vnf.interfaces; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class InterfaceDetailsKey + implements Identifier { + private static final long serialVersionUID = -5048181238924750706L; + private final String _key; + + + public InterfaceDetailsKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public InterfaceDetailsKey(InterfaceDetailsKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof InterfaceDetailsKey)) { + return false; + } + final InterfaceDetailsKey other = (InterfaceDetailsKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(InterfaceDetailsKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroup.java new file mode 100644 index 0000000..160a5b3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroup.java @@ -0,0 +1,66 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VduProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifier(s) of the affinity or anti-affinity group(s) the VDU belongs to. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group {
+ *   key id;
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../affinity-or-anti-affinity-group/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/vdu-profile/affinity-or-anti-affinity-group + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupBuilder}. + * @see AffinityOrAntiAffinityGroupBuilder + * @see AffinityOrAntiAffinityGroupKey + * + */ +public interface AffinityOrAntiAffinityGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile.AffinityOrAntiAffinityGroup.class; + } + + /** + * Identifies an affinity or anti-affinity group to which the affinity or + * anti-affinity rule applies. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + AffinityOrAntiAffinityGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupBuilder.java new file mode 100644 index 0000000..c876163 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupBuilder implements Builder { + + private String _id; + private AffinityOrAntiAffinityGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupBuilder() { + } + + public AffinityOrAntiAffinityGroupBuilder(AffinityOrAntiAffinityGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + } + + + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupBuilder withKey(final AffinityOrAntiAffinityGroupKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroup build() { + return new AffinityOrAntiAffinityGroupImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroup { + + private final String _id; + private final AffinityOrAntiAffinityGroupKey key; + + AffinityOrAntiAffinityGroupImpl(AffinityOrAntiAffinityGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupKey(base.getId()); + } + this._id = key.getId(); + } + + @Override + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroup other = (AffinityOrAntiAffinityGroup)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupImpl otherImpl = (AffinityOrAntiAffinityGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroup"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupKey.java new file mode 100644 index 0000000..e1ec4b4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/vdu/profile/AffinityOrAntiAffinityGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.vdu.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupKey + implements Identifier { + private static final long serialVersionUID = -4909084403753675647L; + private final String _id; + + + public AffinityOrAntiAffinityGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupKey(AffinityOrAntiAffinityGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupKey)) { + return false; + } + final AffinityOrAntiAffinityGroupKey other = (AffinityOrAntiAffinityGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java new file mode 100644 index 0000000..76b0157 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroup.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifier(s) of the affinity or anti-affinity group(s) the VnfVirtualLinkDesc + * belongs to. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group {
+ *   key id;
+ *   leaf id {
+ *     type leafref {
+ *       path ../../../affinity-or-anti-affinity-group/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/virtual-link-profile/affinity-or-anti-affinity-group + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupBuilder}. + * @see AffinityOrAntiAffinityGroupBuilder + * @see AffinityOrAntiAffinityGroupKey + * + */ +public interface AffinityOrAntiAffinityGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.AffinityOrAntiAffinityGroup.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + AffinityOrAntiAffinityGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java new file mode 100644 index 0000000..1e3a2ed --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupBuilder implements Builder { + + private String _id; + private AffinityOrAntiAffinityGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupBuilder() { + } + + public AffinityOrAntiAffinityGroupBuilder(AffinityOrAntiAffinityGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + } + + + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupBuilder withKey(final AffinityOrAntiAffinityGroupKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroup build() { + return new AffinityOrAntiAffinityGroupImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroup { + + private final String _id; + private final AffinityOrAntiAffinityGroupKey key; + + AffinityOrAntiAffinityGroupImpl(AffinityOrAntiAffinityGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupKey(base.getId()); + } + this._id = key.getId(); + } + + @Override + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroup other = (AffinityOrAntiAffinityGroup)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupImpl otherImpl = (AffinityOrAntiAffinityGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroup"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java new file mode 100644 index 0000000..e15bb71 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/AffinityOrAntiAffinityGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupKey + implements Identifier { + private static final long serialVersionUID = -4909084403753675647L; + private final String _id; + + + public AffinityOrAntiAffinityGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupKey(AffinityOrAntiAffinityGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupKey)) { + return false; + } + final AffinityOrAntiAffinityGroupKey other = (AffinityOrAntiAffinityGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirements.java new file mode 100644 index 0000000..c53850d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirements.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Specifies the maximum bitrate requirements for a VL instantiated according to + * this profile. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container max-bit-rate-requirements {
+ *   leaf root {
+ *     type uint32;
+ *   }
+ *   leaf leaf {
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/virtual-link-profile/max-bit-rate-requirements + * + *

To create instances of this class use {@link MaxBitRateRequirementsBuilder}. + * @see MaxBitRateRequirementsBuilder + * + */ +public interface MaxBitRateRequirements + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("max-bit-rate-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MaxBitRateRequirements.class; + } + + /** + * Throughput requirement of the link (e.g. bitrate of E-Line, root bitrate of + * E-Tree, aggregate capacity of E-LAN). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 root, or null if not present + */ + @Nullable Uint32 getRoot(); + + /** + * Throughput requirement of leaf connections to the link when applicable to the + * connectivity type (e.g. for E-Tree and E-LAN branches). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 leaf, or null if not present + */ + @Nullable Uint32 getLeaf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirementsBuilder.java new file mode 100644 index 0000000..59a7760 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MaxBitRateRequirementsBuilder.java @@ -0,0 +1,276 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link MaxBitRateRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MaxBitRateRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MaxBitRateRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MaxBitRateRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MaxBitRateRequirementsBuilder + * @see Builder + * + */ +public class MaxBitRateRequirementsBuilder implements Builder { + + private Uint32 _leaf; + private Uint32 _root; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MaxBitRateRequirementsBuilder() { + } + + public MaxBitRateRequirementsBuilder(MaxBitRateRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + + public Uint32 getLeaf() { + return _leaf; + } + + public Uint32 getRoot() { + return _root; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public MaxBitRateRequirementsBuilder setLeaf(final Uint32 value) { + this._leaf = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLeaf(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public MaxBitRateRequirementsBuilder setLeaf(final Long value) { + return setLeaf(CodeHelpers.compatUint(value)); + } + + public MaxBitRateRequirementsBuilder setRoot(final Uint32 value) { + this._root = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setRoot(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public MaxBitRateRequirementsBuilder setRoot(final Long value) { + return setRoot(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MaxBitRateRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MaxBitRateRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MaxBitRateRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MaxBitRateRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MaxBitRateRequirements build() { + return new MaxBitRateRequirementsImpl(this); + } + + private static final class MaxBitRateRequirementsImpl + extends AbstractAugmentable + implements MaxBitRateRequirements { + + private final Uint32 _leaf; + private final Uint32 _root; + + MaxBitRateRequirementsImpl(MaxBitRateRequirementsBuilder base) { + super(base.augmentation); + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + @Override + public Uint32 getLeaf() { + return _leaf; + } + + @Override + public Uint32 getRoot() { + return _root; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_leaf); + result = prime * result + Objects.hashCode(_root); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MaxBitRateRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MaxBitRateRequirements other = (MaxBitRateRequirements)obj; + if (!Objects.equals(_leaf, other.getLeaf())) { + return false; + } + if (!Objects.equals(_root, other.getRoot())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MaxBitRateRequirementsImpl otherImpl = (MaxBitRateRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MaxBitRateRequirements"); + CodeHelpers.appendValue(helper, "_leaf", _leaf); + CodeHelpers.appendValue(helper, "_root", _root); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirements.java new file mode 100644 index 0000000..02f1e07 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirements.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfile; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Specifies the minimum bitrate requirements for a VL instantiated according to + * this profile. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container min-bit-rate-requirements {
+ *   leaf root {
+ *     type uint32;
+ *   }
+ *   leaf leaf {
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/virtual-link-profile/min-bit-rate-requirements + * + *

To create instances of this class use {@link MinBitRateRequirementsBuilder}. + * @see MinBitRateRequirementsBuilder + * + */ +public interface MinBitRateRequirements + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("min-bit-rate-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.MinBitRateRequirements.class; + } + + /** + * Throughput requirement of the link (e.g. bitrate of E-Line, root bitrate of + * E-Tree, aggregate capacity of E-LAN). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 root, or null if not present + */ + @Nullable Uint32 getRoot(); + + /** + * Throughput requirement of leaf connections to the link when applicable to the + * connectivity type (e.g. for E-Tree and E-LAN branches). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 leaf, or null if not present + */ + @Nullable Uint32 getLeaf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirementsBuilder.java new file mode 100644 index 0000000..4d6a26d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/MinBitRateRequirementsBuilder.java @@ -0,0 +1,276 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link MinBitRateRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MinBitRateRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MinBitRateRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MinBitRateRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MinBitRateRequirementsBuilder + * @see Builder + * + */ +public class MinBitRateRequirementsBuilder implements Builder { + + private Uint32 _leaf; + private Uint32 _root; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MinBitRateRequirementsBuilder() { + } + + public MinBitRateRequirementsBuilder(MinBitRateRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + + public Uint32 getLeaf() { + return _leaf; + } + + public Uint32 getRoot() { + return _root; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public MinBitRateRequirementsBuilder setLeaf(final Uint32 value) { + this._leaf = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLeaf(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public MinBitRateRequirementsBuilder setLeaf(final Long value) { + return setLeaf(CodeHelpers.compatUint(value)); + } + + public MinBitRateRequirementsBuilder setRoot(final Uint32 value) { + this._root = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setRoot(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public MinBitRateRequirementsBuilder setRoot(final Long value) { + return setRoot(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MinBitRateRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MinBitRateRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MinBitRateRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MinBitRateRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MinBitRateRequirements build() { + return new MinBitRateRequirementsImpl(this); + } + + private static final class MinBitRateRequirementsImpl + extends AbstractAugmentable + implements MinBitRateRequirements { + + private final Uint32 _leaf; + private final Uint32 _root; + + MinBitRateRequirementsImpl(MinBitRateRequirementsBuilder base) { + super(base.augmentation); + this._leaf = base.getLeaf(); + this._root = base.getRoot(); + } + + @Override + public Uint32 getLeaf() { + return _leaf; + } + + @Override + public Uint32 getRoot() { + return _root; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_leaf); + result = prime * result + Objects.hashCode(_root); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MinBitRateRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MinBitRateRequirements other = (MinBitRateRequirements)obj; + if (!Objects.equals(_leaf, other.getLeaf())) { + return false; + } + if (!Objects.equals(_root, other.getRoot())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MinBitRateRequirementsImpl otherImpl = (MinBitRateRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MinBitRateRequirements"); + CodeHelpers.appendValue(helper, "_leaf", _leaf); + CodeHelpers.appendValue(helper, "_root", _root); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolData.java new file mode 100644 index 0000000..579c118 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolData.java @@ -0,0 +1,137 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.VirtualLinkProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L2ProtocolData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L3ProtocolData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the protocol data for a VL instantiated according to this profile. + * Cardinality 0 is used when no protocol data needs to be specified. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container virtual-link-protocol-data {
+ *   leaf associated-layer-protocol {
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   container l2-protocol-data {
+ *     when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf network-type {
+ *       type enumeration {
+ *         enum flat;
+ *         enum vlan;
+ *         enum vxlan;
+ *         enum gre;
+ *       }
+ *     }
+ *     leaf vlan-transparent {
+ *       type boolean;
+ *     }
+ *     leaf mtu {
+ *       type uint16;
+ *     }
+ *   }
+ *   container l3-protocol-data {
+ *     when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf ip-version {
+ *       type enumeration {
+ *         enum ipv4;
+ *         enum ipv6;
+ *       }
+ *       default ipv4;
+ *     }
+ *     leaf cidr {
+ *       type string;
+ *     }
+ *     leaf-list ip-allocation-pools {
+ *       type string;
+ *     }
+ *     leaf gateway-ip {
+ *       type inet:ip-address;
+ *     }
+ *     leaf dhcp-enabled {
+ *       type boolean;
+ *       default true;
+ *     }
+ *     leaf ipv6-address-mode {
+ *       when "../ip-version = 'ipv6'";
+ *       type enumeration {
+ *         enum slaac;
+ *         enum dhcpv6-stateful;
+ *         enum dhcpv6-stateless;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/virtual-link-profile/virtual-link-protocol-data + * + *

To create instances of this class use {@link VirtualLinkProtocolDataBuilder}. + * @see VirtualLinkProtocolDataBuilder + * + */ +public interface VirtualLinkProtocolData + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-protocol-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.VirtualLinkProtocolData.class; + } + + /** + * One of the values of the attribute layerProtocol of the ConnectivityType IE. + * + * + * + * @return java.lang.Class associatedLayerProtocol, or null if not present + */ + @Nullable Class getAssociatedLayerProtocol(); + + /** + * Specifies the L2 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L2 protocol and shall be absent + * otherwise. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L2ProtocolData l2ProtocolData, or null if not present + */ + @Nullable L2ProtocolData getL2ProtocolData(); + + /** + * Specifies the L3 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L3 protocol and shall be absent + * otherwise. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L3ProtocolData l3ProtocolData, or null if not present + */ + @Nullable L3ProtocolData getL3ProtocolData(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolDataBuilder.java new file mode 100644 index 0000000..8114a62 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/VirtualLinkProtocolDataBuilder.java @@ -0,0 +1,276 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L2ProtocolData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L3ProtocolData; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkProtocolDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkProtocolDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkProtocolDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkProtocolDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkProtocolDataBuilder + * @see Builder + * + */ +public class VirtualLinkProtocolDataBuilder implements Builder { + + private Class _associatedLayerProtocol; + private L2ProtocolData _l2ProtocolData; + private L3ProtocolData _l3ProtocolData; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkProtocolDataBuilder() { + } + + public VirtualLinkProtocolDataBuilder(VirtualLinkProtocolData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._associatedLayerProtocol = base.getAssociatedLayerProtocol(); + this._l2ProtocolData = base.getL2ProtocolData(); + this._l3ProtocolData = base.getL3ProtocolData(); + } + + + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + public L2ProtocolData getL2ProtocolData() { + return _l2ProtocolData; + } + + public L3ProtocolData getL3ProtocolData() { + return _l3ProtocolData; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VirtualLinkProtocolDataBuilder setAssociatedLayerProtocol(final Class value) { + this._associatedLayerProtocol = value; + return this; + } + + public VirtualLinkProtocolDataBuilder setL2ProtocolData(final L2ProtocolData value) { + this._l2ProtocolData = value; + return this; + } + + public VirtualLinkProtocolDataBuilder setL3ProtocolData(final L3ProtocolData value) { + this._l3ProtocolData = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkProtocolDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProtocolDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkProtocolDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkProtocolDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkProtocolData build() { + return new VirtualLinkProtocolDataImpl(this); + } + + private static final class VirtualLinkProtocolDataImpl + extends AbstractAugmentable + implements VirtualLinkProtocolData { + + private final Class _associatedLayerProtocol; + private final L2ProtocolData _l2ProtocolData; + private final L3ProtocolData _l3ProtocolData; + + VirtualLinkProtocolDataImpl(VirtualLinkProtocolDataBuilder base) { + super(base.augmentation); + this._associatedLayerProtocol = base.getAssociatedLayerProtocol(); + this._l2ProtocolData = base.getL2ProtocolData(); + this._l3ProtocolData = base.getL3ProtocolData(); + } + + @Override + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + @Override + public L2ProtocolData getL2ProtocolData() { + return _l2ProtocolData; + } + + @Override + public L3ProtocolData getL3ProtocolData() { + return _l3ProtocolData; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_associatedLayerProtocol); + result = prime * result + Objects.hashCode(_l2ProtocolData); + result = prime * result + Objects.hashCode(_l3ProtocolData); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkProtocolData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkProtocolData other = (VirtualLinkProtocolData)obj; + if (!Objects.equals(_associatedLayerProtocol, other.getAssociatedLayerProtocol())) { + return false; + } + if (!Objects.equals(_l2ProtocolData, other.getL2ProtocolData())) { + return false; + } + if (!Objects.equals(_l3ProtocolData, other.getL3ProtocolData())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkProtocolDataImpl otherImpl = (VirtualLinkProtocolDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkProtocolData"); + CodeHelpers.appendValue(helper, "_associatedLayerProtocol", _associatedLayerProtocol); + CodeHelpers.appendValue(helper, "_l2ProtocolData", _l2ProtocolData); + CodeHelpers.appendValue(helper, "_l3ProtocolData", _l3ProtocolData); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolData.java new file mode 100644 index 0000000..3162407 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolData.java @@ -0,0 +1,174 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.VirtualLinkProtocolData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Specifies the L2 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L2 protocol and shall be absent + * otherwise. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container l2-protocol-data {
+ *   when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf network-type {
+ *     type enumeration {
+ *       enum flat;
+ *       enum vlan;
+ *       enum vxlan;
+ *       enum gre;
+ *     }
+ *   }
+ *   leaf vlan-transparent {
+ *     type boolean;
+ *   }
+ *   leaf mtu {
+ *     type uint16;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/virtual-link-profile/virtual-link-protocol-data/l2-protocol-data + * + *

To create instances of this class use {@link L2ProtocolDataBuilder}. + * @see L2ProtocolDataBuilder + * + */ +public interface L2ProtocolData + extends + ChildOf, + Augmentable +{ + + + public enum NetworkType implements Enumeration { + Flat(0, "flat"), + + Vlan(1, "vlan"), + + Vxlan(2, "vxlan"), + + Gre(3, "gre") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (NetworkType enumItem : NetworkType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private NetworkType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding NetworkType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding NetworkType item, or null if no such item exists + */ + public static NetworkType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l2-protocol-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L2ProtocolData.class; + } + + /** + * Network name associated with this L2 protocol. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Specifies the network type for this L2 protocol. Possible values: FLAT, VLAN, + * VXLAN, GRE. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L2ProtocolData.NetworkType networkType, or null if not present + */ + @Nullable NetworkType getNetworkType(); + + /** + * Specifies whether to support VLAN transparency for this L2 protocol or not. + * + * + * + * @return java.lang.Boolean vlanTransparent, or null if not present + */ + @Nullable Boolean isVlanTransparent(); + + /** + * Specifies the maximum transmission unit (MTU) value for this L2 protocol. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 mtu, or null if not present + */ + @Nullable Uint16 getMtu(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolDataBuilder.java new file mode 100644 index 0000000..a66a755 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L2ProtocolDataBuilder.java @@ -0,0 +1,311 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link L2ProtocolDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L2ProtocolDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L2ProtocolDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L2ProtocolDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L2ProtocolDataBuilder + * @see Builder + * + */ +public class L2ProtocolDataBuilder implements Builder { + + private Uint16 _mtu; + private String _name; + private L2ProtocolData.NetworkType _networkType; + private Boolean _vlanTransparent; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L2ProtocolDataBuilder() { + } + + public L2ProtocolDataBuilder(L2ProtocolData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._mtu = base.getMtu(); + this._name = base.getName(); + this._networkType = base.getNetworkType(); + this._vlanTransparent = base.isVlanTransparent(); + } + + + public Uint16 getMtu() { + return _mtu; + } + + public String getName() { + return _name; + } + + public L2ProtocolData.NetworkType getNetworkType() { + return _networkType; + } + + public Boolean isVlanTransparent() { + return _vlanTransparent; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L2ProtocolDataBuilder setMtu(final Uint16 value) { + this._mtu = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMtu(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public L2ProtocolDataBuilder setMtu(final Integer value) { + return setMtu(CodeHelpers.compatUint(value)); + } + + public L2ProtocolDataBuilder setName(final String value) { + this._name = value; + return this; + } + + public L2ProtocolDataBuilder setNetworkType(final L2ProtocolData.NetworkType value) { + this._networkType = value; + return this; + } + + public L2ProtocolDataBuilder setVlanTransparent(final Boolean value) { + this._vlanTransparent = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L2ProtocolDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L2ProtocolDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L2ProtocolDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L2ProtocolDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L2ProtocolData build() { + return new L2ProtocolDataImpl(this); + } + + private static final class L2ProtocolDataImpl + extends AbstractAugmentable + implements L2ProtocolData { + + private final Uint16 _mtu; + private final String _name; + private final L2ProtocolData.NetworkType _networkType; + private final Boolean _vlanTransparent; + + L2ProtocolDataImpl(L2ProtocolDataBuilder base) { + super(base.augmentation); + this._mtu = base.getMtu(); + this._name = base.getName(); + this._networkType = base.getNetworkType(); + this._vlanTransparent = base.isVlanTransparent(); + } + + @Override + public Uint16 getMtu() { + return _mtu; + } + + @Override + public String getName() { + return _name; + } + + @Override + public L2ProtocolData.NetworkType getNetworkType() { + return _networkType; + } + + @Override + public Boolean isVlanTransparent() { + return _vlanTransparent; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_mtu); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_networkType); + result = prime * result + Objects.hashCode(_vlanTransparent); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L2ProtocolData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L2ProtocolData other = (L2ProtocolData)obj; + if (!Objects.equals(_mtu, other.getMtu())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_networkType, other.getNetworkType())) { + return false; + } + if (!Objects.equals(_vlanTransparent, other.isVlanTransparent())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L2ProtocolDataImpl otherImpl = (L2ProtocolDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L2ProtocolData"); + CodeHelpers.appendValue(helper, "_mtu", _mtu); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_networkType", _networkType); + CodeHelpers.appendValue(helper, "_vlanTransparent", _vlanTransparent); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolData.java new file mode 100644 index 0000000..d6947be --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolData.java @@ -0,0 +1,278 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.VirtualLinkProtocolData; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the L3 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L3 protocol and shall be absent + * otherwise. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container l3-protocol-data {
+ *   when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf ip-version {
+ *     type enumeration {
+ *       enum ipv4;
+ *       enum ipv6;
+ *     }
+ *     default ipv4;
+ *   }
+ *   leaf cidr {
+ *     type string;
+ *   }
+ *   leaf-list ip-allocation-pools {
+ *     type string;
+ *   }
+ *   leaf gateway-ip {
+ *     type inet:ip-address;
+ *   }
+ *   leaf dhcp-enabled {
+ *     type boolean;
+ *     default true;
+ *   }
+ *   leaf ipv6-address-mode {
+ *     when "../ip-version = 'ipv6'";
+ *     type enumeration {
+ *       enum slaac;
+ *       enum dhcpv6-stateful;
+ *       enum dhcpv6-stateless;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/df/virtual-link-profile/virtual-link-protocol-data/l3-protocol-data + * + *

To create instances of this class use {@link L3ProtocolDataBuilder}. + * @see L3ProtocolDataBuilder + * + */ +public interface L3ProtocolData + extends + ChildOf, + Augmentable +{ + + + public enum IpVersion implements Enumeration { + Ipv4(0, "ipv4"), + + Ipv6(1, "ipv6") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (IpVersion enumItem : IpVersion.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private IpVersion(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding IpVersion item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding IpVersion item, or null if no such item exists + */ + public static IpVersion forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public enum Ipv6AddressMode implements Enumeration { + Slaac(0, "slaac"), + + Dhcpv6Stateful(1, "dhcpv6-stateful"), + + Dhcpv6Stateless(2, "dhcpv6-stateless") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Ipv6AddressMode enumItem : Ipv6AddressMode.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Ipv6AddressMode(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Ipv6AddressMode item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Ipv6AddressMode item, or null if no such item exists + */ + public static Ipv6AddressMode forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l3-protocol-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L3ProtocolData.class; + } + + /** + * Network name associated with this L3 protocol. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Specifies IP version of this L3 protocol. Value: • IPV4. • IPV6. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L3ProtocolData.IpVersion ipVersion, or null if not present + */ + @Nullable IpVersion getIpVersion(); + + /** + * Specifies the CIDR (Classless InterDomain Routing) of this L3 protocol. + * + * + * + * @return java.lang.String cidr, or null if not present + */ + @Nullable String getCidr(); + + /** + * Specifies the allocation pools with start and end IP addresses for this L3 + * protocol. + * + * + * + * @return java.util.List ipAllocationPools, or null if not present + */ + @Nullable List getIpAllocationPools(); + + /** + * Specifies the gateway IP address for this L3 protocol. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress gatewayIp, or null if not present + */ + @Nullable IpAddress getGatewayIp(); + + /** + * Indicates whether DHCP (Dynamic Host Configuration Protocol) is enabled or + * disabled for this L3 protocol. + * + * + * + * @return java.lang.Boolean dhcpEnabled, or null if not present + */ + @Nullable Boolean isDhcpEnabled(); + + /** + * Specifies IPv6 address mode. Possible values: • SLAAC. • DHCPV6-STATEFUL. • + * DHCPV6-STATELESS. May be present when the value of the ipVersion attribute is + * 'IPV6' and shall be absent otherwise. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L3ProtocolData.Ipv6AddressMode ipv6AddressMode, or null if not present + */ + @Nullable Ipv6AddressMode getIpv6AddressMode(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolDataBuilder.java new file mode 100644 index 0000000..a09833c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/df/virtual/link/profile/virtual/link/protocol/data/L3ProtocolDataBuilder.java @@ -0,0 +1,368 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link L3ProtocolDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L3ProtocolDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L3ProtocolDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L3ProtocolDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L3ProtocolDataBuilder + * @see Builder + * + */ +public class L3ProtocolDataBuilder implements Builder { + + private String _cidr; + private IpAddress _gatewayIp; + private List _ipAllocationPools; + private L3ProtocolData.IpVersion _ipVersion; + private L3ProtocolData.Ipv6AddressMode _ipv6AddressMode; + private String _name; + private Boolean _dhcpEnabled; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L3ProtocolDataBuilder() { + } + + public L3ProtocolDataBuilder(L3ProtocolData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cidr = base.getCidr(); + this._gatewayIp = base.getGatewayIp(); + this._ipAllocationPools = base.getIpAllocationPools(); + this._ipVersion = base.getIpVersion(); + this._ipv6AddressMode = base.getIpv6AddressMode(); + this._name = base.getName(); + this._dhcpEnabled = base.isDhcpEnabled(); + } + + + public String getCidr() { + return _cidr; + } + + public IpAddress getGatewayIp() { + return _gatewayIp; + } + + public List getIpAllocationPools() { + return _ipAllocationPools; + } + + public L3ProtocolData.IpVersion getIpVersion() { + return _ipVersion; + } + + public L3ProtocolData.Ipv6AddressMode getIpv6AddressMode() { + return _ipv6AddressMode; + } + + public String getName() { + return _name; + } + + public Boolean isDhcpEnabled() { + return _dhcpEnabled; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L3ProtocolDataBuilder setCidr(final String value) { + this._cidr = value; + return this; + } + + public L3ProtocolDataBuilder setGatewayIp(final IpAddress value) { + this._gatewayIp = value; + return this; + } + public L3ProtocolDataBuilder setIpAllocationPools(final List values) { + this._ipAllocationPools = values; + return this; + } + + + public L3ProtocolDataBuilder setIpVersion(final L3ProtocolData.IpVersion value) { + this._ipVersion = value; + return this; + } + + public L3ProtocolDataBuilder setIpv6AddressMode(final L3ProtocolData.Ipv6AddressMode value) { + this._ipv6AddressMode = value; + return this; + } + + public L3ProtocolDataBuilder setName(final String value) { + this._name = value; + return this; + } + + public L3ProtocolDataBuilder setDhcpEnabled(final Boolean value) { + this._dhcpEnabled = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L3ProtocolDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L3ProtocolDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L3ProtocolDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L3ProtocolDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L3ProtocolData build() { + return new L3ProtocolDataImpl(this); + } + + private static final class L3ProtocolDataImpl + extends AbstractAugmentable + implements L3ProtocolData { + + private final String _cidr; + private final IpAddress _gatewayIp; + private final List _ipAllocationPools; + private final L3ProtocolData.IpVersion _ipVersion; + private final L3ProtocolData.Ipv6AddressMode _ipv6AddressMode; + private final String _name; + private final Boolean _dhcpEnabled; + + L3ProtocolDataImpl(L3ProtocolDataBuilder base) { + super(base.augmentation); + this._cidr = base.getCidr(); + this._gatewayIp = base.getGatewayIp(); + this._ipAllocationPools = base.getIpAllocationPools(); + this._ipVersion = base.getIpVersion(); + this._ipv6AddressMode = base.getIpv6AddressMode(); + this._name = base.getName(); + this._dhcpEnabled = base.isDhcpEnabled(); + } + + @Override + public String getCidr() { + return _cidr; + } + + @Override + public IpAddress getGatewayIp() { + return _gatewayIp; + } + + @Override + public List getIpAllocationPools() { + return _ipAllocationPools; + } + + @Override + public L3ProtocolData.IpVersion getIpVersion() { + return _ipVersion; + } + + @Override + public L3ProtocolData.Ipv6AddressMode getIpv6AddressMode() { + return _ipv6AddressMode; + } + + @Override + public String getName() { + return _name; + } + + @Override + public Boolean isDhcpEnabled() { + return _dhcpEnabled; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cidr); + result = prime * result + Objects.hashCode(_gatewayIp); + result = prime * result + Objects.hashCode(_ipAllocationPools); + result = prime * result + Objects.hashCode(_ipVersion); + result = prime * result + Objects.hashCode(_ipv6AddressMode); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_dhcpEnabled); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L3ProtocolData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L3ProtocolData other = (L3ProtocolData)obj; + if (!Objects.equals(_cidr, other.getCidr())) { + return false; + } + if (!Objects.equals(_gatewayIp, other.getGatewayIp())) { + return false; + } + if (!Objects.equals(_ipAllocationPools, other.getIpAllocationPools())) { + return false; + } + if (!Objects.equals(_ipVersion, other.getIpVersion())) { + return false; + } + if (!Objects.equals(_ipv6AddressMode, other.getIpv6AddressMode())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_dhcpEnabled, other.isDhcpEnabled())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L3ProtocolDataImpl otherImpl = (L3ProtocolDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L3ProtocolData"); + CodeHelpers.appendValue(helper, "_cidr", _cidr); + CodeHelpers.appendValue(helper, "_gatewayIp", _gatewayIp); + CodeHelpers.appendValue(helper, "_ipAllocationPools", _ipAllocationPools); + CodeHelpers.appendValue(helper, "_ipVersion", _ipVersion); + CodeHelpers.appendValue(helper, "_ipv6AddressMode", _ipv6AddressMode); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_dhcpEnabled", _dhcpEnabled); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/CpConnection.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/CpConnection.java new file mode 100644 index 0000000..667a7d1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/CpConnection.java @@ -0,0 +1,54 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * choice cp-connection {
+ *   case int-virtual-link-desc {
+ *     leaf int-virtual-link-desc {
+ *       type leafref {
+ *         path ../../int-virtual-link-desc/id;
+ *       }
+ *     }
+ *   }
+ *   case int-cpd {
+ *     container int-cpd {
+ *       leaf vdu-id {
+ *         type leafref {
+ *           path ../../../vdu/id;
+ *         }
+ *       }
+ *       leaf cpd {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   case k8s-cluster-net {
+ *     leaf k8s-cluster-net {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/ext-cpd/cp-connection + * + */ +public interface CpConnection + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cp-connection"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpd.java new file mode 100644 index 0000000..30b35fb --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpd.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.CpConnection; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface IntCpd + extends + DataObject, + Augmentable, + CpConnection +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("int-cpd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection.IntCpd.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.IntCpd intCpd, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.@Nullable IntCpd getIntCpd(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpdBuilder.java new file mode 100644 index 0000000..fc152c9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntCpdBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link IntCpdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     IntCpdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new IntCpdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of IntCpdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see IntCpdBuilder + * @see Builder + * + */ +public class IntCpdBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.IntCpd _intCpd; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public IntCpdBuilder() { + } + + public IntCpdBuilder(IntCpd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._intCpd = base.getIntCpd(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.IntCpd getIntCpd() { + return _intCpd; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public IntCpdBuilder setIntCpd(final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.IntCpd value) { + this._intCpd = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public IntCpdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public IntCpdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public IntCpdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private IntCpdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public IntCpd build() { + return new IntCpdImpl(this); + } + + private static final class IntCpdImpl + extends AbstractAugmentable + implements IntCpd { + + private final org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.IntCpd _intCpd; + + IntCpdImpl(IntCpdBuilder base) { + super(base.augmentation); + this._intCpd = base.getIntCpd(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.IntCpd getIntCpd() { + return _intCpd; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_intCpd); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!IntCpd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + IntCpd other = (IntCpd)obj; + if (!Objects.equals(_intCpd, other.getIntCpd())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + IntCpdImpl otherImpl = (IntCpdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("IntCpd"); + CodeHelpers.appendValue(helper, "_intCpd", _intCpd); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDesc.java new file mode 100644 index 0000000..b99bcdb --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDesc.java @@ -0,0 +1,41 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.CpConnection; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface IntVirtualLinkDesc + extends + DataObject, + Augmentable, + CpConnection +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("int-virtual-link-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection.IntVirtualLinkDesc.class; + } + + /** + * Reference to the internal Virtual Link Descriptor (VLD) to which CPs + * instantiated from this external CP Descriptor (CPD) connect. Either + * intVirtualLinkDesc or intCpd shall be present. + * + * + * + * @return java.lang.String intVirtualLinkDesc, or null if not present + */ + @Nullable String getIntVirtualLinkDesc(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDescBuilder.java new file mode 100644 index 0000000..8aa1723 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/IntVirtualLinkDescBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link IntVirtualLinkDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     IntVirtualLinkDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new IntVirtualLinkDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of IntVirtualLinkDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see IntVirtualLinkDescBuilder + * @see Builder + * + */ +public class IntVirtualLinkDescBuilder implements Builder { + + private String _intVirtualLinkDesc; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public IntVirtualLinkDescBuilder() { + } + + public IntVirtualLinkDescBuilder(IntVirtualLinkDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + } + + + public String getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public IntVirtualLinkDescBuilder setIntVirtualLinkDesc(final String value) { + this._intVirtualLinkDesc = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public IntVirtualLinkDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public IntVirtualLinkDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public IntVirtualLinkDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private IntVirtualLinkDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public IntVirtualLinkDesc build() { + return new IntVirtualLinkDescImpl(this); + } + + private static final class IntVirtualLinkDescImpl + extends AbstractAugmentable + implements IntVirtualLinkDesc { + + private final String _intVirtualLinkDesc; + + IntVirtualLinkDescImpl(IntVirtualLinkDescBuilder base) { + super(base.augmentation); + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + } + + @Override + public String getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_intVirtualLinkDesc); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!IntVirtualLinkDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + IntVirtualLinkDesc other = (IntVirtualLinkDesc)obj; + if (!Objects.equals(_intVirtualLinkDesc, other.getIntVirtualLinkDesc())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + IntVirtualLinkDescImpl otherImpl = (IntVirtualLinkDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("IntVirtualLinkDesc"); + CodeHelpers.appendValue(helper, "_intVirtualLinkDesc", _intVirtualLinkDesc); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNet.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNet.java new file mode 100644 index 0000000..03717b4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNet.java @@ -0,0 +1,40 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.CpConnection; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +public interface K8sClusterNet + extends + DataObject, + Augmentable, + CpConnection +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("k8s-cluster-net"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection.K8sClusterNet.class; + } + + /** + * Reference to the K8s cluster network to which CPs instantiated from this + * external CP Descriptor (CPD) connect. + * + * + * + * @return java.lang.String k8sClusterNet, or null if not present + */ + @Nullable String getK8sClusterNet(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNetBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNetBuilder.java new file mode 100644 index 0000000..4a84d4f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/K8sClusterNetBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link K8sClusterNetBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     K8sClusterNetBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new K8sClusterNetBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of K8sClusterNetBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see K8sClusterNetBuilder + * @see Builder + * + */ +public class K8sClusterNetBuilder implements Builder { + + private String _k8sClusterNet; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public K8sClusterNetBuilder() { + } + + public K8sClusterNetBuilder(K8sClusterNet base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._k8sClusterNet = base.getK8sClusterNet(); + } + + + public String getK8sClusterNet() { + return _k8sClusterNet; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public K8sClusterNetBuilder setK8sClusterNet(final String value) { + this._k8sClusterNet = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public K8sClusterNetBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public K8sClusterNetBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public K8sClusterNetBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private K8sClusterNetBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public K8sClusterNet build() { + return new K8sClusterNetImpl(this); + } + + private static final class K8sClusterNetImpl + extends AbstractAugmentable + implements K8sClusterNet { + + private final String _k8sClusterNet; + + K8sClusterNetImpl(K8sClusterNetBuilder base) { + super(base.augmentation); + this._k8sClusterNet = base.getK8sClusterNet(); + } + + @Override + public String getK8sClusterNet() { + return _k8sClusterNet; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_k8sClusterNet); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!K8sClusterNet.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + K8sClusterNet other = (K8sClusterNet)obj; + if (!Objects.equals(_k8sClusterNet, other.getK8sClusterNet())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + K8sClusterNetImpl otherImpl = (K8sClusterNetImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("K8sClusterNet"); + CodeHelpers.appendValue(helper, "_k8sClusterNet", _k8sClusterNet); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpd.java new file mode 100644 index 0000000..7efc59f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpd.java @@ -0,0 +1,61 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container int-cpd {
+ *   leaf vdu-id {
+ *     type leafref {
+ *       path ../../../vdu/id;
+ *     }
+ *   }
+ *   leaf cpd {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/ext-cpd/cp-connection/int-cpd/int-cpd + * + *

To create instances of this class use {@link IntCpdBuilder}. + * @see IntCpdBuilder + * + */ +public interface IntCpd + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("int-cpd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd.IntCpd.class; + } + + /** + * @return java.lang.String vduId, or null if not present + */ + @Nullable String getVduId(); + + /** + * @return java.lang.String cpd, or null if not present + */ + @Nullable String getCpd(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpdBuilder.java new file mode 100644 index 0000000..9e427dd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/ext/cpd/cp/connection/_int/cpd/IntCpdBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ext.cpd.cp.connection._int.cpd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link IntCpdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     IntCpdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new IntCpdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of IntCpdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see IntCpdBuilder + * @see Builder + * + */ +public class IntCpdBuilder implements Builder { + + private String _cpd; + private String _vduId; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public IntCpdBuilder() { + } + + public IntCpdBuilder(IntCpd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cpd = base.getCpd(); + this._vduId = base.getVduId(); + } + + + public String getCpd() { + return _cpd; + } + + public String getVduId() { + return _vduId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public IntCpdBuilder setCpd(final String value) { + this._cpd = value; + return this; + } + + public IntCpdBuilder setVduId(final String value) { + this._vduId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public IntCpdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public IntCpdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public IntCpdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private IntCpdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public IntCpd build() { + return new IntCpdImpl(this); + } + + private static final class IntCpdImpl + extends AbstractAugmentable + implements IntCpd { + + private final String _cpd; + private final String _vduId; + + IntCpdImpl(IntCpdBuilder base) { + super(base.augmentation); + this._cpd = base.getCpd(); + this._vduId = base.getVduId(); + } + + @Override + public String getCpd() { + return _cpd; + } + + @Override + public String getVduId() { + return _vduId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpd); + result = prime * result + Objects.hashCode(_vduId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!IntCpd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + IntCpd other = (IntCpd)obj; + if (!Objects.equals(_cpd, other.getCpd())) { + return false; + } + if (!Objects.equals(_vduId, other.getVduId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + IntCpdImpl otherImpl = (IntCpdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("IntCpd"); + CodeHelpers.appendValue(helper, "_cpd", _cpd); + CodeHelpers.appendValue(helper, "_vduId", _vduId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInput.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInput.java new file mode 100644 index 0000000..5fef552 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInput.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of KVP requirements with the key as the parameter name and the value as + * the parameter that need to be passed as an input to the script. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list script-input {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/lifecycle-management-script/script-input + * + *

To create instances of this class use {@link ScriptInputBuilder}. + * @see ScriptInputBuilder + * @see ScriptInputKey + * + */ +public interface ScriptInput + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("script-input"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script.ScriptInput.class; + } + + /** + * Includes a VNF LCM script (e.g. written in a DSL as specified in requirement + * VNF_PACK.LCM.001) triggered to react to one of the events listed in the event + * attribute. The string value specified here is a path to a file in the VNF + * package. + * + * + * + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ScriptInputKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputBuilder.java new file mode 100644 index 0000000..8679002 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ScriptInputBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ScriptInputBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ScriptInputBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ScriptInputBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ScriptInputBuilder + * @see Builder + * + */ +public class ScriptInputBuilder implements Builder { + + private String _key; + private String _value; + private ScriptInputKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ScriptInputBuilder() { + } + + public ScriptInputBuilder(ScriptInput base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ScriptInputKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ScriptInputBuilder withKey(final ScriptInputKey key) { + this.key = key; + return this; + } + + public ScriptInputBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ScriptInputBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ScriptInputBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ScriptInputBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ScriptInputBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ScriptInputBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ScriptInput build() { + return new ScriptInputImpl(this); + } + + private static final class ScriptInputImpl + extends AbstractAugmentable + implements ScriptInput { + + private final String _key; + private final String _value; + private final ScriptInputKey key; + + ScriptInputImpl(ScriptInputBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ScriptInputKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ScriptInputKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ScriptInput.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ScriptInput other = (ScriptInput)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ScriptInputImpl otherImpl = (ScriptInputImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ScriptInput"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputKey.java new file mode 100644 index 0000000..f7b99ae --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/lifecycle/management/script/ScriptInputKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.lifecycle.management.script; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ScriptInputKey + implements Identifier { + private static final long serialVersionUID = 2999058324629710440L; + private final String _key; + + + public ScriptInputKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ScriptInputKey(ScriptInputKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ScriptInputKey)) { + return false; + } + final ScriptInputKey other = (ScriptInputKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ScriptInputKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/Checksum.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/Checksum.java new file mode 100644 index 0000000..0f9b7fc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/Checksum.java @@ -0,0 +1,72 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.sw.image.desc; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ChecksumAlgorithm; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The checksum of the software image file. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container checksum {
+ *   leaf algorithm {
+ *     type identityref {
+ *       base checksum-algorithm;
+ *     }
+ *   }
+ *   leaf hash {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/sw-image-desc/checksum + * + *

To create instances of this class use {@link ChecksumBuilder}. + * @see ChecksumBuilder + * + */ +public interface Checksum + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("checksum"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.sw.image.desc.Checksum.class; + } + + /** + * Species the algorithm used to obtain the checksum value. + * + * + * + * @return java.lang.Class algorithm, or null if not present + */ + @Nullable Class getAlgorithm(); + + /** + * Contains the result of applying the algorithm indicated by the algorithm + * attribute to the data to which this ChecksumData refers. + * + * + * + * @return java.lang.String hash, or null if not present + */ + @Nullable String getHash(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/ChecksumBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/ChecksumBuilder.java new file mode 100644 index 0000000..5021c91 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/sw/image/desc/ChecksumBuilder.java @@ -0,0 +1,251 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.sw.image.desc; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ChecksumAlgorithm; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ChecksumBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ChecksumBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ChecksumBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ChecksumBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ChecksumBuilder + * @see Builder + * + */ +public class ChecksumBuilder implements Builder { + + private Class _algorithm; + private String _hash; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ChecksumBuilder() { + } + + public ChecksumBuilder(Checksum base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._algorithm = base.getAlgorithm(); + this._hash = base.getHash(); + } + + + public Class getAlgorithm() { + return _algorithm; + } + + public String getHash() { + return _hash; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public ChecksumBuilder setAlgorithm(final Class value) { + this._algorithm = value; + return this; + } + + public ChecksumBuilder setHash(final String value) { + this._hash = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ChecksumBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ChecksumBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ChecksumBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ChecksumBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Checksum build() { + return new ChecksumImpl(this); + } + + private static final class ChecksumImpl + extends AbstractAugmentable + implements Checksum { + + private final Class _algorithm; + private final String _hash; + + ChecksumImpl(ChecksumBuilder base) { + super(base.augmentation); + this._algorithm = base.getAlgorithm(); + this._hash = base.getHash(); + } + + @Override + public Class getAlgorithm() { + return _algorithm; + } + + @Override + public String getHash() { + return _hash; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_algorithm); + result = prime * result + Objects.hashCode(_hash); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Checksum.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Checksum other = (Checksum)obj; + if (!Objects.equals(_algorithm, other.getAlgorithm())) { + return false; + } + if (!Objects.equals(_hash, other.getHash())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ChecksumImpl otherImpl = (ChecksumImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Checksum"); + CodeHelpers.appendValue(helper, "_algorithm", _algorithm); + CodeHelpers.appendValue(helper, "_hash", _hash); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrder.java new file mode 100644 index 0000000..0b94973 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrder.java @@ -0,0 +1,74 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * The key indicates the boot index (lowest index defines highest boot priority). + * The Value references a descriptor from which a valid boot device is created + * VirtualStorageDesc from which a VirtualStorage instance is created. Editor's + * note: The boot-order node requires further study. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list boot-order {
+ *   ordered-by user;
+ *   key key;
+ *   leaf key {
+ *     type uint32;
+ *   }
+ *   leaf value {
+ *     type leafref {
+ *       path ../../virtual-storage-desc;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/vdu/boot-order + * + *

To create instances of this class use {@link BootOrderBuilder}. + * @see BootOrderBuilder + * @see BootOrderKey + * + */ +public interface BootOrder + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("boot-order"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.BootOrder.class; + } + + /** + * @return org.opendaylight.yangtools.yang.common.Uint32 key, or null if not present + */ + @Nullable Uint32 getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + BootOrderKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderBuilder.java new file mode 100644 index 0000000..98af37c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderBuilder.java @@ -0,0 +1,285 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link BootOrderBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     BootOrderBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new BootOrderBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of BootOrderBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see BootOrderBuilder + * @see Builder + * + */ +public class BootOrderBuilder implements Builder { + + private Uint32 _key; + private String _value; + private BootOrderKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public BootOrderBuilder() { + } + + public BootOrderBuilder(BootOrder base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public BootOrderKey key() { + return key; + } + + public Uint32 getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public BootOrderBuilder withKey(final BootOrderKey key) { + this.key = key; + return this; + } + + public BootOrderBuilder setKey(final Uint32 value) { + this._key = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setKey(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public BootOrderBuilder setKey(final Long value) { + return setKey(CodeHelpers.compatUint(value)); + } + + public BootOrderBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public BootOrderBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public BootOrderBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public BootOrderBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private BootOrderBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public BootOrder build() { + return new BootOrderImpl(this); + } + + private static final class BootOrderImpl + extends AbstractAugmentable + implements BootOrder { + + private final Uint32 _key; + private final String _value; + private final BootOrderKey key; + + BootOrderImpl(BootOrderBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new BootOrderKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public BootOrderKey key() { + return key; + } + + @Override + public Uint32 getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!BootOrder.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + BootOrder other = (BootOrder)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + BootOrderImpl otherImpl = (BootOrderImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("BootOrder"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderKey.java new file mode 100644 index 0000000..30e8978 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/BootOrderKey.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; +import org.opendaylight.yangtools.yang.common.Uint32; + +public class BootOrderKey + implements Identifier { + private static final long serialVersionUID = -3236633096323482894L; + private final Uint32 _key; + + + public BootOrderKey(Uint32 _key) { + + this._key = _key; + } + + /** + * Utility migration constructor. + * + * @param _key key in legacy Java type + * @deprecated Use {#link BootOrderKey(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public BootOrderKey(Long _key) { + this(CodeHelpers.compatUint(_key)); + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public BootOrderKey(BootOrderKey source) { + this._key = source._key; + } + + + public Uint32 getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof BootOrderKey)) { + return false; + } + final BootOrderKey other = (BootOrderKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(BootOrderKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurableProperties.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurableProperties.java new file mode 100644 index 0000000..c737117 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurableProperties.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * It provides VNFC configurable properties that can be modified using the + * ModifyVnfInfo operation. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list configurable-properties {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/vdu/configurable-properties + * + *

To create instances of this class use {@link ConfigurablePropertiesBuilder}. + * @see ConfigurablePropertiesBuilder + * @see ConfigurablePropertiesKey + * + */ +public interface ConfigurableProperties + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("configurable-properties"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.ConfigurableProperties.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + ConfigurablePropertiesKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesBuilder.java new file mode 100644 index 0000000..21371ef --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConfigurablePropertiesBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConfigurablePropertiesBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConfigurablePropertiesBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConfigurablePropertiesBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConfigurablePropertiesBuilder + * @see Builder + * + */ +public class ConfigurablePropertiesBuilder implements Builder { + + private String _key; + private String _value; + private ConfigurablePropertiesKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConfigurablePropertiesBuilder() { + } + + public ConfigurablePropertiesBuilder(ConfigurableProperties base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public ConfigurablePropertiesKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ConfigurablePropertiesBuilder withKey(final ConfigurablePropertiesKey key) { + this.key = key; + return this; + } + + public ConfigurablePropertiesBuilder setKey(final String value) { + this._key = value; + return this; + } + + public ConfigurablePropertiesBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConfigurablePropertiesBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConfigurablePropertiesBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConfigurablePropertiesBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConfigurablePropertiesBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConfigurableProperties build() { + return new ConfigurablePropertiesImpl(this); + } + + private static final class ConfigurablePropertiesImpl + extends AbstractAugmentable + implements ConfigurableProperties { + + private final String _key; + private final String _value; + private final ConfigurablePropertiesKey key; + + ConfigurablePropertiesImpl(ConfigurablePropertiesBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ConfigurablePropertiesKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public ConfigurablePropertiesKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConfigurableProperties.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConfigurableProperties other = (ConfigurableProperties)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConfigurablePropertiesImpl otherImpl = (ConfigurablePropertiesImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConfigurableProperties"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesKey.java new file mode 100644 index 0000000..6140423 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/ConfigurablePropertiesKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ConfigurablePropertiesKey + implements Identifier { + private static final long serialVersionUID = -9041626256486818420L; + private final String _key; + + + public ConfigurablePropertiesKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ConfigurablePropertiesKey(ConfigurablePropertiesKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ConfigurablePropertiesKey)) { + return false; + } + final ConfigurablePropertiesKey other = (ConfigurablePropertiesKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ConfigurablePropertiesKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpd.java new file mode 100644 index 0000000..66eea6c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpd.java @@ -0,0 +1,139 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * A internal-connection-point element is a type of connection point and describes + * network connectivity between a VDU instance and an internal Virtual Link or an + * external connection point. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list int-cpd {
+ *   key id;
+ *   min-elements 1;
+ *   leaf int-virtual-link-desc {
+ *     type leafref {
+ *       path ../../../int-virtual-link-desc/id;
+ *     }
+ *   }
+ *   leaf bitrate-requirement {
+ *     type uint64;
+ *     units Mbps;
+ *   }
+ *   uses virtual-network-interface-requirements;
+ *   leaf nicio-requirements {
+ *     type leafref {
+ *       path ../../../virtual-compute-desc/id;
+ *     }
+ *   }
+ *   leaf-list order {
+ *     type uint32;
+ *   }
+ *   uses cpd;
+ *   leaf security-group-rule-id {
+ *     type leafref {
+ *       path ../../../security-group-rule/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/vdu/int-cpd + * + *

To create instances of this class use {@link IntCpdBuilder}. + * @see IntCpdBuilder + * @see IntCpdKey + * + */ +public interface IntCpd + extends + ChildOf, + Augmentable, + VirtualNetworkInterfaceRequirements, + Cpd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("int-cpd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.IntCpd.class; + } + + /** + * Reference of the internal VLD which this internal CPD connects to. + * + * + * + * @return java.lang.String intVirtualLinkDesc, or null if not present + */ + @Nullable String getIntVirtualLinkDesc(); + + /** + * Bitrate requirement on this CP. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 bitrateRequirement, or null if not present + */ + @Nullable Uint64 getBitrateRequirement(); + + /** + * This references (couples) the CPD with any logical node I/O requirements (for + * network devices) that may have been created. Linking these attributes is + * necessary so that so that I/O requirements that need to be articulated at the + * logical node level can be associated with the network interface requirements + * associated with the CPD. + * + * + * + * @return java.lang.String nicioRequirements, or null if not present + */ + @Nullable String getNicioRequirements(); + + /** + * The order of the NIC to be assigned on the compute instance (e.g. 2 for eth2). + * Note: when binding more than one port to a single compute (aka multi vNICs) and + * ordering is desired, it is mandatory that all ports will be set with an order + * value. The order values shall represent a positive, arithmetic progression that + * starts with 0 (i.e. 0, 1, 2,..., n). If the property is not present, it shall be + * left to the VIM to assign a value when creating the instance. + * + * + * + * @return java.util.List order, or null if not present + */ + @Nullable List getOrder(); + + /** + * Reference of the security group rules bound to this CPD. + * + * + * + * @return java.lang.String securityGroupRuleId, or null if not present + */ + @Nullable String getSecurityGroupRuleId(); + + @Override + IntCpdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdBuilder.java new file mode 100644 index 0000000..fcede8c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdBuilder.java @@ -0,0 +1,596 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.CpRole; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.ProtocolKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirementKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link IntCpdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     IntCpdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new IntCpdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of IntCpdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see IntCpdBuilder + * @see Builder + * + */ +public class IntCpdBuilder implements Builder { + + private Uint64 _bitrateRequirement; + private String _description; + private String _id; + private String _intVirtualLinkDesc; + private List> _layerProtocol; + private String _nicioRequirements; + private List _order; + private Map _protocol; + private Class _role; + private String _securityGroupRuleId; + private Map _virtualNetworkInterfaceRequirement; + private Boolean _trunkMode; + private IntCpdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public IntCpdBuilder() { + } + public IntCpdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements arg) { + this._virtualNetworkInterfaceRequirement = arg.getVirtualNetworkInterfaceRequirement(); + } + public IntCpdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd arg) { + this._id = arg.getId(); + this._layerProtocol = arg.getLayerProtocol(); + this._role = arg.getRole(); + this._description = arg.getDescription(); + this._protocol = arg.getProtocol(); + this._trunkMode = arg.isTrunkMode(); + } + + public IntCpdBuilder(IntCpd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._bitrateRequirement = base.getBitrateRequirement(); + this._description = base.getDescription(); + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + this._layerProtocol = base.getLayerProtocol(); + this._nicioRequirements = base.getNicioRequirements(); + this._order = base.getOrder(); + this._protocol = base.getProtocol(); + this._role = base.getRole(); + this._securityGroupRuleId = base.getSecurityGroupRuleId(); + this._virtualNetworkInterfaceRequirement = base.getVirtualNetworkInterfaceRequirement(); + this._trunkMode = base.isTrunkMode(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements) { + this._virtualNetworkInterfaceRequirement = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements)arg).getVirtualNetworkInterfaceRequirement(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getId(); + this._layerProtocol = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getLayerProtocol(); + this._role = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getRole(); + this._description = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getDescription(); + this._protocol = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).getProtocol(); + this._trunkMode = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd)arg).isTrunkMode(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.VirtualNetworkInterfaceRequirements, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd]"); + } + + public IntCpdKey key() { + return key; + } + + public Uint64 getBitrateRequirement() { + return _bitrateRequirement; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public String getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + public List> getLayerProtocol() { + return _layerProtocol; + } + + public String getNicioRequirements() { + return _nicioRequirements; + } + + public List getOrder() { + return _order; + } + + public Map getProtocol() { + return _protocol; + } + + public Class getRole() { + return _role; + } + + public String getSecurityGroupRuleId() { + return _securityGroupRuleId; + } + + public Map getVirtualNetworkInterfaceRequirement() { + return _virtualNetworkInterfaceRequirement; + } + + public Boolean isTrunkMode() { + return _trunkMode; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public IntCpdBuilder withKey(final IntCpdKey key) { + this.key = key; + return this; + } + + public IntCpdBuilder setBitrateRequirement(final Uint64 value) { + this._bitrateRequirement = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setBitrateRequirement(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public IntCpdBuilder setBitrateRequirement(final BigInteger value) { + return setBitrateRequirement(CodeHelpers.compatUint(value)); + } + + public IntCpdBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public IntCpdBuilder setId(final String value) { + this._id = value; + return this; + } + + public IntCpdBuilder setIntVirtualLinkDesc(final String value) { + this._intVirtualLinkDesc = value; + return this; + } + public IntCpdBuilder setLayerProtocol(final List> values) { + this._layerProtocol = values; + return this; + } + + + public IntCpdBuilder setNicioRequirements(final String value) { + this._nicioRequirements = value; + return this; + } + public IntCpdBuilder setOrder(final List values) { + this._order = values; + return this; + } + + public IntCpdBuilder setProtocol(final Map values) { + this._protocol = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setProtocol(Map)} instead. + */ + @Deprecated(forRemoval = true) + public IntCpdBuilder setProtocol(final List values) { + return setProtocol(CodeHelpers.compatMap(values)); + } + + public IntCpdBuilder setRole(final Class value) { + this._role = value; + return this; + } + + public IntCpdBuilder setSecurityGroupRuleId(final String value) { + this._securityGroupRuleId = value; + return this; + } + public IntCpdBuilder setVirtualNetworkInterfaceRequirement(final Map values) { + this._virtualNetworkInterfaceRequirement = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualNetworkInterfaceRequirement(Map)} instead. + */ + @Deprecated(forRemoval = true) + public IntCpdBuilder setVirtualNetworkInterfaceRequirement(final List values) { + return setVirtualNetworkInterfaceRequirement(CodeHelpers.compatMap(values)); + } + + public IntCpdBuilder setTrunkMode(final Boolean value) { + this._trunkMode = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public IntCpdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public IntCpdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public IntCpdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private IntCpdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public IntCpd build() { + return new IntCpdImpl(this); + } + + private static final class IntCpdImpl + extends AbstractAugmentable + implements IntCpd { + + private final Uint64 _bitrateRequirement; + private final String _description; + private final String _id; + private final String _intVirtualLinkDesc; + private final List> _layerProtocol; + private final String _nicioRequirements; + private final List _order; + private final Map _protocol; + private final Class _role; + private final String _securityGroupRuleId; + private final Map _virtualNetworkInterfaceRequirement; + private final Boolean _trunkMode; + private final IntCpdKey key; + + IntCpdImpl(IntCpdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new IntCpdKey(base.getId()); + } + this._id = key.getId(); + this._bitrateRequirement = base.getBitrateRequirement(); + this._description = base.getDescription(); + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + this._layerProtocol = base.getLayerProtocol(); + this._nicioRequirements = base.getNicioRequirements(); + this._order = base.getOrder(); + this._protocol = CodeHelpers.emptyToNull(base.getProtocol()); + this._role = base.getRole(); + this._securityGroupRuleId = base.getSecurityGroupRuleId(); + this._virtualNetworkInterfaceRequirement = CodeHelpers.emptyToNull(base.getVirtualNetworkInterfaceRequirement()); + this._trunkMode = base.isTrunkMode(); + } + + @Override + public IntCpdKey key() { + return key; + } + + @Override + public Uint64 getBitrateRequirement() { + return _bitrateRequirement; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + @Override + public List> getLayerProtocol() { + return _layerProtocol; + } + + @Override + public String getNicioRequirements() { + return _nicioRequirements; + } + + @Override + public List getOrder() { + return _order; + } + + @Override + public Map getProtocol() { + return _protocol; + } + + @Override + public Class getRole() { + return _role; + } + + @Override + public String getSecurityGroupRuleId() { + return _securityGroupRuleId; + } + + @Override + public Map getVirtualNetworkInterfaceRequirement() { + return _virtualNetworkInterfaceRequirement; + } + + @Override + public Boolean isTrunkMode() { + return _trunkMode; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_bitrateRequirement); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_intVirtualLinkDesc); + result = prime * result + Objects.hashCode(_layerProtocol); + result = prime * result + Objects.hashCode(_nicioRequirements); + result = prime * result + Objects.hashCode(_order); + result = prime * result + Objects.hashCode(_protocol); + result = prime * result + Objects.hashCode(_role); + result = prime * result + Objects.hashCode(_securityGroupRuleId); + result = prime * result + Objects.hashCode(_virtualNetworkInterfaceRequirement); + result = prime * result + Objects.hashCode(_trunkMode); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!IntCpd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + IntCpd other = (IntCpd)obj; + if (!Objects.equals(_bitrateRequirement, other.getBitrateRequirement())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_intVirtualLinkDesc, other.getIntVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_layerProtocol, other.getLayerProtocol())) { + return false; + } + if (!Objects.equals(_nicioRequirements, other.getNicioRequirements())) { + return false; + } + if (!Objects.equals(_order, other.getOrder())) { + return false; + } + if (!Objects.equals(_protocol, other.getProtocol())) { + return false; + } + if (!Objects.equals(_role, other.getRole())) { + return false; + } + if (!Objects.equals(_securityGroupRuleId, other.getSecurityGroupRuleId())) { + return false; + } + if (!Objects.equals(_virtualNetworkInterfaceRequirement, other.getVirtualNetworkInterfaceRequirement())) { + return false; + } + if (!Objects.equals(_trunkMode, other.isTrunkMode())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + IntCpdImpl otherImpl = (IntCpdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("IntCpd"); + CodeHelpers.appendValue(helper, "_bitrateRequirement", _bitrateRequirement); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_intVirtualLinkDesc", _intVirtualLinkDesc); + CodeHelpers.appendValue(helper, "_layerProtocol", _layerProtocol); + CodeHelpers.appendValue(helper, "_nicioRequirements", _nicioRequirements); + CodeHelpers.appendValue(helper, "_order", _order); + CodeHelpers.appendValue(helper, "_protocol", _protocol); + CodeHelpers.appendValue(helper, "_role", _role); + CodeHelpers.appendValue(helper, "_securityGroupRuleId", _securityGroupRuleId); + CodeHelpers.appendValue(helper, "_virtualNetworkInterfaceRequirement", _virtualNetworkInterfaceRequirement); + CodeHelpers.appendValue(helper, "_trunkMode", _trunkMode); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdKey.java new file mode 100644 index 0000000..de47a78 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/IntCpdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class IntCpdKey + implements Identifier { + private static final long serialVersionUID = 1649222683231827626L; + private final String _id; + + + public IntCpdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public IntCpdKey(IntCpdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof IntCpdKey)) { + return false; + } + final IntCpdKey other = (IntCpdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(IntCpdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameter.java new file mode 100644 index 0000000..7dc067e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameter.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list monitoring-parameter {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   uses monitoring-parameter;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/vdu/monitoring-parameter + * + *

To create instances of this class use {@link MonitoringParameterBuilder}. + * @see MonitoringParameterBuilder + * @see MonitoringParameterKey + * + */ +public interface MonitoringParameter + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitoring-parameter"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu.MonitoringParameter.class; + } + + /** + * Unique identifier of the monitoring parameter. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + MonitoringParameterKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterBuilder.java new file mode 100644 index 0000000..6635d3b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterBuilder.java @@ -0,0 +1,355 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link MonitoringParameterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MonitoringParameterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MonitoringParameterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MonitoringParameterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MonitoringParameterBuilder + * @see Builder + * + */ +public class MonitoringParameterBuilder implements Builder { + + private Uint64 _collectionPeriod; + private String _id; + private String _name; + private String _performanceMetric; + private MonitoringParameterKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MonitoringParameterBuilder() { + } + public MonitoringParameterBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter arg) { + this._name = arg.getName(); + this._performanceMetric = arg.getPerformanceMetric(); + this._collectionPeriod = arg.getCollectionPeriod(); + } + + public MonitoringParameterBuilder(MonitoringParameter base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._collectionPeriod = base.getCollectionPeriod(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter) { + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getName(); + this._performanceMetric = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getPerformanceMetric(); + this._collectionPeriod = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter)arg).getCollectionPeriod(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.MonitoringParameter]"); + } + + public MonitoringParameterKey key() { + return key; + } + + public Uint64 getCollectionPeriod() { + return _collectionPeriod; + } + + public String getId() { + return _id; + } + + public String getName() { + return _name; + } + + public String getPerformanceMetric() { + return _performanceMetric; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public MonitoringParameterBuilder withKey(final MonitoringParameterKey key) { + this.key = key; + return this; + } + + public MonitoringParameterBuilder setCollectionPeriod(final Uint64 value) { + this._collectionPeriod = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setCollectionPeriod(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoringParameterBuilder setCollectionPeriod(final BigInteger value) { + return setCollectionPeriod(CodeHelpers.compatUint(value)); + } + + public MonitoringParameterBuilder setId(final String value) { + this._id = value; + return this; + } + + public MonitoringParameterBuilder setName(final String value) { + this._name = value; + return this; + } + + public MonitoringParameterBuilder setPerformanceMetric(final String value) { + this._performanceMetric = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MonitoringParameterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoringParameterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MonitoringParameterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MonitoringParameterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MonitoringParameter build() { + return new MonitoringParameterImpl(this); + } + + private static final class MonitoringParameterImpl + extends AbstractAugmentable + implements MonitoringParameter { + + private final Uint64 _collectionPeriod; + private final String _id; + private final String _name; + private final String _performanceMetric; + private final MonitoringParameterKey key; + + MonitoringParameterImpl(MonitoringParameterBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new MonitoringParameterKey(base.getId()); + } + this._id = key.getId(); + this._collectionPeriod = base.getCollectionPeriod(); + this._name = base.getName(); + this._performanceMetric = base.getPerformanceMetric(); + } + + @Override + public MonitoringParameterKey key() { + return key; + } + + @Override + public Uint64 getCollectionPeriod() { + return _collectionPeriod; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getPerformanceMetric() { + return _performanceMetric; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_collectionPeriod); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_performanceMetric); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MonitoringParameter.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MonitoringParameter other = (MonitoringParameter)obj; + if (!Objects.equals(_collectionPeriod, other.getCollectionPeriod())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_performanceMetric, other.getPerformanceMetric())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MonitoringParameterImpl otherImpl = (MonitoringParameterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MonitoringParameter"); + CodeHelpers.appendValue(helper, "_collectionPeriod", _collectionPeriod); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_performanceMetric", _performanceMetric); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterKey.java new file mode 100644 index 0000000..12f3d1d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/vdu/MonitoringParameterKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.vdu; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class MonitoringParameterKey + implements Identifier { + private static final long serialVersionUID = 7526161979845181524L; + private final String _id; + + + public MonitoringParameterKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public MonitoringParameterKey(MonitoringParameterKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof MonitoringParameterKey)) { + return false; + } + final MonitoringParameterKey other = (MonitoringParameterKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(MonitoringParameterKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNode.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNode.java new file mode 100644 index 0000000..8f99214 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNode.java @@ -0,0 +1,97 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node.RequirementDetail; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node.RequirementDetailKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The logical node requirements. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list logical-node {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   list requirement-detail {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/logical-node + * + *

To create instances of this class use {@link LogicalNodeBuilder}. + * @see LogicalNodeBuilder + * @see LogicalNodeKey + * + */ +public interface LogicalNode + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("logical-node"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.LogicalNode.class; + } + + /** + * Identifies this set of logical node requirements. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The logical node-level compute, memory and I/O requirements. An array of + * key-value pairs that articulate the deployment requirements. This could include + * the number of CPU cores on this logical node, a memory configuration specific to + * a logical node (e.g. such as available in the Linux kernel via the libnuma + * library) or a requirement related to the association of an I/O device with the + * logical node. + * + * + * + * @return java.util.Map requirementDetail, or null if not present + */ + @Nullable Map getRequirementDetail(); + + /** + * @return java.util.Map requirementDetail, or an empty list if it is not present + */ + default @NonNull Map nonnullRequirementDetail() { + return CodeHelpers.nonnull(getRequirementDetail()); + } + + @Override + LogicalNodeKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeBuilder.java new file mode 100644 index 0000000..0ca4cef --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeBuilder.java @@ -0,0 +1,291 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node.RequirementDetail; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node.RequirementDetailKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link LogicalNodeBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     LogicalNodeBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new LogicalNodeBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of LogicalNodeBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see LogicalNodeBuilder + * @see Builder + * + */ +public class LogicalNodeBuilder implements Builder { + + private String _id; + private Map _requirementDetail; + private LogicalNodeKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public LogicalNodeBuilder() { + } + + public LogicalNodeBuilder(LogicalNode base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._requirementDetail = base.getRequirementDetail(); + } + + + public LogicalNodeKey key() { + return key; + } + + public String getId() { + return _id; + } + + public Map getRequirementDetail() { + return _requirementDetail; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public LogicalNodeBuilder withKey(final LogicalNodeKey key) { + this.key = key; + return this; + } + + public LogicalNodeBuilder setId(final String value) { + this._id = value; + return this; + } + public LogicalNodeBuilder setRequirementDetail(final Map values) { + this._requirementDetail = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setRequirementDetail(Map)} instead. + */ + @Deprecated(forRemoval = true) + public LogicalNodeBuilder setRequirementDetail(final List values) { + return setRequirementDetail(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public LogicalNodeBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public LogicalNodeBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public LogicalNodeBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private LogicalNodeBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public LogicalNode build() { + return new LogicalNodeImpl(this); + } + + private static final class LogicalNodeImpl + extends AbstractAugmentable + implements LogicalNode { + + private final String _id; + private final Map _requirementDetail; + private final LogicalNodeKey key; + + LogicalNodeImpl(LogicalNodeBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new LogicalNodeKey(base.getId()); + } + this._id = key.getId(); + this._requirementDetail = CodeHelpers.emptyToNull(base.getRequirementDetail()); + } + + @Override + public LogicalNodeKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getRequirementDetail() { + return _requirementDetail; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_requirementDetail); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!LogicalNode.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + LogicalNode other = (LogicalNode)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_requirementDetail, other.getRequirementDetail())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + LogicalNodeImpl otherImpl = (LogicalNodeImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LogicalNode"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_requirementDetail", _requirementDetail); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeKey.java new file mode 100644 index 0000000..4f0be19 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/LogicalNodeKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class LogicalNodeKey + implements Identifier { + private static final long serialVersionUID = -4626432151267284245L; + private final String _id; + + + public LogicalNodeKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public LogicalNodeKey(LogicalNodeKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LogicalNodeKey)) { + return false; + } + final LogicalNodeKey other = (LogicalNodeKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(LogicalNodeKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapability.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapability.java new file mode 100644 index 0000000..56f18d3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapability.java @@ -0,0 +1,131 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability.TargetPerformanceParameters; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability.TargetPerformanceParametersKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list request-additional-capability {
+ *   key name;
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf support-mandatory {
+ *     type boolean;
+ *   }
+ *   leaf min-version {
+ *     type string;
+ *   }
+ *   leaf preferred-version {
+ *     type string;
+ *   }
+ *   list target-performance-parameters {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/request-additional-capability + * + *

To create instances of this class use {@link RequestAdditionalCapabilityBuilder}. + * @see RequestAdditionalCapabilityBuilder + * @see RequestAdditionalCapabilityKey + * + */ +public interface RequestAdditionalCapability + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("request-additional-capability"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.RequestAdditionalCapability.class; + } + + /** + * Identifies a requested additional capability for the VDU. ETSI GS NFV-IFA 002 + * [i.1] describes acceleration capabilities. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Indicates whether the requested additional capability is mandatory for + * successful operation. + * + * + * + * @return java.lang.Boolean supportMandatory, or null if not present + */ + @Nullable Boolean isSupportMandatory(); + + /** + * Identifies the minimum version of the requested additional capability. + * + * + * + * @return java.lang.String minVersion, or null if not present + */ + @Nullable String getMinVersion(); + + /** + * Identifies the preferred version of the requested additional capability. + * + * + * + * @return java.lang.String preferredVersion, or null if not present + */ + @Nullable String getPreferredVersion(); + + /** + * Identifies specific attributes, dependent on the requested additional capability + * type. + * + * + * + * @return java.util.Map targetPerformanceParameters, or null if not present + */ + @Nullable Map getTargetPerformanceParameters(); + + /** + * @return java.util.Map targetPerformanceParameters, or an empty list if it is not present + */ + default @NonNull Map nonnullTargetPerformanceParameters() { + return CodeHelpers.nonnull(getTargetPerformanceParameters()); + } + + @Override + RequestAdditionalCapabilityKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityBuilder.java new file mode 100644 index 0000000..b833b8a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityBuilder.java @@ -0,0 +1,361 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability.TargetPerformanceParameters; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability.TargetPerformanceParametersKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link RequestAdditionalCapabilityBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     RequestAdditionalCapabilityBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new RequestAdditionalCapabilityBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of RequestAdditionalCapabilityBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see RequestAdditionalCapabilityBuilder + * @see Builder + * + */ +public class RequestAdditionalCapabilityBuilder implements Builder { + + private String _minVersion; + private String _name; + private String _preferredVersion; + private Map _targetPerformanceParameters; + private Boolean _supportMandatory; + private RequestAdditionalCapabilityKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public RequestAdditionalCapabilityBuilder() { + } + + public RequestAdditionalCapabilityBuilder(RequestAdditionalCapability base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._name = base.getName(); + this._minVersion = base.getMinVersion(); + this._preferredVersion = base.getPreferredVersion(); + this._targetPerformanceParameters = base.getTargetPerformanceParameters(); + this._supportMandatory = base.isSupportMandatory(); + } + + + public RequestAdditionalCapabilityKey key() { + return key; + } + + public String getMinVersion() { + return _minVersion; + } + + public String getName() { + return _name; + } + + public String getPreferredVersion() { + return _preferredVersion; + } + + public Map getTargetPerformanceParameters() { + return _targetPerformanceParameters; + } + + public Boolean isSupportMandatory() { + return _supportMandatory; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public RequestAdditionalCapabilityBuilder withKey(final RequestAdditionalCapabilityKey key) { + this.key = key; + return this; + } + + public RequestAdditionalCapabilityBuilder setMinVersion(final String value) { + this._minVersion = value; + return this; + } + + public RequestAdditionalCapabilityBuilder setName(final String value) { + this._name = value; + return this; + } + + public RequestAdditionalCapabilityBuilder setPreferredVersion(final String value) { + this._preferredVersion = value; + return this; + } + public RequestAdditionalCapabilityBuilder setTargetPerformanceParameters(final Map values) { + this._targetPerformanceParameters = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setTargetPerformanceParameters(Map)} instead. + */ + @Deprecated(forRemoval = true) + public RequestAdditionalCapabilityBuilder setTargetPerformanceParameters(final List values) { + return setTargetPerformanceParameters(CodeHelpers.compatMap(values)); + } + + public RequestAdditionalCapabilityBuilder setSupportMandatory(final Boolean value) { + this._supportMandatory = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public RequestAdditionalCapabilityBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public RequestAdditionalCapabilityBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public RequestAdditionalCapabilityBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private RequestAdditionalCapabilityBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public RequestAdditionalCapability build() { + return new RequestAdditionalCapabilityImpl(this); + } + + private static final class RequestAdditionalCapabilityImpl + extends AbstractAugmentable + implements RequestAdditionalCapability { + + private final String _minVersion; + private final String _name; + private final String _preferredVersion; + private final Map _targetPerformanceParameters; + private final Boolean _supportMandatory; + private final RequestAdditionalCapabilityKey key; + + RequestAdditionalCapabilityImpl(RequestAdditionalCapabilityBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new RequestAdditionalCapabilityKey(base.getName()); + } + this._name = key.getName(); + this._minVersion = base.getMinVersion(); + this._preferredVersion = base.getPreferredVersion(); + this._targetPerformanceParameters = CodeHelpers.emptyToNull(base.getTargetPerformanceParameters()); + this._supportMandatory = base.isSupportMandatory(); + } + + @Override + public RequestAdditionalCapabilityKey key() { + return key; + } + + @Override + public String getMinVersion() { + return _minVersion; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getPreferredVersion() { + return _preferredVersion; + } + + @Override + public Map getTargetPerformanceParameters() { + return _targetPerformanceParameters; + } + + @Override + public Boolean isSupportMandatory() { + return _supportMandatory; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_minVersion); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_preferredVersion); + result = prime * result + Objects.hashCode(_targetPerformanceParameters); + result = prime * result + Objects.hashCode(_supportMandatory); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!RequestAdditionalCapability.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + RequestAdditionalCapability other = (RequestAdditionalCapability)obj; + if (!Objects.equals(_minVersion, other.getMinVersion())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_preferredVersion, other.getPreferredVersion())) { + return false; + } + if (!Objects.equals(_targetPerformanceParameters, other.getTargetPerformanceParameters())) { + return false; + } + if (!Objects.equals(_supportMandatory, other.isSupportMandatory())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + RequestAdditionalCapabilityImpl otherImpl = (RequestAdditionalCapabilityImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("RequestAdditionalCapability"); + CodeHelpers.appendValue(helper, "_minVersion", _minVersion); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_preferredVersion", _preferredVersion); + CodeHelpers.appendValue(helper, "_targetPerformanceParameters", _targetPerformanceParameters); + CodeHelpers.appendValue(helper, "_supportMandatory", _supportMandatory); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityKey.java new file mode 100644 index 0000000..6bbcfe3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/RequestAdditionalCapabilityKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class RequestAdditionalCapabilityKey + implements Identifier { + private static final long serialVersionUID = -6816285377424317935L; + private final String _name; + + + public RequestAdditionalCapabilityKey(String _name) { + + this._name = _name; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public RequestAdditionalCapabilityKey(RequestAdditionalCapabilityKey source) { + this._name = source._name; + } + + + public String getName() { + return _name; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_name); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof RequestAdditionalCapabilityKey)) { + return false; + } + final RequestAdditionalCapabilityKey other = (RequestAdditionalCapabilityKey) obj; + if (!Objects.equals(_name, other._name)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(RequestAdditionalCapabilityKey.class); + CodeHelpers.appendValue(helper, "_name", _name); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpu.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpu.java new file mode 100644 index 0000000..c94b225 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpu.java @@ -0,0 +1,168 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduBuilder.VduImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpuBuilder.VirtualCpuImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.Pinning; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.VduCpuRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.VduCpuRequirementsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint32; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The virtual CPU(s)of the virtualised compute. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container virtual-cpu {
+ *   leaf cpu-architecture {
+ *     type string;
+ *   }
+ *   leaf num-virtual-cpu {
+ *     type uint16 {
+ *       range 1..max;
+ *     }
+ *     default 1;
+ *   }
+ *   leaf clock {
+ *     type uint32;
+ *     units MHz;
+ *   }
+ *   leaf oversubscription-policy {
+ *     type string;
+ *   }
+ *   list vdu-cpu-requirements {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ *   container pinning {
+ *     presence "Set to specify CPU pinning.";
+ *     leaf policy {
+ *       default dynamic;
+ *       type enumeration {
+ *         enum static;
+ *         enum dynamic;
+ *       }
+ *     }
+ *     list rule {
+ *       when "../policy = 'static'";
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/virtual-cpu + * + *

To create instances of this class use {@link VirtualCpuBuilder}. + * @see VirtualCpuBuilder + * + */ +@JsonDeserialize(as = VirtualCpuImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface VirtualCpu + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-cpu"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpu.class; + } + + /** + * CPU architecture type. Examples are x86, ARM. The cardinality can be 0 during + * the allocation request, if no particular CPU architecture type is requested. + * + * + * + * @return java.lang.String cpuArchitecture, or null if not present + */ + @Nullable String getCpuArchitecture(); + + /** + * Number of virtual CPUs. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 numVirtualCpu, or null if not present + */ + @Nullable Uint16 getNumVirtualCpu(); + + /** + * Minimum virtual CPU clock rate (e.g. in MHz). The cardinality can be 0 during + * the allocation request, if no particular value is requested. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 clock, or null if not present + */ + @Nullable Uint32 getClock(); + + /** + * The CPU core oversubscription policy e.g. the relation of virtual CPU cores to + * physical CPU cores/threads. The cardinality can be 0 during the allocation + * request, if no particular value is requested. + * + * + * + * @return java.lang.String oversubscriptionPolicy, or null if not present + */ + @Nullable String getOversubscriptionPolicy(); + + /** + * Array of key-value pair requirements on the compute (CPU) for the VDU. + * + * + * + * @return java.util.Map vduCpuRequirements, or null if not present + */ + @Nullable Map getVduCpuRequirements(); + + /** + * @return java.util.Map vduCpuRequirements, or an empty list if it is not present + */ + default @NonNull Map nonnullVduCpuRequirements() { + return CodeHelpers.nonnull(getVduCpuRequirements()); + } + + /** + * The virtual CPU pinning configuration for the virtualised compute resource. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.Pinning pinning, or null if not present + */ + @Nullable Pinning getPinning(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpuBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpuBuilder.java new file mode 100644 index 0000000..760dbcf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualCpuBuilder.java @@ -0,0 +1,410 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescBuilder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.Pinning; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.VduCpuRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.VduCpuRequirementsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link VirtualCpuBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualCpuBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualCpuBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualCpuBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualCpuBuilder + * @see Builder + * + */ +public class VirtualCpuBuilder implements Builder { + + private Uint32 _clock; + private String _cpuArchitecture; + private Uint16 _numVirtualCpu; + private String _oversubscriptionPolicy; + private Pinning _pinning; + private Map _vduCpuRequirements; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualCpuBuilder() { + } + + public VirtualCpuBuilder(VirtualCpu base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._clock = base.getClock(); + this._cpuArchitecture = base.getCpuArchitecture(); + this._numVirtualCpu = base.getNumVirtualCpu(); + this._oversubscriptionPolicy = base.getOversubscriptionPolicy(); + this._pinning = base.getPinning(); + this._vduCpuRequirements = base.getVduCpuRequirements(); + } + + + public Uint32 getClock() { + return _clock; + } + + public String getCpuArchitecture() { + return _cpuArchitecture; + } + + public Uint16 getNumVirtualCpu() { + return _numVirtualCpu; + } + + public String getOversubscriptionPolicy() { + return _oversubscriptionPolicy; + } + + public Pinning getPinning() { + return _pinning; + } + + public Map getVduCpuRequirements() { + return _vduCpuRequirements; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VirtualCpuBuilder setClock(final Uint32 value) { + this._clock = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setClock(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualCpuBuilder setClock(final Long value) { + return setClock(CodeHelpers.compatUint(value)); + } + + public VirtualCpuBuilder setCpuArchitecture(final String value) { + this._cpuArchitecture = value; + return this; + } + + private static void checkNumVirtualCpuRange(final int value) { + if (value >= 1) { + return; + } + CodeHelpers.throwInvalidRange("[[1..65535]]", value); + } + + public VirtualCpuBuilder setNumVirtualCpu(final Uint16 value) { + if (value != null) { + checkNumVirtualCpuRange(value.intValue()); + + } + this._numVirtualCpu = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumVirtualCpu(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualCpuBuilder setNumVirtualCpu(final Integer value) { + return setNumVirtualCpu(CodeHelpers.compatUint(value)); + } + + public VirtualCpuBuilder setOversubscriptionPolicy(final String value) { + this._oversubscriptionPolicy = value; + return this; + } + + public VirtualCpuBuilder setPinning(final Pinning value) { + this._pinning = value; + return this; + } + public VirtualCpuBuilder setVduCpuRequirements(final Map values) { + this._vduCpuRequirements = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVduCpuRequirements(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualCpuBuilder setVduCpuRequirements(final List values) { + return setVduCpuRequirements(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualCpuBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualCpuBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualCpuBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualCpuBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualCpu build() { + return new VirtualCpuImpl(this); + } + + public static final class VirtualCpuImpl + extends AbstractAugmentable + implements VirtualCpu { + + private final Uint32 _clock; + private final String _cpuArchitecture; + @JsonProperty("num-virtual-cpu") + private final Uint16 _numVirtualCpu; + private final String _oversubscriptionPolicy; + private final Pinning _pinning; + private final Map _vduCpuRequirements; + + VirtualCpuImpl(VirtualCpuBuilder base) { + super(base.augmentation); + this._clock = base.getClock(); + this._cpuArchitecture = base.getCpuArchitecture(); + this._numVirtualCpu = base.getNumVirtualCpu(); + this._oversubscriptionPolicy = base.getOversubscriptionPolicy(); + this._pinning = base.getPinning(); + this._vduCpuRequirements = CodeHelpers.emptyToNull(base.getVduCpuRequirements()); + } + + public VirtualCpuImpl() { + this( new VirtualCpuBuilder()); + } + + @Override + public Uint32 getClock() { + return _clock; + } + + @Override + public String getCpuArchitecture() { + return _cpuArchitecture; + } + + @Override + public Uint16 getNumVirtualCpu() { + return _numVirtualCpu; + } + + @Override + public String getOversubscriptionPolicy() { + return _oversubscriptionPolicy; + } + + @Override + public Pinning getPinning() { + return _pinning; + } + + @Override + public Map getVduCpuRequirements() { + return _vduCpuRequirements; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_clock); + result = prime * result + Objects.hashCode(_cpuArchitecture); + result = prime * result + Objects.hashCode(_numVirtualCpu); + result = prime * result + Objects.hashCode(_oversubscriptionPolicy); + result = prime * result + Objects.hashCode(_pinning); + result = prime * result + Objects.hashCode(_vduCpuRequirements); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualCpu.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualCpu other = (VirtualCpu)obj; + if (!Objects.equals(_clock, other.getClock())) { + return false; + } + if (!Objects.equals(_cpuArchitecture, other.getCpuArchitecture())) { + return false; + } + if (!Objects.equals(_numVirtualCpu, other.getNumVirtualCpu())) { + return false; + } + if (!Objects.equals(_oversubscriptionPolicy, other.getOversubscriptionPolicy())) { + return false; + } + if (!Objects.equals(_pinning, other.getPinning())) { + return false; + } + if (!Objects.equals(_vduCpuRequirements, other.getVduCpuRequirements())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualCpuImpl otherImpl = (VirtualCpuImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualCpu"); + CodeHelpers.appendValue(helper, "_clock", _clock); + CodeHelpers.appendValue(helper, "_cpuArchitecture", _cpuArchitecture); + CodeHelpers.appendValue(helper, "_numVirtualCpu", _numVirtualCpu); + CodeHelpers.appendValue(helper, "_oversubscriptionPolicy", _oversubscriptionPolicy); + CodeHelpers.appendValue(helper, "_pinning", _pinning); + CodeHelpers.appendValue(helper, "_vduCpuRequirements", _vduCpuRequirements); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemory.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemory.java new file mode 100644 index 0000000..a12086e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemory.java @@ -0,0 +1,127 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.math.BigDecimal; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpuBuilder.VirtualCpuImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualMemoryBuilder.VirtualMemoryImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory.VduMemRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory.VduMemRequirementsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The virtual memory of the virtualised compute. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container virtual-memory {
+ *   leaf size {
+ *     type decimal64 {
+ *       fraction-digits 1;
+ *       range 0..max;
+ *     }
+ *     units GB;
+ *     default 1;
+ *   }
+ *   leaf over-subscription-policy {
+ *     type string;
+ *   }
+ *   list vdu-mem-requirements {
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ *   leaf numa-enabled {
+ *     type boolean;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/virtual-memory + * + *

To create instances of this class use {@link VirtualMemoryBuilder}. + * @see VirtualMemoryBuilder + * + */ +@JsonDeserialize(as = VirtualMemoryImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface VirtualMemory + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-memory"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualMemory.class; + } + + /** + * Amount of virtual memory in GB. + * + * + * + * @return java.math.BigDecimal size, or null if not present + */ + @Nullable BigDecimal getSize(); + + /** + * The memory core oversubscription policy in terms of virtual memory to physical + * memory on the platform. The cardinality can be 0 during the allocation request, + * if no particular value is requested. + * + * + * + * @return java.lang.String overSubscriptionPolicy, or null if not present + */ + @Nullable String getOverSubscriptionPolicy(); + + /** + * Array of key-value pair requirements on the memory for the VDU. + * + * + * + * @return java.util.Map vduMemRequirements, or null if not present + */ + @Nullable Map getVduMemRequirements(); + + /** + * @return java.util.Map vduMemRequirements, or an empty list if it is not present + */ + default @NonNull Map nonnullVduMemRequirements() { + return CodeHelpers.nonnull(getVduMemRequirements()); + } + + /** + * It specifies the memory allocation to be cognisant of the relevant process/core + * allocation. The cardinality can be 0 during the allocation request, if no + * particular value is requested. + * + * + * + * @return java.lang.Boolean numaEnabled, or null if not present + */ + @Nullable Boolean isNumaEnabled(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemoryBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemoryBuilder.java new file mode 100644 index 0000000..3086e2b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/VirtualMemoryBuilder.java @@ -0,0 +1,348 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Range; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory.VduMemRequirements; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory.VduMemRequirementsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualMemoryBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualMemoryBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualMemoryBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualMemoryBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualMemoryBuilder + * @see Builder + * + */ +public class VirtualMemoryBuilder implements Builder { + + private String _overSubscriptionPolicy; + private BigDecimal _size; + private Map _vduMemRequirements; + private Boolean _numaEnabled; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualMemoryBuilder() { + } + + public VirtualMemoryBuilder(VirtualMemory base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._overSubscriptionPolicy = base.getOverSubscriptionPolicy(); + this._size = base.getSize(); + this._vduMemRequirements = base.getVduMemRequirements(); + this._numaEnabled = base.isNumaEnabled(); + } + + + public String getOverSubscriptionPolicy() { + return _overSubscriptionPolicy; + } + + public BigDecimal getSize() { + return _size; + } + + public Map getVduMemRequirements() { + return _vduMemRequirements; + } + + public Boolean isNumaEnabled() { + return _numaEnabled; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VirtualMemoryBuilder setOverSubscriptionPolicy(final String value) { + this._overSubscriptionPolicy = value; + return this; + } + + private static final Range[] CHECKSIZERANGE_RANGES; + static { + @SuppressWarnings("unchecked") + final Range[] a = (Range[]) Array.newInstance(Range.class, 1); + a[0] = Range.closed(java.math.BigDecimal.ZERO, new java.math.BigDecimal("922337203685477580.7")); + CHECKSIZERANGE_RANGES = a; + } + private static void checkSizeRange(final java.math.BigDecimal value) { + for (Range r : CHECKSIZERANGE_RANGES) { + if (r.contains(value)) { + return; + } + } + CodeHelpers.throwInvalidRange(CHECKSIZERANGE_RANGES, value); + } + + public VirtualMemoryBuilder setSize(final BigDecimal value) { + if (value != null) { + checkSizeRange(value); + + } + this._size = value; + return this; + } + public VirtualMemoryBuilder setVduMemRequirements(final Map values) { + this._vduMemRequirements = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVduMemRequirements(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualMemoryBuilder setVduMemRequirements(final List values) { + return setVduMemRequirements(CodeHelpers.compatMap(values)); + } + + public VirtualMemoryBuilder setNumaEnabled(final Boolean value) { + this._numaEnabled = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualMemoryBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualMemoryBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualMemoryBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualMemoryBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualMemory build() { + return new VirtualMemoryImpl(this); + } + + public static final class VirtualMemoryImpl + extends AbstractAugmentable + implements VirtualMemory { + + @JsonProperty("over-subscription-policy") + private final String _overSubscriptionPolicy; + @JsonProperty("size") + private final BigDecimal _size; + private final Map _vduMemRequirements; + @JsonProperty("numa-enabled") + private final Boolean _numaEnabled; + + VirtualMemoryImpl(VirtualMemoryBuilder base) { + super(base.augmentation); + this._overSubscriptionPolicy = base.getOverSubscriptionPolicy(); + this._size = base.getSize(); + this._vduMemRequirements = CodeHelpers.emptyToNull(base.getVduMemRequirements()); + this._numaEnabled = base.isNumaEnabled(); + } + + public VirtualMemoryImpl() { + this( new VirtualMemoryBuilder()); + } + + @Override + public String getOverSubscriptionPolicy() { + return _overSubscriptionPolicy; + } + + @Override + public BigDecimal getSize() { + return _size; + } + + @Override + public Map getVduMemRequirements() { + return _vduMemRequirements; + } + + @Override + public Boolean isNumaEnabled() { + return _numaEnabled; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_overSubscriptionPolicy); + result = prime * result + Objects.hashCode(_size); + result = prime * result + Objects.hashCode(_vduMemRequirements); + result = prime * result + Objects.hashCode(_numaEnabled); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualMemory.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualMemory other = (VirtualMemory)obj; + if (!Objects.equals(_overSubscriptionPolicy, other.getOverSubscriptionPolicy())) { + return false; + } + if (!Objects.equals(_size, other.getSize())) { + return false; + } + if (!Objects.equals(_vduMemRequirements, other.getVduMemRequirements())) { + return false; + } + if (!Objects.equals(_numaEnabled, other.isNumaEnabled())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualMemoryImpl otherImpl = (VirtualMemoryImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualMemory"); + CodeHelpers.appendValue(helper, "_overSubscriptionPolicy", _overSubscriptionPolicy); + CodeHelpers.appendValue(helper, "_size", _size); + CodeHelpers.appendValue(helper, "_vduMemRequirements", _vduMemRequirements); + CodeHelpers.appendValue(helper, "_numaEnabled", _numaEnabled); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetail.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetail.java new file mode 100644 index 0000000..c9aeae4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetail.java @@ -0,0 +1,72 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.LogicalNode; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The logical node-level compute, memory and I/O requirements. An array of + * key-value pairs that articulate the deployment requirements. This could include + * the number of CPU cores on this logical node, a memory configuration specific + * a logical node (e.g. such as available in the Linux kernel via the libnuma + * library) or a requirement related to the association of an I/O device with the + * logical node. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list requirement-detail {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/logical-node/requirement-detail + * + *

To create instances of this class use {@link RequirementDetailBuilder}. + * @see RequirementDetailBuilder + * @see RequirementDetailKey + * + */ +public interface RequirementDetail + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("requirement-detail"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node.RequirementDetail.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + RequirementDetailKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailBuilder.java new file mode 100644 index 0000000..a83f58d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link RequirementDetailBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     RequirementDetailBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new RequirementDetailBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of RequirementDetailBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see RequirementDetailBuilder + * @see Builder + * + */ +public class RequirementDetailBuilder implements Builder { + + private String _key; + private String _value; + private RequirementDetailKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public RequirementDetailBuilder() { + } + + public RequirementDetailBuilder(RequirementDetail base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public RequirementDetailKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public RequirementDetailBuilder withKey(final RequirementDetailKey key) { + this.key = key; + return this; + } + + public RequirementDetailBuilder setKey(final String value) { + this._key = value; + return this; + } + + public RequirementDetailBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public RequirementDetailBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public RequirementDetailBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public RequirementDetailBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private RequirementDetailBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public RequirementDetail build() { + return new RequirementDetailImpl(this); + } + + private static final class RequirementDetailImpl + extends AbstractAugmentable + implements RequirementDetail { + + private final String _key; + private final String _value; + private final RequirementDetailKey key; + + RequirementDetailImpl(RequirementDetailBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new RequirementDetailKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public RequirementDetailKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!RequirementDetail.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + RequirementDetail other = (RequirementDetail)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + RequirementDetailImpl otherImpl = (RequirementDetailImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("RequirementDetail"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailKey.java new file mode 100644 index 0000000..86eee28 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/logical/node/RequirementDetailKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.logical.node; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class RequirementDetailKey + implements Identifier { + private static final long serialVersionUID = -6256096638926868520L; + private final String _key; + + + public RequirementDetailKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public RequirementDetailKey(RequirementDetailKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof RequirementDetailKey)) { + return false; + } + final RequirementDetailKey other = (RequirementDetailKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(RequirementDetailKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParameters.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParameters.java new file mode 100644 index 0000000..d0c2268 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParameters.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.RequestAdditionalCapability; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies specific attributes, dependent on the requested additional + * type. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list target-performance-parameters {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/request-additional-capability/target-performance-parameters + * + *

To create instances of this class use {@link TargetPerformanceParametersBuilder}. + * @see TargetPerformanceParametersBuilder + * @see TargetPerformanceParametersKey + * + */ +public interface TargetPerformanceParameters + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("target-performance-parameters"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability.TargetPerformanceParameters.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + TargetPerformanceParametersKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersBuilder.java new file mode 100644 index 0000000..294f1c6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link TargetPerformanceParametersBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     TargetPerformanceParametersBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new TargetPerformanceParametersBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of TargetPerformanceParametersBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see TargetPerformanceParametersBuilder + * @see Builder + * + */ +public class TargetPerformanceParametersBuilder implements Builder { + + private String _key; + private String _value; + private TargetPerformanceParametersKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public TargetPerformanceParametersBuilder() { + } + + public TargetPerformanceParametersBuilder(TargetPerformanceParameters base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public TargetPerformanceParametersKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public TargetPerformanceParametersBuilder withKey(final TargetPerformanceParametersKey key) { + this.key = key; + return this; + } + + public TargetPerformanceParametersBuilder setKey(final String value) { + this._key = value; + return this; + } + + public TargetPerformanceParametersBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public TargetPerformanceParametersBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public TargetPerformanceParametersBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public TargetPerformanceParametersBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private TargetPerformanceParametersBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public TargetPerformanceParameters build() { + return new TargetPerformanceParametersImpl(this); + } + + private static final class TargetPerformanceParametersImpl + extends AbstractAugmentable + implements TargetPerformanceParameters { + + private final String _key; + private final String _value; + private final TargetPerformanceParametersKey key; + + TargetPerformanceParametersImpl(TargetPerformanceParametersBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new TargetPerformanceParametersKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public TargetPerformanceParametersKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!TargetPerformanceParameters.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + TargetPerformanceParameters other = (TargetPerformanceParameters)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + TargetPerformanceParametersImpl otherImpl = (TargetPerformanceParametersImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("TargetPerformanceParameters"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersKey.java new file mode 100644 index 0000000..3d7a4ec --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/request/additional/capability/TargetPerformanceParametersKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.request.additional.capability; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class TargetPerformanceParametersKey + implements Identifier { + private static final long serialVersionUID = 7896677683262255240L; + private final String _key; + + + public TargetPerformanceParametersKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public TargetPerformanceParametersKey(TargetPerformanceParametersKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof TargetPerformanceParametersKey)) { + return false; + } + final TargetPerformanceParametersKey other = (TargetPerformanceParametersKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(TargetPerformanceParametersKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/Pinning.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/Pinning.java new file mode 100644 index 0000000..c2e7aba --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/Pinning.java @@ -0,0 +1,162 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning.Rule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning.RuleKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The virtual CPU pinning configuration for the virtualised compute resource. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container pinning {
+ *   presence "Set to specify CPU pinning.";
+ *   leaf policy {
+ *     default dynamic;
+ *     type enumeration {
+ *       enum static;
+ *       enum dynamic;
+ *     }
+ *   }
+ *   list rule {
+ *     when "../policy = 'static'";
+ *     key key;
+ *     leaf key {
+ *       type string;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/virtual-cpu/pinning + * + *

To create instances of this class use {@link PinningBuilder}. + * @see PinningBuilder + * + */ +public interface Pinning + extends + ChildOf, + Augmentable +{ + + + public enum Policy implements Enumeration { + Static(0, "static"), + + Dynamic(1, "dynamic") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Policy enumItem : Policy.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Policy(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Policy item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Policy item, or null if no such item exists + */ + public static Policy forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pinning"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.Pinning.class; + } + + /** + * The policy can take values of 'static' or 'dynamic'. In case of 'static' the + * virtual CPU cores are requested to be allocated to logical CPU cores according + * to the rules defined in virtualCpuPinningRules. In case of 'dynamic' the + * allocation of virtual CPU cores to logical CPU cores is decided by the VIM. + * (e.g. SMT (Simultaneous MultiThreading) requirements). + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.Pinning.Policy policy, or null if not present + */ + @Nullable Policy getPolicy(); + + /** + * A list of rules that should be considered during the allocation of the virtual + * CPUs to logical CPUs in case of 'static' virtualCpuPinningPolicy. + * + * + * + * @return java.util.Map rule, or null if not present + */ + @Nullable Map getRule(); + + /** + * @return java.util.Map rule, or an empty list if it is not present + */ + default @NonNull Map nonnullRule() { + return CodeHelpers.nonnull(getRule()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/PinningBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/PinningBuilder.java new file mode 100644 index 0000000..8250f92 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/PinningBuilder.java @@ -0,0 +1,270 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning.Rule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning.RuleKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PinningBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PinningBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PinningBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PinningBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PinningBuilder + * @see Builder + * + */ +public class PinningBuilder implements Builder { + + private Pinning.Policy _policy; + private Map _rule; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PinningBuilder() { + } + + public PinningBuilder(Pinning base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._policy = base.getPolicy(); + this._rule = base.getRule(); + } + + + public Pinning.Policy getPolicy() { + return _policy; + } + + public Map getRule() { + return _rule; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PinningBuilder setPolicy(final Pinning.Policy value) { + this._policy = value; + return this; + } + public PinningBuilder setRule(final Map values) { + this._rule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PinningBuilder setRule(final List values) { + return setRule(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PinningBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PinningBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PinningBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PinningBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pinning build() { + return new PinningImpl(this); + } + + private static final class PinningImpl + extends AbstractAugmentable + implements Pinning { + + private final Pinning.Policy _policy; + private final Map _rule; + + PinningImpl(PinningBuilder base) { + super(base.augmentation); + this._policy = base.getPolicy(); + this._rule = CodeHelpers.emptyToNull(base.getRule()); + } + + @Override + public Pinning.Policy getPolicy() { + return _policy; + } + + @Override + public Map getRule() { + return _rule; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_policy); + result = prime * result + Objects.hashCode(_rule); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pinning.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pinning other = (Pinning)obj; + if (!Objects.equals(_policy, other.getPolicy())) { + return false; + } + if (!Objects.equals(_rule, other.getRule())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PinningImpl otherImpl = (PinningImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pinning"); + CodeHelpers.appendValue(helper, "_policy", _policy); + CodeHelpers.appendValue(helper, "_rule", _rule); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirements.java new file mode 100644 index 0000000..b6a193e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirements.java @@ -0,0 +1,67 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpu; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of key-value pair requirements on the compute (CPU) for the VDU. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vdu-cpu-requirements {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/virtual-cpu/vdu-cpu-requirements + * + *

To create instances of this class use {@link VduCpuRequirementsBuilder}. + * @see VduCpuRequirementsBuilder + * @see VduCpuRequirementsKey + * + */ +public interface VduCpuRequirements + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu-cpu-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.VduCpuRequirements.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + VduCpuRequirementsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsBuilder.java new file mode 100644 index 0000000..a48f3e0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VduCpuRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VduCpuRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VduCpuRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VduCpuRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VduCpuRequirementsBuilder + * @see Builder + * + */ +public class VduCpuRequirementsBuilder implements Builder { + + private String _key; + private String _value; + private VduCpuRequirementsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VduCpuRequirementsBuilder() { + } + + public VduCpuRequirementsBuilder(VduCpuRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public VduCpuRequirementsKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VduCpuRequirementsBuilder withKey(final VduCpuRequirementsKey key) { + this.key = key; + return this; + } + + public VduCpuRequirementsBuilder setKey(final String value) { + this._key = value; + return this; + } + + public VduCpuRequirementsBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VduCpuRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VduCpuRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VduCpuRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VduCpuRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VduCpuRequirements build() { + return new VduCpuRequirementsImpl(this); + } + + private static final class VduCpuRequirementsImpl + extends AbstractAugmentable + implements VduCpuRequirements { + + private final String _key; + private final String _value; + private final VduCpuRequirementsKey key; + + VduCpuRequirementsImpl(VduCpuRequirementsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VduCpuRequirementsKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public VduCpuRequirementsKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VduCpuRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VduCpuRequirements other = (VduCpuRequirements)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VduCpuRequirementsImpl otherImpl = (VduCpuRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VduCpuRequirements"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsKey.java new file mode 100644 index 0000000..e3fce7c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/VduCpuRequirementsKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VduCpuRequirementsKey + implements Identifier { + private static final long serialVersionUID = 6064457972693741496L; + private final String _key; + + + public VduCpuRequirementsKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VduCpuRequirementsKey(VduCpuRequirementsKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VduCpuRequirementsKey)) { + return false; + } + final VduCpuRequirementsKey other = (VduCpuRequirementsKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VduCpuRequirementsKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/Rule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/Rule.java new file mode 100644 index 0000000..a656898 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/Rule.java @@ -0,0 +1,69 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.Pinning; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * A list of rules that should be considered during the allocation of the virtual + * CPUs to logical CPUs in case of 'static' virtualCpuPinningPolicy. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list rule {
+ *   when "../policy = 'static'";
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/virtual-cpu/pinning/rule + * + *

To create instances of this class use {@link RuleBuilder}. + * @see RuleBuilder + * @see RuleKey + * + */ +public interface Rule + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("rule"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning.Rule.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + RuleKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleBuilder.java new file mode 100644 index 0000000..1526ab4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link RuleBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     RuleBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new RuleBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of RuleBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see RuleBuilder + * @see Builder + * + */ +public class RuleBuilder implements Builder { + + private String _key; + private String _value; + private RuleKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public RuleBuilder() { + } + + public RuleBuilder(Rule base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public RuleKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public RuleBuilder withKey(final RuleKey key) { + this.key = key; + return this; + } + + public RuleBuilder setKey(final String value) { + this._key = value; + return this; + } + + public RuleBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public RuleBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public RuleBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public RuleBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private RuleBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Rule build() { + return new RuleImpl(this); + } + + private static final class RuleImpl + extends AbstractAugmentable + implements Rule { + + private final String _key; + private final String _value; + private final RuleKey key; + + RuleImpl(RuleBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new RuleKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public RuleKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Rule.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Rule other = (Rule)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + RuleImpl otherImpl = (RuleImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Rule"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleKey.java new file mode 100644 index 0000000..a4f4162 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/cpu/pinning/RuleKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.pinning; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class RuleKey + implements Identifier { + private static final long serialVersionUID = -7372554665194622883L; + private final String _key; + + + public RuleKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public RuleKey(RuleKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof RuleKey)) { + return false; + } + final RuleKey other = (RuleKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(RuleKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirements.java new file mode 100644 index 0000000..982fff3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirements.java @@ -0,0 +1,67 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualMemory; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of key-value pair requirements on the memory for the VDU. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vdu-mem-requirements {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-compute-desc/virtual-memory/vdu-mem-requirements + * + *

To create instances of this class use {@link VduMemRequirementsBuilder}. + * @see VduMemRequirementsBuilder + * @see VduMemRequirementsKey + * + */ +public interface VduMemRequirements + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu-mem-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory.VduMemRequirements.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + VduMemRequirementsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsBuilder.java new file mode 100644 index 0000000..b1824b9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VduMemRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VduMemRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VduMemRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VduMemRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VduMemRequirementsBuilder + * @see Builder + * + */ +public class VduMemRequirementsBuilder implements Builder { + + private String _key; + private String _value; + private VduMemRequirementsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VduMemRequirementsBuilder() { + } + + public VduMemRequirementsBuilder(VduMemRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public VduMemRequirementsKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VduMemRequirementsBuilder withKey(final VduMemRequirementsKey key) { + this.key = key; + return this; + } + + public VduMemRequirementsBuilder setKey(final String value) { + this._key = value; + return this; + } + + public VduMemRequirementsBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VduMemRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VduMemRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VduMemRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VduMemRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VduMemRequirements build() { + return new VduMemRequirementsImpl(this); + } + + private static final class VduMemRequirementsImpl + extends AbstractAugmentable + implements VduMemRequirements { + + private final String _key; + private final String _value; + private final VduMemRequirementsKey key; + + VduMemRequirementsImpl(VduMemRequirementsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VduMemRequirementsKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public VduMemRequirementsKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VduMemRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VduMemRequirements other = (VduMemRequirements)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VduMemRequirementsImpl otherImpl = (VduMemRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VduMemRequirements"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsKey.java new file mode 100644 index 0000000..1abcdf6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/compute/desc/virtual/memory/VduMemRequirementsKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.memory; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VduMemRequirementsKey + implements Identifier { + private static final long serialVersionUID = 938784692346778508L; + private final String _key; + + + public VduMemRequirementsKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VduMemRequirementsKey(VduMemRequirementsKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VduMemRequirementsKey)) { + return false; + } + final VduMemRequirementsKey other = (VduMemRequirementsKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VduMemRequirementsKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirements.java new file mode 100644 index 0000000..88f23a0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirements.java @@ -0,0 +1,67 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Array of key-value pairs that articulate the storage deployment requirements. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vdu-storage-requirements {
+ *   key key;
+ *   leaf key {
+ *     type string;
+ *   }
+ *   leaf value {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd/virtual-storage-desc/vdu-storage-requirements + * + *

To create instances of this class use {@link VduStorageRequirementsBuilder}. + * @see VduStorageRequirementsBuilder + * @see VduStorageRequirementsKey + * + */ +public interface VduStorageRequirements + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu-storage-requirements"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc.VduStorageRequirements.class; + } + + /** + * @return java.lang.String key, or null if not present + */ + @Nullable String getKey(); + + /** + * @return java.lang.String value, or null if not present + */ + @Nullable String getValue(); + + @Override + VduStorageRequirementsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsBuilder.java new file mode 100644 index 0000000..5f4f4bd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VduStorageRequirementsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VduStorageRequirementsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VduStorageRequirementsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VduStorageRequirementsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VduStorageRequirementsBuilder + * @see Builder + * + */ +public class VduStorageRequirementsBuilder implements Builder { + + private String _key; + private String _value; + private VduStorageRequirementsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VduStorageRequirementsBuilder() { + } + + public VduStorageRequirementsBuilder(VduStorageRequirements base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._key = base.getKey(); + this._value = base.getValue(); + } + + + public VduStorageRequirementsKey key() { + return key; + } + + public String getKey() { + return _key; + } + + public String getValue() { + return _value; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VduStorageRequirementsBuilder withKey(final VduStorageRequirementsKey key) { + this.key = key; + return this; + } + + public VduStorageRequirementsBuilder setKey(final String value) { + this._key = value; + return this; + } + + public VduStorageRequirementsBuilder setValue(final String value) { + this._value = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VduStorageRequirementsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VduStorageRequirementsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VduStorageRequirementsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VduStorageRequirementsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VduStorageRequirements build() { + return new VduStorageRequirementsImpl(this); + } + + private static final class VduStorageRequirementsImpl + extends AbstractAugmentable + implements VduStorageRequirements { + + private final String _key; + private final String _value; + private final VduStorageRequirementsKey key; + + VduStorageRequirementsImpl(VduStorageRequirementsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VduStorageRequirementsKey(base.getKey()); + } + this._key = key.getKey(); + this._value = base.getValue(); + } + + @Override + public VduStorageRequirementsKey key() { + return key; + } + + @Override + public String getKey() { + return _key; + } + + @Override + public String getValue() { + return _value; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_key); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VduStorageRequirements.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VduStorageRequirements other = (VduStorageRequirements)obj; + if (!Objects.equals(_key, other.getKey())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VduStorageRequirementsImpl otherImpl = (VduStorageRequirementsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VduStorageRequirements"); + CodeHelpers.appendValue(helper, "_key", _key); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsKey.java new file mode 100644 index 0000000..c5944bc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/vnfd/virtual/storage/desc/VduStorageRequirementsKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.storage.desc; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VduStorageRequirementsKey + implements Identifier { + private static final long serialVersionUID = 7623825622131379059L; + private final String _key; + + + public VduStorageRequirementsKey(String _key) { + + this._key = _key; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VduStorageRequirementsKey(VduStorageRequirementsKey source) { + this._key = source._key; + } + + + public String getKey() { + return _key; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_key); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VduStorageRequirementsKey)) { + return false; + } + final VduStorageRequirementsKey other = (VduStorageRequirementsKey) obj; + if (!Objects.equals(_key, other._key)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VduStorageRequirementsKey.class); + CodeHelpers.appendValue(helper, "_key", _key); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModelBindingProvider.java new file mode 100644 index 0000000..dc5db2e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModuleInfoImpl.java new file mode 100644 index 0000000..755f1df --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-nsd", "2019-04-25", "etsi-nfv-nsd").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-nsd@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/EtsiNfvNsdData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/EtsiNfvNsdData.java new file mode 100644 index 0000000..e2fbc66 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/EtsiNfvNsdData.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataRoot; + +/** + * Network Services Descriptors + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-nsd + *

+ * module etsi-nfv-nsd {
+ *   yang-version 1.1;
+ *   namespace urn:etsi:nfv:yang:etsi-nfv-nsd;
+ *   prefix nsd;
+ *   import etsi-nfv-descriptors {
+ *     prefix vnf;
+ *   }
+ *   revision 2019-04-25 {
+ *   }
+ *   container nsd {
+ *     list vnfd {
+ *       key id;
+ *       uses vnf:vnfd;
+ *     }
+ *     list nsd {
+ *       key id;
+ *       max-elements 1;
+ *       uses vnf:nsd;
+ *     }
+ *     list pnfd {
+ *       key id;
+ *       uses vnf:pnfd;
+ *     }
+ *   }
+ * }
+ * 
+ * + */ +public interface EtsiNfvNsdData + extends + DataRoot +{ + + + + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.Nsd nsd, or null if not present + */ + @Nullable Nsd getNsd(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/Nsd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/Nsd.java new file mode 100644 index 0000000..2d2e9f8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/Nsd.java @@ -0,0 +1,112 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.NsdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.Pnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.PnfdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.VnfdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-nsd + *

+ * container nsd {
+ *   list vnfd {
+ *     key id;
+ *     uses vnf:vnfd;
+ *   }
+ *   list nsd {
+ *     key id;
+ *     max-elements 1;
+ *     uses vnf:nsd;
+ *   }
+ *   list pnfd {
+ *     key id;
+ *     uses vnf:pnfd;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-nsd/nsd + * + *

To create instances of this class use {@link NsdBuilder}. + * @see NsdBuilder + * + */ +public interface Nsd + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nsd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.Nsd.class; + } + + /** + * A VNF Descriptor (VNFD) is a deployment template which describes a VNF in terms + * of deployment and operational behaviour requirements. It also contains + * connectivity, interface and virtualised resource requirements + * + * + * + * @return java.util.Map vnfd, or null if not present + */ + @Nullable Map getVnfd(); + + /** + * @return java.util.Map vnfd, or an empty list if it is not present + */ + default @NonNull Map nonnullVnfd() { + return CodeHelpers.nonnull(getVnfd()); + } + + /** + * The NSD information element is a deployment template whose instances are used by + * the NFVO for the lifecycle management of NSs. + * + * + * + * @return java.util.Map nsd, or null if not present + */ + @Nullable Map getNsd(); + + /** + * @return java.util.Map nsd, or an empty list if it is not present + */ + default @NonNull Map nonnullNsd() { + return CodeHelpers.nonnull(getNsd()); + } + + /** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only. + * + * + * + * @return java.util.Map pnfd, or null if not present + */ + @Nullable Map getPnfd(); + + /** + * @return java.util.Map pnfd, or an empty list if it is not present + */ + default @NonNull Map nonnullPnfd() { + return CodeHelpers.nonnull(getPnfd()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/NsdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/NsdBuilder.java new file mode 100644 index 0000000..30fd081 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/NsdBuilder.java @@ -0,0 +1,330 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.NsdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.Pnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.PnfdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.VnfdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsdBuilder + * @see Builder + * + */ +public class NsdBuilder implements Builder { + + private Map _nsd; + private Map _pnfd; + private Map _vnfd; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsdBuilder() { + } + + public NsdBuilder(Nsd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._nsd = base.getNsd(); + this._pnfd = base.getPnfd(); + this._vnfd = base.getVnfd(); + } + + + public Map getNsd() { + return _nsd; + } + + public Map getPnfd() { + return _pnfd; + } + + public Map getVnfd() { + return _vnfd; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsdBuilder setNsd(final Map values) { + this._nsd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setNsd(final List values) { + return setNsd(CodeHelpers.compatMap(values)); + } + public NsdBuilder setPnfd(final Map values) { + this._pnfd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setPnfd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setPnfd(final List values) { + return setPnfd(CodeHelpers.compatMap(values)); + } + public NsdBuilder setVnfd(final Map values) { + this._vnfd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnfd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setVnfd(final List values) { + return setVnfd(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nsd build() { + return new NsdImpl(this); + } + + private static final class NsdImpl + extends AbstractAugmentable + implements Nsd { + + private final Map _nsd; + private final Map _pnfd; + private final Map _vnfd; + + NsdImpl(NsdBuilder base) { + super(base.augmentation); + this._nsd = CodeHelpers.emptyToNull(base.getNsd()); + this._pnfd = CodeHelpers.emptyToNull(base.getPnfd()); + this._vnfd = CodeHelpers.emptyToNull(base.getVnfd()); + } + + @Override + public Map getNsd() { + return _nsd; + } + + @Override + public Map getPnfd() { + return _pnfd; + } + + @Override + public Map getVnfd() { + return _vnfd; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_nsd); + result = prime * result + Objects.hashCode(_pnfd); + result = prime * result + Objects.hashCode(_vnfd); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nsd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nsd other = (Nsd)obj; + if (!Objects.equals(_nsd, other.getNsd())) { + return false; + } + if (!Objects.equals(_pnfd, other.getPnfd())) { + return false; + } + if (!Objects.equals(_vnfd, other.getVnfd())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsdImpl otherImpl = (NsdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nsd"); + CodeHelpers.appendValue(helper, "_nsd", _nsd); + CodeHelpers.appendValue(helper, "_pnfd", _pnfd); + CodeHelpers.appendValue(helper, "_vnfd", _vnfd); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Nsd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Nsd.java new file mode 100644 index 0000000..71850d8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Nsd.java @@ -0,0 +1,52 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The NSD information element is a deployment template whose instances are used + * the NFVO for the lifecycle management of NSs. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-nsd + *

+ * list nsd {
+ *   key id;
+ *   max-elements 1;
+ *   uses vnf:nsd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-nsd/nsd/nsd + * + *

To create instances of this class use {@link NsdBuilder}. + * @see NsdBuilder + * @see NsdKey + * + */ +public interface Nsd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nsd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.Nsd.class; + } + + @Override + NsdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdBuilder.java new file mode 100644 index 0000000..d143eb7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdBuilder.java @@ -0,0 +1,773 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.SapdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VnffgdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsdBuilder + * @see Builder + * + */ +public class NsdBuilder implements Builder { + + private String _algorithm; + private List _autoscaleRule; + private String _certificate; + private String _designer; + private Map _df; + private String _id; + private String _invariantId; + private Map _lifecycleManagementScript; + private String _name; + private List _nestedNsdId; + private List _pnfdId; + private Map _sapd; + private String _signature; + private String _version; + private Map _virtualLinkDesc; + private List _vnfdId; + private Map _vnffgd; + private NsdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsdBuilder() { + } + public NsdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd arg) { + this._id = arg.getId(); + this._designer = arg.getDesigner(); + this._version = arg.getVersion(); + this._name = arg.getName(); + this._invariantId = arg.getInvariantId(); + this._nestedNsdId = arg.getNestedNsdId(); + this._vnfdId = arg.getVnfdId(); + this._pnfdId = arg.getPnfdId(); + this._sapd = arg.getSapd(); + this._virtualLinkDesc = arg.getVirtualLinkDesc(); + this._vnffgd = arg.getVnffgd(); + this._autoscaleRule = arg.getAutoscaleRule(); + this._lifecycleManagementScript = arg.getLifecycleManagementScript(); + this._df = arg.getDf(); + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + public NsdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters arg) { + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + + public NsdBuilder(Nsd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._algorithm = base.getAlgorithm(); + this._autoscaleRule = base.getAutoscaleRule(); + this._certificate = base.getCertificate(); + this._designer = base.getDesigner(); + this._df = base.getDf(); + this._invariantId = base.getInvariantId(); + this._lifecycleManagementScript = base.getLifecycleManagementScript(); + this._name = base.getName(); + this._nestedNsdId = base.getNestedNsdId(); + this._pnfdId = base.getPnfdId(); + this._sapd = base.getSapd(); + this._signature = base.getSignature(); + this._version = base.getVersion(); + this._virtualLinkDesc = base.getVirtualLinkDesc(); + this._vnfdId = base.getVnfdId(); + this._vnffgd = base.getVnffgd(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getId(); + this._designer = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getDesigner(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVersion(); + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getName(); + this._invariantId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getInvariantId(); + this._nestedNsdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getNestedNsdId(); + this._vnfdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVnfdId(); + this._pnfdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getPnfdId(); + this._sapd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getSapd(); + this._virtualLinkDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVirtualLinkDesc(); + this._vnffgd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVnffgd(); + this._autoscaleRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getAutoscaleRule(); + this._lifecycleManagementScript = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getLifecycleManagementScript(); + this._df = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getDf(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters) { + this._signature = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getSignature(); + this._algorithm = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getAlgorithm(); + this._certificate = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getCertificate(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters]"); + } + + public NsdKey key() { + return key; + } + + public String getAlgorithm() { + return _algorithm; + } + + public List getAutoscaleRule() { + return _autoscaleRule; + } + + public String getCertificate() { + return _certificate; + } + + public String getDesigner() { + return _designer; + } + + public Map getDf() { + return _df; + } + + public String getId() { + return _id; + } + + public String getInvariantId() { + return _invariantId; + } + + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + public String getName() { + return _name; + } + + public List getNestedNsdId() { + return _nestedNsdId; + } + + public List getPnfdId() { + return _pnfdId; + } + + public Map getSapd() { + return _sapd; + } + + public String getSignature() { + return _signature; + } + + public String getVersion() { + return _version; + } + + public Map getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + public List getVnfdId() { + return _vnfdId; + } + + public Map getVnffgd() { + return _vnffgd; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsdBuilder withKey(final NsdKey key) { + this.key = key; + return this; + } + + public NsdBuilder setAlgorithm(final String value) { + this._algorithm = value; + return this; + } + public NsdBuilder setAutoscaleRule(final List values) { + this._autoscaleRule = values; + return this; + } + + + public NsdBuilder setCertificate(final String value) { + this._certificate = value; + return this; + } + + public NsdBuilder setDesigner(final String value) { + this._designer = value; + return this; + } + public NsdBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setId(final String value) { + this._id = value; + return this; + } + + public NsdBuilder setInvariantId(final String value) { + this._invariantId = value; + return this; + } + public NsdBuilder setLifecycleManagementScript(final Map values) { + this._lifecycleManagementScript = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLifecycleManagementScript(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setLifecycleManagementScript(final List values) { + return setLifecycleManagementScript(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setName(final String value) { + this._name = value; + return this; + } + public NsdBuilder setNestedNsdId(final List values) { + this._nestedNsdId = values; + return this; + } + + public NsdBuilder setPnfdId(final List values) { + this._pnfdId = values; + return this; + } + + public NsdBuilder setSapd(final Map values) { + this._sapd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSapd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setSapd(final List values) { + return setSapd(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setSignature(final String value) { + this._signature = value; + return this; + } + + public NsdBuilder setVersion(final String value) { + this._version = value; + return this; + } + public NsdBuilder setVirtualLinkDesc(final Map values) { + this._virtualLinkDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setVirtualLinkDesc(final List values) { + return setVirtualLinkDesc(CodeHelpers.compatMap(values)); + } + public NsdBuilder setVnfdId(final List values) { + this._vnfdId = values; + return this; + } + + public NsdBuilder setVnffgd(final Map values) { + this._vnffgd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnffgd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setVnffgd(final List values) { + return setVnffgd(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nsd build() { + return new NsdImpl(this); + } + + private static final class NsdImpl + extends AbstractAugmentable + implements Nsd { + + private final String _algorithm; + private final List _autoscaleRule; + private final String _certificate; + private final String _designer; + private final Map _df; + private final String _id; + private final String _invariantId; + private final Map _lifecycleManagementScript; + private final String _name; + private final List _nestedNsdId; + private final List _pnfdId; + private final Map _sapd; + private final String _signature; + private final String _version; + private final Map _virtualLinkDesc; + private final List _vnfdId; + private final Map _vnffgd; + private final NsdKey key; + + NsdImpl(NsdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsdKey(base.getId()); + } + this._id = key.getId(); + this._algorithm = base.getAlgorithm(); + this._autoscaleRule = base.getAutoscaleRule(); + this._certificate = base.getCertificate(); + this._designer = base.getDesigner(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._invariantId = base.getInvariantId(); + this._lifecycleManagementScript = CodeHelpers.emptyToNull(base.getLifecycleManagementScript()); + this._name = base.getName(); + this._nestedNsdId = base.getNestedNsdId(); + this._pnfdId = base.getPnfdId(); + this._sapd = CodeHelpers.emptyToNull(base.getSapd()); + this._signature = base.getSignature(); + this._version = base.getVersion(); + this._virtualLinkDesc = CodeHelpers.emptyToNull(base.getVirtualLinkDesc()); + this._vnfdId = base.getVnfdId(); + this._vnffgd = CodeHelpers.emptyToNull(base.getVnffgd()); + } + + @Override + public NsdKey key() { + return key; + } + + @Override + public String getAlgorithm() { + return _algorithm; + } + + @Override + public List getAutoscaleRule() { + return _autoscaleRule; + } + + @Override + public String getCertificate() { + return _certificate; + } + + @Override + public String getDesigner() { + return _designer; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInvariantId() { + return _invariantId; + } + + @Override + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + @Override + public String getName() { + return _name; + } + + @Override + public List getNestedNsdId() { + return _nestedNsdId; + } + + @Override + public List getPnfdId() { + return _pnfdId; + } + + @Override + public Map getSapd() { + return _sapd; + } + + @Override + public String getSignature() { + return _signature; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public Map getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + @Override + public List getVnfdId() { + return _vnfdId; + } + + @Override + public Map getVnffgd() { + return _vnffgd; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_algorithm); + result = prime * result + Objects.hashCode(_autoscaleRule); + result = prime * result + Objects.hashCode(_certificate); + result = prime * result + Objects.hashCode(_designer); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_invariantId); + result = prime * result + Objects.hashCode(_lifecycleManagementScript); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_nestedNsdId); + result = prime * result + Objects.hashCode(_pnfdId); + result = prime * result + Objects.hashCode(_sapd); + result = prime * result + Objects.hashCode(_signature); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(_virtualLinkDesc); + result = prime * result + Objects.hashCode(_vnfdId); + result = prime * result + Objects.hashCode(_vnffgd); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nsd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nsd other = (Nsd)obj; + if (!Objects.equals(_algorithm, other.getAlgorithm())) { + return false; + } + if (!Objects.equals(_autoscaleRule, other.getAutoscaleRule())) { + return false; + } + if (!Objects.equals(_certificate, other.getCertificate())) { + return false; + } + if (!Objects.equals(_designer, other.getDesigner())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_invariantId, other.getInvariantId())) { + return false; + } + if (!Objects.equals(_lifecycleManagementScript, other.getLifecycleManagementScript())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_nestedNsdId, other.getNestedNsdId())) { + return false; + } + if (!Objects.equals(_pnfdId, other.getPnfdId())) { + return false; + } + if (!Objects.equals(_sapd, other.getSapd())) { + return false; + } + if (!Objects.equals(_signature, other.getSignature())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (!Objects.equals(_virtualLinkDesc, other.getVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_vnfdId, other.getVnfdId())) { + return false; + } + if (!Objects.equals(_vnffgd, other.getVnffgd())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsdImpl otherImpl = (NsdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nsd"); + CodeHelpers.appendValue(helper, "_algorithm", _algorithm); + CodeHelpers.appendValue(helper, "_autoscaleRule", _autoscaleRule); + CodeHelpers.appendValue(helper, "_certificate", _certificate); + CodeHelpers.appendValue(helper, "_designer", _designer); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_invariantId", _invariantId); + CodeHelpers.appendValue(helper, "_lifecycleManagementScript", _lifecycleManagementScript); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_nestedNsdId", _nestedNsdId); + CodeHelpers.appendValue(helper, "_pnfdId", _pnfdId); + CodeHelpers.appendValue(helper, "_sapd", _sapd); + CodeHelpers.appendValue(helper, "_signature", _signature); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "_virtualLinkDesc", _virtualLinkDesc); + CodeHelpers.appendValue(helper, "_vnfdId", _vnfdId); + CodeHelpers.appendValue(helper, "_vnffgd", _vnffgd); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdKey.java new file mode 100644 index 0000000..2bc0942 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/NsdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsdKey + implements Identifier { + private static final long serialVersionUID = 8060294317279421094L; + private final String _id; + + + public NsdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsdKey(NsdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsdKey)) { + return false; + } + final NsdKey other = (NsdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Pnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Pnfd.java new file mode 100644 index 0000000..eda7d98 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Pnfd.java @@ -0,0 +1,52 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.Nsd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-nsd + *

+ * list pnfd {
+ *   key id;
+ *   uses vnf:pnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-nsd/nsd/pnfd + * + *

To create instances of this class use {@link PnfdBuilder}. + * @see PnfdBuilder + * @see PnfdKey + * + */ +public interface Pnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.Pnfd.class; + } + + @Override + PnfdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdBuilder.java new file mode 100644 index 0000000..9166d77 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdBuilder.java @@ -0,0 +1,558 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.Security; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.SecurityKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfdBuilder + * @see Builder + * + */ +public class PnfdBuilder implements Builder { + + private Map _extCpd; + private String _functionDescription; + private String _geographicalLocationInfo; + private String _id; + private String _invariantId; + private String _name; + private String _provider; + private Map _security; + private Map _securityGroupRule; + private String _version; + private PnfdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfdBuilder() { + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd arg) { + this._id = arg.getId(); + this._functionDescription = arg.getFunctionDescription(); + this._provider = arg.getProvider(); + this._version = arg.getVersion(); + this._invariantId = arg.getInvariantId(); + this._name = arg.getName(); + this._extCpd = arg.getExtCpd(); + this._security = arg.getSecurity(); + this._geographicalLocationInfo = arg.getGeographicalLocationInfo(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public PnfdBuilder(Pnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._extCpd = base.getExtCpd(); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = base.getSecurity(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._version = base.getVersion(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getId(); + this._functionDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getFunctionDescription(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getProvider(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getVersion(); + this._invariantId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getInvariantId(); + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getName(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getExtCpd(); + this._security = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getSecurity(); + this._geographicalLocationInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getGeographicalLocationInfo(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd]"); + } + + public PnfdKey key() { + return key; + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getFunctionDescription() { + return _functionDescription; + } + + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + public String getId() { + return _id; + } + + public String getInvariantId() { + return _invariantId; + } + + public String getName() { + return _name; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurity() { + return _security; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getVersion() { + return _version; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PnfdBuilder withKey(final PnfdKey key) { + this.key = key; + return this; + } + public PnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setFunctionDescription(final String value) { + this._functionDescription = value; + return this; + } + + public PnfdBuilder setGeographicalLocationInfo(final String value) { + this._geographicalLocationInfo = value; + return this; + } + + public PnfdBuilder setId(final String value) { + this._id = value; + return this; + } + + public PnfdBuilder setInvariantId(final String value) { + this._invariantId = value; + return this; + } + + public PnfdBuilder setName(final String value) { + this._name = value; + return this; + } + + public PnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public PnfdBuilder setSecurity(final Map values) { + this._security = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setSecurity(final List values) { + return setSecurity(CodeHelpers.compatMap(values)); + } + public PnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnfd build() { + return new PnfdImpl(this); + } + + private static final class PnfdImpl + extends AbstractAugmentable + implements Pnfd { + + private final Map _extCpd; + private final String _functionDescription; + private final String _geographicalLocationInfo; + private final String _id; + private final String _invariantId; + private final String _name; + private final String _provider; + private final Map _security; + private final Map _securityGroupRule; + private final String _version; + private final PnfdKey key; + + PnfdImpl(PnfdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new PnfdKey(base.getId()); + } + this._id = key.getId(); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = CodeHelpers.emptyToNull(base.getSecurity()); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._version = base.getVersion(); + } + + @Override + public PnfdKey key() { + return key; + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getFunctionDescription() { + return _functionDescription; + } + + @Override + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInvariantId() { + return _invariantId; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurity() { + return _security; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getVersion() { + return _version; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_functionDescription); + result = prime * result + Objects.hashCode(_geographicalLocationInfo); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_invariantId); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_security); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnfd other = (Pnfd)obj; + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_functionDescription, other.getFunctionDescription())) { + return false; + } + if (!Objects.equals(_geographicalLocationInfo, other.getGeographicalLocationInfo())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_invariantId, other.getInvariantId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_security, other.getSecurity())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfdImpl otherImpl = (PnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnfd"); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_functionDescription", _functionDescription); + CodeHelpers.appendValue(helper, "_geographicalLocationInfo", _geographicalLocationInfo); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_invariantId", _invariantId); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_security", _security); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdKey.java new file mode 100644 index 0000000..5e15098 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/PnfdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class PnfdKey + implements Identifier { + private static final long serialVersionUID = -6839690951618085740L; + private final String _id; + + + public PnfdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public PnfdKey(PnfdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof PnfdKey)) { + return false; + } + final PnfdKey other = (PnfdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(PnfdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Vnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Vnfd.java new file mode 100644 index 0000000..58d3c95 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/Vnfd.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.Nsd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * A VNF Descriptor (VNFD) is a deployment template which describes a VNF in terms + * of deployment and operational behaviour requirements. It also contains + * connectivity, interface and virtualised resource requirements + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-nsd + *

+ * list vnfd {
+ *   key id;
+ *   uses vnf:vnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-nsd/nsd/vnfd + * + *

To create instances of this class use {@link VnfdBuilder}. + * @see VnfdBuilder + * @see VnfdKey + * + */ +public interface Vnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.Vnfd.class; + } + + @Override + VnfdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdBuilder.java new file mode 100644 index 0000000..96fd592 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdBuilder.java @@ -0,0 +1,1062 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfdBuilder + * @see Builder + * + */ +public class VnfdBuilder implements Builder { + + private List _autoScale; + private ConfigurableProperties _configurableProperties; + private String _defaultLocalizationLanguage; + private Map _df; + private Map _elementGroup; + private Map _extCpd; + private String _id; + private Map _indicator; + private Map _intVirtualLinkDesc; + private Map _lifecycleManagementScript; + private String _localizationLanguage; + private ModifiableAttributes _modifiableAttributes; + private String _productInfoDescription; + private String _productInfoName; + private String _productName; + private String _provider; + private Map _securityGroupRule; + private String _softwareVersion; + private Map _swImageDesc; + private Map _vdu; + private String _version; + private Map _virtualComputeDesc; + private Map _virtualStorageDesc; + private List _vnfmInfo; + private VnfdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfdBuilder() { + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd arg) { + this._id = arg.getId(); + this._provider = arg.getProvider(); + this._productName = arg.getProductName(); + this._softwareVersion = arg.getSoftwareVersion(); + this._version = arg.getVersion(); + this._productInfoName = arg.getProductInfoName(); + this._productInfoDescription = arg.getProductInfoDescription(); + this._vnfmInfo = arg.getVnfmInfo(); + this._localizationLanguage = arg.getLocalizationLanguage(); + this._defaultLocalizationLanguage = arg.getDefaultLocalizationLanguage(); + this._vdu = arg.getVdu(); + this._virtualComputeDesc = arg.getVirtualComputeDesc(); + this._virtualStorageDesc = arg.getVirtualStorageDesc(); + this._swImageDesc = arg.getSwImageDesc(); + this._intVirtualLinkDesc = arg.getIntVirtualLinkDesc(); + this._extCpd = arg.getExtCpd(); + this._df = arg.getDf(); + this._configurableProperties = arg.getConfigurableProperties(); + this._modifiableAttributes = arg.getModifiableAttributes(); + this._lifecycleManagementScript = arg.getLifecycleManagementScript(); + this._elementGroup = arg.getElementGroup(); + this._indicator = arg.getIndicator(); + this._autoScale = arg.getAutoScale(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public VnfdBuilder(Vnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = base.getDf(); + this._elementGroup = base.getElementGroup(); + this._extCpd = base.getExtCpd(); + this._indicator = base.getIndicator(); + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + this._lifecycleManagementScript = base.getLifecycleManagementScript(); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = base.getSwImageDesc(); + this._vdu = base.getVdu(); + this._version = base.getVersion(); + this._virtualComputeDesc = base.getVirtualComputeDesc(); + this._virtualStorageDesc = base.getVirtualStorageDesc(); + this._vnfmInfo = base.getVnfmInfo(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getId(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProvider(); + this._productName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductName(); + this._softwareVersion = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSoftwareVersion(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVersion(); + this._productInfoName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoName(); + this._productInfoDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoDescription(); + this._vnfmInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVnfmInfo(); + this._localizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLocalizationLanguage(); + this._defaultLocalizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDefaultLocalizationLanguage(); + this._vdu = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVdu(); + this._virtualComputeDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualComputeDesc(); + this._virtualStorageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualStorageDesc(); + this._swImageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSwImageDesc(); + this._intVirtualLinkDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIntVirtualLinkDesc(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getExtCpd(); + this._df = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDf(); + this._configurableProperties = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getConfigurableProperties(); + this._modifiableAttributes = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getModifiableAttributes(); + this._lifecycleManagementScript = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLifecycleManagementScript(); + this._elementGroup = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getElementGroup(); + this._indicator = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIndicator(); + this._autoScale = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getAutoScale(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd]"); + } + + public VnfdKey key() { + return key; + } + + public List getAutoScale() { + return _autoScale; + } + + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + public Map getDf() { + return _df; + } + + public Map getElementGroup() { + return _elementGroup; + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getId() { + return _id; + } + + public Map getIndicator() { + return _indicator; + } + + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + public String getProductInfoDescription() { + return _productInfoDescription; + } + + public String getProductInfoName() { + return _productInfoName; + } + + public String getProductName() { + return _productName; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getSoftwareVersion() { + return _softwareVersion; + } + + public Map getSwImageDesc() { + return _swImageDesc; + } + + public Map getVdu() { + return _vdu; + } + + public String getVersion() { + return _version; + } + + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + public List getVnfmInfo() { + return _vnfmInfo; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnfdBuilder withKey(final VnfdKey key) { + this.key = key; + return this; + } + public VnfdBuilder setAutoScale(final List values) { + this._autoScale = values; + return this; + } + + + public VnfdBuilder setConfigurableProperties(final ConfigurableProperties value) { + this._configurableProperties = value; + return this; + } + + public VnfdBuilder setDefaultLocalizationLanguage(final String value) { + this._defaultLocalizationLanguage = value; + return this; + } + public VnfdBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setElementGroup(final Map values) { + this._elementGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setElementGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setElementGroup(final List values) { + return setElementGroup(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setId(final String value) { + this._id = value; + return this; + } + public VnfdBuilder setIndicator(final Map values) { + this._indicator = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIndicator(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIndicator(final List values) { + return setIndicator(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setIntVirtualLinkDesc(final Map values) { + this._intVirtualLinkDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIntVirtualLinkDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIntVirtualLinkDesc(final List values) { + return setIntVirtualLinkDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setLifecycleManagementScript(final Map values) { + this._lifecycleManagementScript = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLifecycleManagementScript(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setLifecycleManagementScript(final List values) { + return setLifecycleManagementScript(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setLocalizationLanguage(final String value) { + this._localizationLanguage = value; + return this; + } + + public VnfdBuilder setModifiableAttributes(final ModifiableAttributes value) { + this._modifiableAttributes = value; + return this; + } + + public VnfdBuilder setProductInfoDescription(final String value) { + this._productInfoDescription = value; + return this; + } + + public VnfdBuilder setProductInfoName(final String value) { + this._productInfoName = value; + return this; + } + + public VnfdBuilder setProductName(final String value) { + this._productName = value; + return this; + } + + public VnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public VnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setSoftwareVersion(final String value) { + this._softwareVersion = value; + return this; + } + public VnfdBuilder setSwImageDesc(final Map values) { + this._swImageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSwImageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSwImageDesc(final List values) { + return setSwImageDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVdu(final Map values) { + this._vdu = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVdu(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVdu(final List values) { + return setVdu(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + public VnfdBuilder setVirtualComputeDesc(final Map values) { + this._virtualComputeDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualComputeDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualComputeDesc(final List values) { + return setVirtualComputeDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVirtualStorageDesc(final Map values) { + this._virtualStorageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualStorageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualStorageDesc(final List values) { + return setVirtualStorageDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVnfmInfo(final List values) { + this._vnfmInfo = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnfd build() { + return new VnfdImpl(this); + } + + private static final class VnfdImpl + extends AbstractAugmentable + implements Vnfd { + + private final List _autoScale; + private final ConfigurableProperties _configurableProperties; + private final String _defaultLocalizationLanguage; + private final Map _df; + private final Map _elementGroup; + private final Map _extCpd; + private final String _id; + private final Map _indicator; + private final Map _intVirtualLinkDesc; + private final Map _lifecycleManagementScript; + private final String _localizationLanguage; + private final ModifiableAttributes _modifiableAttributes; + private final String _productInfoDescription; + private final String _productInfoName; + private final String _productName; + private final String _provider; + private final Map _securityGroupRule; + private final String _softwareVersion; + private final Map _swImageDesc; + private final Map _vdu; + private final String _version; + private final Map _virtualComputeDesc; + private final Map _virtualStorageDesc; + private final List _vnfmInfo; + private final VnfdKey key; + + VnfdImpl(VnfdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VnfdKey(base.getId()); + } + this._id = key.getId(); + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._elementGroup = CodeHelpers.emptyToNull(base.getElementGroup()); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._indicator = CodeHelpers.emptyToNull(base.getIndicator()); + this._intVirtualLinkDesc = CodeHelpers.emptyToNull(base.getIntVirtualLinkDesc()); + this._lifecycleManagementScript = CodeHelpers.emptyToNull(base.getLifecycleManagementScript()); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = CodeHelpers.emptyToNull(base.getSwImageDesc()); + this._vdu = CodeHelpers.emptyToNull(base.getVdu()); + this._version = base.getVersion(); + this._virtualComputeDesc = CodeHelpers.emptyToNull(base.getVirtualComputeDesc()); + this._virtualStorageDesc = CodeHelpers.emptyToNull(base.getVirtualStorageDesc()); + this._vnfmInfo = base.getVnfmInfo(); + } + + @Override + public VnfdKey key() { + return key; + } + + @Override + public List getAutoScale() { + return _autoScale; + } + + @Override + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + @Override + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public Map getElementGroup() { + return _elementGroup; + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getIndicator() { + return _indicator; + } + + @Override + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + @Override + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + @Override + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + @Override + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + @Override + public String getProductInfoDescription() { + return _productInfoDescription; + } + + @Override + public String getProductInfoName() { + return _productInfoName; + } + + @Override + public String getProductName() { + return _productName; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getSoftwareVersion() { + return _softwareVersion; + } + + @Override + public Map getSwImageDesc() { + return _swImageDesc; + } + + @Override + public Map getVdu() { + return _vdu; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + @Override + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + @Override + public List getVnfmInfo() { + return _vnfmInfo; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_autoScale); + result = prime * result + Objects.hashCode(_configurableProperties); + result = prime * result + Objects.hashCode(_defaultLocalizationLanguage); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_elementGroup); + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_indicator); + result = prime * result + Objects.hashCode(_intVirtualLinkDesc); + result = prime * result + Objects.hashCode(_lifecycleManagementScript); + result = prime * result + Objects.hashCode(_localizationLanguage); + result = prime * result + Objects.hashCode(_modifiableAttributes); + result = prime * result + Objects.hashCode(_productInfoDescription); + result = prime * result + Objects.hashCode(_productInfoName); + result = prime * result + Objects.hashCode(_productName); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_softwareVersion); + result = prime * result + Objects.hashCode(_swImageDesc); + result = prime * result + Objects.hashCode(_vdu); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(_virtualComputeDesc); + result = prime * result + Objects.hashCode(_virtualStorageDesc); + result = prime * result + Objects.hashCode(_vnfmInfo); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnfd other = (Vnfd)obj; + if (!Objects.equals(_autoScale, other.getAutoScale())) { + return false; + } + if (!Objects.equals(_configurableProperties, other.getConfigurableProperties())) { + return false; + } + if (!Objects.equals(_defaultLocalizationLanguage, other.getDefaultLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_elementGroup, other.getElementGroup())) { + return false; + } + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_indicator, other.getIndicator())) { + return false; + } + if (!Objects.equals(_intVirtualLinkDesc, other.getIntVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_lifecycleManagementScript, other.getLifecycleManagementScript())) { + return false; + } + if (!Objects.equals(_localizationLanguage, other.getLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_modifiableAttributes, other.getModifiableAttributes())) { + return false; + } + if (!Objects.equals(_productInfoDescription, other.getProductInfoDescription())) { + return false; + } + if (!Objects.equals(_productInfoName, other.getProductInfoName())) { + return false; + } + if (!Objects.equals(_productName, other.getProductName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_softwareVersion, other.getSoftwareVersion())) { + return false; + } + if (!Objects.equals(_swImageDesc, other.getSwImageDesc())) { + return false; + } + if (!Objects.equals(_vdu, other.getVdu())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (!Objects.equals(_virtualComputeDesc, other.getVirtualComputeDesc())) { + return false; + } + if (!Objects.equals(_virtualStorageDesc, other.getVirtualStorageDesc())) { + return false; + } + if (!Objects.equals(_vnfmInfo, other.getVnfmInfo())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfdImpl otherImpl = (VnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnfd"); + CodeHelpers.appendValue(helper, "_autoScale", _autoScale); + CodeHelpers.appendValue(helper, "_configurableProperties", _configurableProperties); + CodeHelpers.appendValue(helper, "_defaultLocalizationLanguage", _defaultLocalizationLanguage); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_elementGroup", _elementGroup); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_indicator", _indicator); + CodeHelpers.appendValue(helper, "_intVirtualLinkDesc", _intVirtualLinkDesc); + CodeHelpers.appendValue(helper, "_lifecycleManagementScript", _lifecycleManagementScript); + CodeHelpers.appendValue(helper, "_localizationLanguage", _localizationLanguage); + CodeHelpers.appendValue(helper, "_modifiableAttributes", _modifiableAttributes); + CodeHelpers.appendValue(helper, "_productInfoDescription", _productInfoDescription); + CodeHelpers.appendValue(helper, "_productInfoName", _productInfoName); + CodeHelpers.appendValue(helper, "_productName", _productName); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_softwareVersion", _softwareVersion); + CodeHelpers.appendValue(helper, "_swImageDesc", _swImageDesc); + CodeHelpers.appendValue(helper, "_vdu", _vdu); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "_virtualComputeDesc", _virtualComputeDesc); + CodeHelpers.appendValue(helper, "_virtualStorageDesc", _virtualStorageDesc); + CodeHelpers.appendValue(helper, "_vnfmInfo", _vnfmInfo); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdKey.java new file mode 100644 index 0000000..8eb3321 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/nsd/rev190425/nsd/VnfdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VnfdKey + implements Identifier { + private static final long serialVersionUID = -7003982558180291733L; + private final String _id; + + + public VnfdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VnfdKey(VnfdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VnfdKey)) { + return false; + } + final VnfdKey other = (VnfdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VnfdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModelBindingProvider.java new file mode 100644 index 0000000..83ae268 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.pnfd.rev190425; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModuleInfoImpl.java new file mode 100644 index 0000000..a35aa7e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.pnfd.rev190425; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-pnfd", "2019-04-25", "etsi-nfv-pnfd").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-pnfd@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/EtsiNfvPnfdData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/EtsiNfvPnfdData.java new file mode 100644 index 0000000..49ceb40 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/EtsiNfvPnfdData.java @@ -0,0 +1,42 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.pnfd.rev190425; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataRoot; + +/** + * Physcial Network Function Descriptor. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-pnfd + *

+ * module etsi-nfv-pnfd {
+ *   yang-version 1.1;
+ *   namespace urn:etsi:nfv:yang:etsi-nfv-pnfd;
+ *   prefix pnfd;
+ *   import etsi-nfv-descriptors {
+ *     prefix vnf;
+ *   }
+ *   revision 2019-04-25 {
+ *   }
+ *   container pnfd {
+ *     presence "PNFD container.";
+ *     uses vnf:pnfd;
+ *   }
+ * }
+ * 
+ * + */ +public interface EtsiNfvPnfdData + extends + DataRoot +{ + + + + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.pnfd.rev190425.Pnfd pnfd, or null if not present + */ + @Nullable Pnfd getPnfd(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/Pnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/Pnfd.java new file mode 100644 index 0000000..4a3cd48 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/Pnfd.java @@ -0,0 +1,42 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.pnfd.rev190425; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-pnfd + *

+ * container pnfd {
+ *   presence "PNFD container.";
+ *   uses vnf:pnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-pnfd/pnfd + * + *

To create instances of this class use {@link PnfdBuilder}. + * @see PnfdBuilder + * + */ +public interface Pnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.pnfd.rev190425.Pnfd.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/PnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/PnfdBuilder.java new file mode 100644 index 0000000..b740621 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/pnfd/rev190425/PnfdBuilder.java @@ -0,0 +1,537 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.pnfd.rev190425; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.Security; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.SecurityKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfdBuilder + * @see Builder + * + */ +public class PnfdBuilder implements Builder { + + private Map _extCpd; + private String _functionDescription; + private String _geographicalLocationInfo; + private String _id; + private String _invariantId; + private String _name; + private String _provider; + private Map _security; + private Map _securityGroupRule; + private String _version; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfdBuilder() { + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd arg) { + this._id = arg.getId(); + this._functionDescription = arg.getFunctionDescription(); + this._provider = arg.getProvider(); + this._version = arg.getVersion(); + this._invariantId = arg.getInvariantId(); + this._name = arg.getName(); + this._extCpd = arg.getExtCpd(); + this._security = arg.getSecurity(); + this._geographicalLocationInfo = arg.getGeographicalLocationInfo(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public PnfdBuilder(Pnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._extCpd = base.getExtCpd(); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._id = base.getId(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = base.getSecurity(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._version = base.getVersion(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getId(); + this._functionDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getFunctionDescription(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getProvider(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getVersion(); + this._invariantId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getInvariantId(); + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getName(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getExtCpd(); + this._security = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getSecurity(); + this._geographicalLocationInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getGeographicalLocationInfo(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd]"); + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getFunctionDescription() { + return _functionDescription; + } + + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + public String getId() { + return _id; + } + + public String getInvariantId() { + return _invariantId; + } + + public String getName() { + return _name; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurity() { + return _security; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getVersion() { + return _version; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setFunctionDescription(final String value) { + this._functionDescription = value; + return this; + } + + public PnfdBuilder setGeographicalLocationInfo(final String value) { + this._geographicalLocationInfo = value; + return this; + } + + public PnfdBuilder setId(final String value) { + this._id = value; + return this; + } + + public PnfdBuilder setInvariantId(final String value) { + this._invariantId = value; + return this; + } + + public PnfdBuilder setName(final String value) { + this._name = value; + return this; + } + + public PnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public PnfdBuilder setSecurity(final Map values) { + this._security = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setSecurity(final List values) { + return setSecurity(CodeHelpers.compatMap(values)); + } + public PnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnfd build() { + return new PnfdImpl(this); + } + + private static final class PnfdImpl + extends AbstractAugmentable + implements Pnfd { + + private final Map _extCpd; + private final String _functionDescription; + private final String _geographicalLocationInfo; + private final String _id; + private final String _invariantId; + private final String _name; + private final String _provider; + private final Map _security; + private final Map _securityGroupRule; + private final String _version; + + PnfdImpl(PnfdBuilder base) { + super(base.augmentation); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._id = base.getId(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = CodeHelpers.emptyToNull(base.getSecurity()); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._version = base.getVersion(); + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getFunctionDescription() { + return _functionDescription; + } + + @Override + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInvariantId() { + return _invariantId; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurity() { + return _security; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getVersion() { + return _version; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_functionDescription); + result = prime * result + Objects.hashCode(_geographicalLocationInfo); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_invariantId); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_security); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnfd other = (Pnfd)obj; + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_functionDescription, other.getFunctionDescription())) { + return false; + } + if (!Objects.equals(_geographicalLocationInfo, other.getGeographicalLocationInfo())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_invariantId, other.getInvariantId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_security, other.getSecurity())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfdImpl otherImpl = (PnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnfd"); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_functionDescription", _functionDescription); + CodeHelpers.appendValue(helper, "_geographicalLocationInfo", _geographicalLocationInfo); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_invariantId", _invariantId); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_security", _security); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModelBindingProvider.java new file mode 100644 index 0000000..87070fd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModuleInfoImpl.java new file mode 100644 index 0000000..ce967fd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-vnfd", "2019-03-18", "etsi-nfv-vnfd").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-vnfd@2019-03-18.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/EtsiNfvVnfdData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/EtsiNfvVnfdData.java new file mode 100644 index 0000000..b4d6fc5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/EtsiNfvVnfdData.java @@ -0,0 +1,42 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataRoot; + +/** + * Virtual Network Function Descriptor. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-vnfd + *

+ * module etsi-nfv-vnfd {
+ *   yang-version 1.1;
+ *   namespace urn:etsi:nfv:yang:etsi-nfv-vnfd;
+ *   prefix vnfd;
+ *   import etsi-nfv-descriptors {
+ *     prefix vnf;
+ *   }
+ *   revision 2019-03-18 {
+ *   }
+ *   container vnfd {
+ *     presence "VNFD container.";
+ *     uses vnf:vnfd;
+ *   }
+ * }
+ * 
+ * + */ +public interface EtsiNfvVnfdData + extends + DataRoot +{ + + + + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.Vnfd vnfd, or null if not present + */ + @Nullable Vnfd getVnfd(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/Vnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/Vnfd.java new file mode 100644 index 0000000..d69acc8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/Vnfd.java @@ -0,0 +1,42 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-vnfd + *

+ * container vnfd {
+ *   presence "VNFD container.";
+ *   uses vnf:vnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-vnfd/vnfd + * + *

To create instances of this class use {@link VnfdBuilder}. + * @see VnfdBuilder + * + */ +public interface Vnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.Vnfd.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/VnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/VnfdBuilder.java new file mode 100644 index 0000000..f727dff --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/vnfd/rev190318/VnfdBuilder.java @@ -0,0 +1,1044 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfdBuilder + * @see Builder + * + */ +public class VnfdBuilder implements Builder { + + private List _autoScale; + private ConfigurableProperties _configurableProperties; + private String _defaultLocalizationLanguage; + private Map _df; + private Map _elementGroup; + private Map _extCpd; + private String _id; + private Map _indicator; + private Map _intVirtualLinkDesc; + private Map _lifecycleManagementScript; + private String _localizationLanguage; + private ModifiableAttributes _modifiableAttributes; + private String _productInfoDescription; + private String _productInfoName; + private String _productName; + private String _provider; + private Map _securityGroupRule; + private String _softwareVersion; + private Map _swImageDesc; + private Map _vdu; + private String _version; + private Map _virtualComputeDesc; + private Map _virtualStorageDesc; + private List _vnfmInfo; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfdBuilder() { + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd arg) { + this._id = arg.getId(); + this._provider = arg.getProvider(); + this._productName = arg.getProductName(); + this._softwareVersion = arg.getSoftwareVersion(); + this._version = arg.getVersion(); + this._productInfoName = arg.getProductInfoName(); + this._productInfoDescription = arg.getProductInfoDescription(); + this._vnfmInfo = arg.getVnfmInfo(); + this._localizationLanguage = arg.getLocalizationLanguage(); + this._defaultLocalizationLanguage = arg.getDefaultLocalizationLanguage(); + this._vdu = arg.getVdu(); + this._virtualComputeDesc = arg.getVirtualComputeDesc(); + this._virtualStorageDesc = arg.getVirtualStorageDesc(); + this._swImageDesc = arg.getSwImageDesc(); + this._intVirtualLinkDesc = arg.getIntVirtualLinkDesc(); + this._extCpd = arg.getExtCpd(); + this._df = arg.getDf(); + this._configurableProperties = arg.getConfigurableProperties(); + this._modifiableAttributes = arg.getModifiableAttributes(); + this._lifecycleManagementScript = arg.getLifecycleManagementScript(); + this._elementGroup = arg.getElementGroup(); + this._indicator = arg.getIndicator(); + this._autoScale = arg.getAutoScale(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public VnfdBuilder(Vnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = base.getDf(); + this._elementGroup = base.getElementGroup(); + this._extCpd = base.getExtCpd(); + this._id = base.getId(); + this._indicator = base.getIndicator(); + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + this._lifecycleManagementScript = base.getLifecycleManagementScript(); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = base.getSwImageDesc(); + this._vdu = base.getVdu(); + this._version = base.getVersion(); + this._virtualComputeDesc = base.getVirtualComputeDesc(); + this._virtualStorageDesc = base.getVirtualStorageDesc(); + this._vnfmInfo = base.getVnfmInfo(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getId(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProvider(); + this._productName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductName(); + this._softwareVersion = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSoftwareVersion(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVersion(); + this._productInfoName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoName(); + this._productInfoDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoDescription(); + this._vnfmInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVnfmInfo(); + this._localizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLocalizationLanguage(); + this._defaultLocalizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDefaultLocalizationLanguage(); + this._vdu = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVdu(); + this._virtualComputeDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualComputeDesc(); + this._virtualStorageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualStorageDesc(); + this._swImageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSwImageDesc(); + this._intVirtualLinkDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIntVirtualLinkDesc(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getExtCpd(); + this._df = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDf(); + this._configurableProperties = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getConfigurableProperties(); + this._modifiableAttributes = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getModifiableAttributes(); + this._lifecycleManagementScript = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLifecycleManagementScript(); + this._elementGroup = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getElementGroup(); + this._indicator = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIndicator(); + this._autoScale = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getAutoScale(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd]"); + } + + public List getAutoScale() { + return _autoScale; + } + + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + public Map getDf() { + return _df; + } + + public Map getElementGroup() { + return _elementGroup; + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getId() { + return _id; + } + + public Map getIndicator() { + return _indicator; + } + + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + public String getProductInfoDescription() { + return _productInfoDescription; + } + + public String getProductInfoName() { + return _productInfoName; + } + + public String getProductName() { + return _productName; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getSoftwareVersion() { + return _softwareVersion; + } + + public Map getSwImageDesc() { + return _swImageDesc; + } + + public Map getVdu() { + return _vdu; + } + + public String getVersion() { + return _version; + } + + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + public List getVnfmInfo() { + return _vnfmInfo; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnfdBuilder setAutoScale(final List values) { + this._autoScale = values; + return this; + } + + + public VnfdBuilder setConfigurableProperties(final ConfigurableProperties value) { + this._configurableProperties = value; + return this; + } + + public VnfdBuilder setDefaultLocalizationLanguage(final String value) { + this._defaultLocalizationLanguage = value; + return this; + } + public VnfdBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public VnfdBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setElementGroup(final Map values) { + this._elementGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setElementGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setElementGroup(final List values) { + return setElementGroup(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setId(final String value) { + this._id = value; + return this; + } + public VnfdBuilder setIndicator(final Map values) { + this._indicator = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIndicator(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIndicator(final List values) { + return setIndicator(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setIntVirtualLinkDesc(final Map values) { + this._intVirtualLinkDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIntVirtualLinkDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIntVirtualLinkDesc(final List values) { + return setIntVirtualLinkDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setLifecycleManagementScript(final Map values) { + this._lifecycleManagementScript = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLifecycleManagementScript(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public VnfdBuilder setLifecycleManagementScript(final List values) { + return setLifecycleManagementScript(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setLocalizationLanguage(final String value) { + this._localizationLanguage = value; + return this; + } + + public VnfdBuilder setModifiableAttributes(final ModifiableAttributes value) { + this._modifiableAttributes = value; + return this; + } + + public VnfdBuilder setProductInfoDescription(final String value) { + this._productInfoDescription = value; + return this; + } + + public VnfdBuilder setProductInfoName(final String value) { + this._productInfoName = value; + return this; + } + + public VnfdBuilder setProductName(final String value) { + this._productName = value; + return this; + } + + public VnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public VnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setSoftwareVersion(final String value) { + this._softwareVersion = value; + return this; + } + public VnfdBuilder setSwImageDesc(final Map values) { + this._swImageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSwImageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSwImageDesc(final List values) { + return setSwImageDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVdu(final Map values) { + this._vdu = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVdu(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVdu(final List values) { + return setVdu(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + public VnfdBuilder setVirtualComputeDesc(final Map values) { + this._virtualComputeDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualComputeDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualComputeDesc(final List values) { + return setVirtualComputeDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVirtualStorageDesc(final Map values) { + this._virtualStorageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualStorageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualStorageDesc(final List values) { + return setVirtualStorageDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVnfmInfo(final List values) { + this._vnfmInfo = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnfd build() { + return new VnfdImpl(this); + } + + private static final class VnfdImpl + extends AbstractAugmentable + implements Vnfd { + + private final List _autoScale; + private final ConfigurableProperties _configurableProperties; + private final String _defaultLocalizationLanguage; + private final Map _df; + private final Map _elementGroup; + private final Map _extCpd; + private final String _id; + private final Map _indicator; + private final Map _intVirtualLinkDesc; + private final Map _lifecycleManagementScript; + private final String _localizationLanguage; + private final ModifiableAttributes _modifiableAttributes; + private final String _productInfoDescription; + private final String _productInfoName; + private final String _productName; + private final String _provider; + private final Map _securityGroupRule; + private final String _softwareVersion; + private final Map _swImageDesc; + private final Map _vdu; + private final String _version; + private final Map _virtualComputeDesc; + private final Map _virtualStorageDesc; + private final List _vnfmInfo; + + VnfdImpl(VnfdBuilder base) { + super(base.augmentation); + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._elementGroup = CodeHelpers.emptyToNull(base.getElementGroup()); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._id = base.getId(); + this._indicator = CodeHelpers.emptyToNull(base.getIndicator()); + this._intVirtualLinkDesc = CodeHelpers.emptyToNull(base.getIntVirtualLinkDesc()); + this._lifecycleManagementScript = CodeHelpers.emptyToNull(base.getLifecycleManagementScript()); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = CodeHelpers.emptyToNull(base.getSwImageDesc()); + this._vdu = CodeHelpers.emptyToNull(base.getVdu()); + this._version = base.getVersion(); + this._virtualComputeDesc = CodeHelpers.emptyToNull(base.getVirtualComputeDesc()); + this._virtualStorageDesc = CodeHelpers.emptyToNull(base.getVirtualStorageDesc()); + this._vnfmInfo = base.getVnfmInfo(); + } + + @Override + public List getAutoScale() { + return _autoScale; + } + + @Override + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + @Override + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public Map getElementGroup() { + return _elementGroup; + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getIndicator() { + return _indicator; + } + + @Override + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + @Override + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + @Override + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + @Override + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + @Override + public String getProductInfoDescription() { + return _productInfoDescription; + } + + @Override + public String getProductInfoName() { + return _productInfoName; + } + + @Override + public String getProductName() { + return _productName; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getSoftwareVersion() { + return _softwareVersion; + } + + @Override + public Map getSwImageDesc() { + return _swImageDesc; + } + + @Override + public Map getVdu() { + return _vdu; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + @Override + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + @Override + public List getVnfmInfo() { + return _vnfmInfo; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_autoScale); + result = prime * result + Objects.hashCode(_configurableProperties); + result = prime * result + Objects.hashCode(_defaultLocalizationLanguage); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_elementGroup); + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_indicator); + result = prime * result + Objects.hashCode(_intVirtualLinkDesc); + result = prime * result + Objects.hashCode(_lifecycleManagementScript); + result = prime * result + Objects.hashCode(_localizationLanguage); + result = prime * result + Objects.hashCode(_modifiableAttributes); + result = prime * result + Objects.hashCode(_productInfoDescription); + result = prime * result + Objects.hashCode(_productInfoName); + result = prime * result + Objects.hashCode(_productName); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_softwareVersion); + result = prime * result + Objects.hashCode(_swImageDesc); + result = prime * result + Objects.hashCode(_vdu); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(_virtualComputeDesc); + result = prime * result + Objects.hashCode(_virtualStorageDesc); + result = prime * result + Objects.hashCode(_vnfmInfo); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnfd other = (Vnfd)obj; + if (!Objects.equals(_autoScale, other.getAutoScale())) { + return false; + } + if (!Objects.equals(_configurableProperties, other.getConfigurableProperties())) { + return false; + } + if (!Objects.equals(_defaultLocalizationLanguage, other.getDefaultLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_elementGroup, other.getElementGroup())) { + return false; + } + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_indicator, other.getIndicator())) { + return false; + } + if (!Objects.equals(_intVirtualLinkDesc, other.getIntVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_lifecycleManagementScript, other.getLifecycleManagementScript())) { + return false; + } + if (!Objects.equals(_localizationLanguage, other.getLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_modifiableAttributes, other.getModifiableAttributes())) { + return false; + } + if (!Objects.equals(_productInfoDescription, other.getProductInfoDescription())) { + return false; + } + if (!Objects.equals(_productInfoName, other.getProductInfoName())) { + return false; + } + if (!Objects.equals(_productName, other.getProductName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_softwareVersion, other.getSoftwareVersion())) { + return false; + } + if (!Objects.equals(_swImageDesc, other.getSwImageDesc())) { + return false; + } + if (!Objects.equals(_vdu, other.getVdu())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (!Objects.equals(_virtualComputeDesc, other.getVirtualComputeDesc())) { + return false; + } + if (!Objects.equals(_virtualStorageDesc, other.getVirtualStorageDesc())) { + return false; + } + if (!Objects.equals(_vnfmInfo, other.getVnfmInfo())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfdImpl otherImpl = (VnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnfd"); + CodeHelpers.appendValue(helper, "_autoScale", _autoScale); + CodeHelpers.appendValue(helper, "_configurableProperties", _configurableProperties); + CodeHelpers.appendValue(helper, "_defaultLocalizationLanguage", _defaultLocalizationLanguage); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_elementGroup", _elementGroup); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_indicator", _indicator); + CodeHelpers.appendValue(helper, "_intVirtualLinkDesc", _intVirtualLinkDesc); + CodeHelpers.appendValue(helper, "_lifecycleManagementScript", _lifecycleManagementScript); + CodeHelpers.appendValue(helper, "_localizationLanguage", _localizationLanguage); + CodeHelpers.appendValue(helper, "_modifiableAttributes", _modifiableAttributes); + CodeHelpers.appendValue(helper, "_productInfoDescription", _productInfoDescription); + CodeHelpers.appendValue(helper, "_productInfoName", _productInfoName); + CodeHelpers.appendValue(helper, "_productName", _productName); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_softwareVersion", _softwareVersion); + CodeHelpers.appendValue(helper, "_swImageDesc", _swImageDesc); + CodeHelpers.appendValue(helper, "_vdu", _vdu); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "_virtualComputeDesc", _virtualComputeDesc); + CodeHelpers.appendValue(helper, "_virtualStorageDesc", _virtualStorageDesc); + CodeHelpers.appendValue(helper, "_vnfmInfo", _vnfmInfo); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..92fc52f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..ba4c977 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:alternative-images", "alternative-images").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/alternative-images.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedAlternativeImages.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedAlternativeImages.java new file mode 100644 index 0000000..f9cc91b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedAlternativeImages.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module alternative-images + *

+ * grouping extended-alternative-images {
+ *   leaf-list alternative-sw-image-desc {
+ *     type leafref {
+ *       path /vnfd:vnfd/vnfd:sw-image-desc/vnfd:id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * alternative-images/extended-alternative-images + * + */ +public interface ExtendedAlternativeImages + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-alternative-images"); + + @Override + Class implementedInterface(); + + /** + * List of alternative images per VIM type. Different images can be used for + * specific types of VIMs instead of the default image. This allows deployments in + * sites where the image identifier in the VIM is given by the VIM provider and + * cannot be modified. If an alternative image is specified for a VIM type, it will + * prevail over the default image + * + * + * + * @return java.util.List alternativeSwImageDesc, or null if not present + */ + @Nullable List getAlternativeSwImageDesc(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedVimType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedVimType.java new file mode 100644 index 0000000..b066171 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/ExtendedVimType.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module alternative-images + *

+ * grouping extended-vim-type {
+ *   leaf vim-type {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * alternative-images/extended-vim-type + * + */ +public interface ExtendedVimType + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-vim-type"); + + @Override + Class implementedInterface(); + + /** + * VIM type: openvim, openstack, vmware, aws, etc. + * + * + * + * @return java.lang.String vimType, or null if not present + */ + @Nullable String getVimType(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1.java new file mode 100644 index 0000000..ddd36f4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface SwImageDesc1 + extends + Augmentation, + ExtendedVimType +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.SwImageDesc1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1Builder.java new file mode 100644 index 0000000..40c60dc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/SwImageDesc1Builder.java @@ -0,0 +1,157 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link SwImageDesc1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SwImageDesc1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SwImageDesc1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SwImageDesc1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SwImageDesc1Builder + * @see Builder + * + */ +public class SwImageDesc1Builder implements Builder { + + private String _vimType; + + + + public SwImageDesc1Builder() { + } + public SwImageDesc1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedVimType arg) { + this._vimType = arg.getVimType(); + } + + public SwImageDesc1Builder(SwImageDesc1 base) { + this._vimType = base.getVimType(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedVimType
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedVimType) { + this._vimType = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedVimType)arg).getVimType(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedVimType]"); + } + + public String getVimType() { + return _vimType; + } + + + public SwImageDesc1Builder setVimType(final String value) { + this._vimType = value; + return this; + } + + + @Override + public SwImageDesc1 build() { + return new SwImageDesc1Impl(this); + } + + private static final class SwImageDesc1Impl + implements SwImageDesc1 { + + private final String _vimType; + + SwImageDesc1Impl(SwImageDesc1Builder base) { + this._vimType = base.getVimType(); + } + + @Override + public String getVimType() { + return _vimType; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_vimType); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!SwImageDesc1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + SwImageDesc1 other = (SwImageDesc1)obj; + if (!Objects.equals(_vimType, other.getVimType())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("SwImageDesc1"); + CodeHelpers.appendValue(helper, "_vimType", _vimType); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1.java new file mode 100644 index 0000000..3cb39b7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface Vdu1 + extends + Augmentation, + ExtendedAlternativeImages +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.Vdu1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1Builder.java new file mode 100644 index 0000000..766f16a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/alternative/images/norev/Vdu1Builder.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Vdu1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Vdu1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Vdu1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Vdu1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Vdu1Builder + * @see Builder + * + */ +public class Vdu1Builder implements Builder { + + private List _alternativeSwImageDesc; + + + + public Vdu1Builder() { + } + public Vdu1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedAlternativeImages arg) { + this._alternativeSwImageDesc = arg.getAlternativeSwImageDesc(); + } + + public Vdu1Builder(Vdu1 base) { + this._alternativeSwImageDesc = base.getAlternativeSwImageDesc(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedAlternativeImages
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedAlternativeImages) { + this._alternativeSwImageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedAlternativeImages)arg).getAlternativeSwImageDesc(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.alternative.images.norev.ExtendedAlternativeImages]"); + } + + public List getAlternativeSwImageDesc() { + return _alternativeSwImageDesc; + } + + public Vdu1Builder setAlternativeSwImageDesc(final List values) { + this._alternativeSwImageDesc = values; + return this; + } + + + + @Override + public Vdu1 build() { + return new Vdu1Impl(this); + } + + private static final class Vdu1Impl + implements Vdu1 { + + private final List _alternativeSwImageDesc; + + Vdu1Impl(Vdu1Builder base) { + this._alternativeSwImageDesc = base.getAlternativeSwImageDesc(); + } + + @Override + public List getAlternativeSwImageDesc() { + return _alternativeSwImageDesc; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_alternativeSwImageDesc); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vdu1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vdu1 other = (Vdu1)obj; + if (!Objects.equals(_alternativeSwImageDesc, other.getAlternativeSwImageDesc())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vdu1"); + CodeHelpers.appendValue(helper, "_alternativeSwImageDesc", _alternativeSwImageDesc); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..539e7f4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..7eb83a0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/$YangModuleInfoImpl.java @@ -0,0 +1,49 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:interface", "interface").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/interface.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/ExtendedInterface.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/ExtendedInterface.java new file mode 100644 index 0000000..8f260cf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/ExtendedInterface.java @@ -0,0 +1,79 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VirtualInterface; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * List of Interfaces (external and internal) for the VNF + * + *

+ * This class represents the following YANG schema fragment defined in module interface + *

+ * grouping extended-interface {
+ *   leaf position {
+ *     type uint32;
+ *   }
+ *   leaf ip-address {
+ *     type inet:ip-address;
+ *   }
+ *   leaf mac-address {
+ *     type string;
+ *   }
+ *   uses common:virtual-interface;
+ * }
+ * 
The schema path to identify an instance is + * interface/extended-interface + * + */ +public interface ExtendedInterface + extends + DataObject, + VirtualInterface +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-interface"); + + @Override + Class implementedInterface(); + + /** + * Explicit Position of the interface within the list + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 position, or null if not present + */ + @Nullable Uint32 getPosition(); + + /** + * IP address of the internal connection point + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress ipAddress, or null if not present + */ + @Nullable IpAddress getIpAddress(); + + /** + * MAC address of the interface. Some VNFs require a specific MAC address to be + * configured in the interface. While this is not recommended at all in NFV + * environments, this parameter exists to allow those scenarios. This parameter + * will be likely deprecated in the future. + * + * + * + * @return java.lang.String macAddress, or null if not present + */ + @Nullable String getMacAddress(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1.java new file mode 100644 index 0000000..2475b67 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface VirtualNetworkInterfaceRequirement1 + extends + Augmentation, + ExtendedInterface +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.VirtualNetworkInterfaceRequirement1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1Builder.java new file mode 100644 index 0000000..0fe9367 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/_interface/norev/VirtualNetworkInterfaceRequirement1Builder.java @@ -0,0 +1,255 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev; +import com.google.common.base.MoreObjects; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.virtual._interface.VirtualInterface; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link VirtualNetworkInterfaceRequirement1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualNetworkInterfaceRequirement1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualNetworkInterfaceRequirement1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualNetworkInterfaceRequirement1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualNetworkInterfaceRequirement1Builder + * @see Builder + * + */ +public class VirtualNetworkInterfaceRequirement1Builder implements Builder { + + private IpAddress _ipAddress; + private String _macAddress; + private Uint32 _position; + private VirtualInterface _virtualInterface; + + + + public VirtualNetworkInterfaceRequirement1Builder() { + } + public VirtualNetworkInterfaceRequirement1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.ExtendedInterface arg) { + this._position = arg.getPosition(); + this._ipAddress = arg.getIpAddress(); + this._macAddress = arg.getMacAddress(); + this._virtualInterface = arg.getVirtualInterface(); + } + public VirtualNetworkInterfaceRequirement1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VirtualInterface arg) { + this._virtualInterface = arg.getVirtualInterface(); + } + + public VirtualNetworkInterfaceRequirement1Builder(VirtualNetworkInterfaceRequirement1 base) { + this._ipAddress = base.getIpAddress(); + this._macAddress = base.getMacAddress(); + this._position = base.getPosition(); + this._virtualInterface = base.getVirtualInterface(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VirtualInterface
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.ExtendedInterface
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VirtualInterface) { + this._virtualInterface = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VirtualInterface)arg).getVirtualInterface(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.ExtendedInterface) { + this._position = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.ExtendedInterface)arg).getPosition(); + this._ipAddress = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.ExtendedInterface)arg).getIpAddress(); + this._macAddress = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.ExtendedInterface)arg).getMacAddress(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VirtualInterface, org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments._interface.norev.ExtendedInterface]"); + } + + public IpAddress getIpAddress() { + return _ipAddress; + } + + public String getMacAddress() { + return _macAddress; + } + + public Uint32 getPosition() { + return _position; + } + + public VirtualInterface getVirtualInterface() { + return _virtualInterface; + } + + + public VirtualNetworkInterfaceRequirement1Builder setIpAddress(final IpAddress value) { + this._ipAddress = value; + return this; + } + + public VirtualNetworkInterfaceRequirement1Builder setMacAddress(final String value) { + this._macAddress = value; + return this; + } + + public VirtualNetworkInterfaceRequirement1Builder setPosition(final Uint32 value) { + this._position = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setPosition(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualNetworkInterfaceRequirement1Builder setPosition(final Long value) { + return setPosition(CodeHelpers.compatUint(value)); + } + + public VirtualNetworkInterfaceRequirement1Builder setVirtualInterface(final VirtualInterface value) { + this._virtualInterface = value; + return this; + } + + + @Override + public VirtualNetworkInterfaceRequirement1 build() { + return new VirtualNetworkInterfaceRequirement1Impl(this); + } + + private static final class VirtualNetworkInterfaceRequirement1Impl + implements VirtualNetworkInterfaceRequirement1 { + + private final IpAddress _ipAddress; + private final String _macAddress; + private final Uint32 _position; + private final VirtualInterface _virtualInterface; + + VirtualNetworkInterfaceRequirement1Impl(VirtualNetworkInterfaceRequirement1Builder base) { + this._ipAddress = base.getIpAddress(); + this._macAddress = base.getMacAddress(); + this._position = base.getPosition(); + this._virtualInterface = base.getVirtualInterface(); + } + + @Override + public IpAddress getIpAddress() { + return _ipAddress; + } + + @Override + public String getMacAddress() { + return _macAddress; + } + + @Override + public Uint32 getPosition() { + return _position; + } + + @Override + public VirtualInterface getVirtualInterface() { + return _virtualInterface; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_ipAddress); + result = prime * result + Objects.hashCode(_macAddress); + result = prime * result + Objects.hashCode(_position); + result = prime * result + Objects.hashCode(_virtualInterface); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualNetworkInterfaceRequirement1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualNetworkInterfaceRequirement1 other = (VirtualNetworkInterfaceRequirement1)obj; + if (!Objects.equals(_ipAddress, other.getIpAddress())) { + return false; + } + if (!Objects.equals(_macAddress, other.getMacAddress())) { + return false; + } + if (!Objects.equals(_position, other.getPosition())) { + return false; + } + if (!Objects.equals(_virtualInterface, other.getVirtualInterface())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualNetworkInterfaceRequirement1"); + CodeHelpers.appendValue(helper, "_ipAddress", _ipAddress); + CodeHelpers.appendValue(helper, "_macAddress", _macAddress); + CodeHelpers.appendValue(helper, "_position", _position); + CodeHelpers.appendValue(helper, "_virtualInterface", _virtualInterface); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..05c6552 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..0195d62 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/$YangModuleInfoImpl.java @@ -0,0 +1,48 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:additional-info", "additional-info").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/additional-info.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1.java new file mode 100644 index 0000000..01f3908 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1.java @@ -0,0 +1,23 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.virtual.link.profile.virtual.link.protocol.data.L3ProtocolData; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface L3ProtocolData1 + extends + Augmentation, + Description +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev.L3ProtocolData1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1Builder.java new file mode 100644 index 0000000..11d32ad --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/L3ProtocolData1Builder.java @@ -0,0 +1,157 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link L3ProtocolData1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L3ProtocolData1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L3ProtocolData1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L3ProtocolData1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L3ProtocolData1Builder + * @see Builder + * + */ +public class L3ProtocolData1Builder implements Builder { + + private String _description; + + + + public L3ProtocolData1Builder() { + } + public L3ProtocolData1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description arg) { + this._description = arg.getDescription(); + } + + public L3ProtocolData1Builder(L3ProtocolData1 base) { + this._description = base.getDescription(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description) { + this._description = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description)arg).getDescription(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description]"); + } + + public String getDescription() { + return _description; + } + + + public L3ProtocolData1Builder setDescription(final String value) { + this._description = value; + return this; + } + + + @Override + public L3ProtocolData1 build() { + return new L3ProtocolData1Impl(this); + } + + private static final class L3ProtocolData1Impl + implements L3ProtocolData1 { + + private final String _description; + + L3ProtocolData1Impl(L3ProtocolData1Builder base) { + this._description = base.getDescription(); + } + + @Override + public String getDescription() { + return _description; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L3ProtocolData1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L3ProtocolData1 other = (L3ProtocolData1)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L3ProtocolData1"); + CodeHelpers.appendValue(helper, "_description", _description); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1.java new file mode 100644 index 0000000..63c4491 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1.java @@ -0,0 +1,23 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface VirtualStorageDesc1 + extends + Augmentation, + Description +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev.VirtualStorageDesc1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1Builder.java new file mode 100644 index 0000000..825c58a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/VirtualStorageDesc1Builder.java @@ -0,0 +1,157 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualStorageDesc1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualStorageDesc1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualStorageDesc1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualStorageDesc1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualStorageDesc1Builder + * @see Builder + * + */ +public class VirtualStorageDesc1Builder implements Builder { + + private String _description; + + + + public VirtualStorageDesc1Builder() { + } + public VirtualStorageDesc1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description arg) { + this._description = arg.getDescription(); + } + + public VirtualStorageDesc1Builder(VirtualStorageDesc1 base) { + this._description = base.getDescription(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description) { + this._description = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description)arg).getDescription(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description]"); + } + + public String getDescription() { + return _description; + } + + + public VirtualStorageDesc1Builder setDescription(final String value) { + this._description = value; + return this; + } + + + @Override + public VirtualStorageDesc1 build() { + return new VirtualStorageDesc1Impl(this); + } + + private static final class VirtualStorageDesc1Impl + implements VirtualStorageDesc1 { + + private final String _description; + + VirtualStorageDesc1Impl(VirtualStorageDesc1Builder base) { + this._description = base.getDescription(); + } + + @Override + public String getDescription() { + return _description; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualStorageDesc1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualStorageDesc1 other = (VirtualStorageDesc1)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualStorageDesc1"); + CodeHelpers.appendValue(helper, "_description", _description); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1.java new file mode 100644 index 0000000..277b1c1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1.java @@ -0,0 +1,23 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface Vnfd1 + extends + Augmentation, + Description +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev.Vnfd1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1Builder.java new file mode 100644 index 0000000..bd13491 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/additional/info/norev/Vnfd1Builder.java @@ -0,0 +1,157 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.additional.info.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Vnfd1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Vnfd1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Vnfd1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Vnfd1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Vnfd1Builder + * @see Builder + * + */ +public class Vnfd1Builder implements Builder { + + private String _description; + + + + public Vnfd1Builder() { + } + public Vnfd1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description arg) { + this._description = arg.getDescription(); + } + + public Vnfd1Builder(Vnfd1 base) { + this._description = base.getDescription(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description) { + this._description = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description)arg).getDescription(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.Description]"); + } + + public String getDescription() { + return _description; + } + + + public Vnfd1Builder setDescription(final String value) { + this._description = value; + return this; + } + + + @Override + public Vnfd1 build() { + return new Vnfd1Impl(this); + } + + private static final class Vnfd1Impl + implements Vnfd1 { + + private final String _description; + + Vnfd1Impl(Vnfd1Builder base) { + this._description = base.getDescription(); + } + + @Override + public String getDescription() { + return _description; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnfd1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnfd1 other = (Vnfd1)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnfd1"); + CodeHelpers.appendValue(helper, "_description", _description); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..64b0114 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..9f5663f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/$YangModuleInfoImpl.java @@ -0,0 +1,48 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:alarm", "alarm").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/alarm.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/ExtendedAlarm.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/ExtendedAlarm.java new file mode 100644 index 0000000..62bd660 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/ExtendedAlarm.java @@ -0,0 +1,61 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm.Alarm; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm.AlarmKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module alarm + *

+ * grouping extended-alarm {
+ *   list alarm {
+ *     key alarm-id;
+ *     leaf alarm-id {
+ *       type string;
+ *     }
+ *     leaf vnf-monitoring-param-ref {
+ *       type leafref {
+ *         path /vnfd:vnfd/vnfd:df/vnfd:monitoring-parameter/vnfd:id;
+ *       }
+ *     }
+ *     uses common:alarm-properties;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * alarm/extended-alarm + * + */ +public interface ExtendedAlarm + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-alarm"); + + @Override + Class implementedInterface(); + + /** + * @return java.util.Map alarm, or null if not present + */ + @Nullable Map getAlarm(); + + /** + * @return java.util.Map alarm, or an empty list if it is not present + */ + default @NonNull Map nonnullAlarm() { + return CodeHelpers.nonnull(getAlarm()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1.java new file mode 100644 index 0000000..cda1b04 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface Vdu1 + extends + Augmentation, + ExtendedAlarm +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.Vdu1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1Builder.java new file mode 100644 index 0000000..72edd28 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/Vdu1Builder.java @@ -0,0 +1,179 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev; +import com.google.common.base.MoreObjects; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm.Alarm; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm.AlarmKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Vdu1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Vdu1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Vdu1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Vdu1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Vdu1Builder + * @see Builder + * + */ +public class Vdu1Builder implements Builder { + + private Map _alarm; + + + + public Vdu1Builder() { + } + public Vdu1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.ExtendedAlarm arg) { + this._alarm = arg.getAlarm(); + } + + public Vdu1Builder(Vdu1 base) { + this._alarm = base.getAlarm(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.ExtendedAlarm
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.ExtendedAlarm) { + this._alarm = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.ExtendedAlarm)arg).getAlarm(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.ExtendedAlarm]"); + } + + public Map getAlarm() { + return _alarm; + } + + public Vdu1Builder setAlarm(final Map values) { + this._alarm = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAlarm(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Vdu1Builder setAlarm(final List values) { + return setAlarm(CodeHelpers.compatMap(values)); + } + + + @Override + public Vdu1 build() { + return new Vdu1Impl(this); + } + + private static final class Vdu1Impl + implements Vdu1 { + + private final Map _alarm; + + Vdu1Impl(Vdu1Builder base) { + this._alarm = CodeHelpers.emptyToNull(base.getAlarm()); + } + + @Override + public Map getAlarm() { + return _alarm; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_alarm); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vdu1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vdu1 other = (Vdu1)obj; + if (!Objects.equals(_alarm, other.getAlarm())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vdu1"); + CodeHelpers.appendValue(helper, "_alarm", _alarm); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/Alarm.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/Alarm.java new file mode 100644 index 0000000..081de40 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/Alarm.java @@ -0,0 +1,79 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.ExtendedAlarm; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module alarm + *

+ * list alarm {
+ *   key alarm-id;
+ *   leaf alarm-id {
+ *     type string;
+ *   }
+ *   leaf vnf-monitoring-param-ref {
+ *     type leafref {
+ *       path /vnfd:vnfd/vnfd:df/vnfd:monitoring-parameter/vnfd:id;
+ *     }
+ *   }
+ *   uses common:alarm-properties;
+ * }
+ * 
The schema path to identify an instance is + * alarm/extended-alarm/alarm + * + *

To create instances of this class use {@link AlarmBuilder}. + * @see AlarmBuilder + * @see AlarmKey + * + */ +public interface Alarm + extends + ChildOf, + Augmentable, + AlarmProperties, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("alarm"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm.Alarm.class; + } + + /** + * This field is reserved for the identifier assigned by the VIM provider + * + * + * + * @return java.lang.String alarmId, or null if not present + */ + @Nullable String getAlarmId(); + + /** + * Reference to the VNF level monitoring parameter that is aggregated + * + * + * + * @return java.lang.String vnfMonitoringParamRef, or null if not present + */ + @Nullable String getVnfMonitoringParamRef(); + + @Override + AlarmKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmBuilder.java new file mode 100644 index 0000000..bc3d6ee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmBuilder.java @@ -0,0 +1,625 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigDecimal; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmSeverityType; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmStatisticType; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.RelationalOperationType; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.Actions; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link AlarmBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AlarmBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AlarmBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AlarmBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AlarmBuilder + * @see Builder + * + */ +public class AlarmBuilder implements Builder { + + private Actions _actions; + private String _alarmId; + private String _description; + private Uint32 _evaluations; + private String _name; + private RelationalOperationType _operation; + private Uint32 _period; + private AlarmSeverityType _severity; + private AlarmStatisticType _statistic; + private BigDecimal _value; + private String _vdurId; + private String _vnfMonitoringParamRef; + private Boolean _enabled; + private Boolean _repeat; + private AlarmKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AlarmBuilder() { + } + public AlarmBuilder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties arg) { + this._name = arg.getName(); + this._description = arg.getDescription(); + this._vdurId = arg.getVdurId(); + this._actions = arg.getActions(); + this._repeat = arg.isRepeat(); + this._enabled = arg.isEnabled(); + this._severity = arg.getSeverity(); + this._statistic = arg.getStatistic(); + this._operation = arg.getOperation(); + this._value = arg.getValue(); + this._period = arg.getPeriod(); + this._evaluations = arg.getEvaluations(); + } + + public AlarmBuilder(Alarm base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._alarmId = base.getAlarmId(); + this._actions = base.getActions(); + this._description = base.getDescription(); + this._evaluations = base.getEvaluations(); + this._name = base.getName(); + this._operation = base.getOperation(); + this._period = base.getPeriod(); + this._severity = base.getSeverity(); + this._statistic = base.getStatistic(); + this._value = base.getValue(); + this._vdurId = base.getVdurId(); + this._vnfMonitoringParamRef = base.getVnfMonitoringParamRef(); + this._enabled = base.isEnabled(); + this._repeat = base.isRepeat(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties) { + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getName(); + this._description = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getDescription(); + this._vdurId = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getVdurId(); + this._actions = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getActions(); + this._repeat = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).isRepeat(); + this._enabled = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).isEnabled(); + this._severity = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getSeverity(); + this._statistic = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getStatistic(); + this._operation = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getOperation(); + this._value = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getValue(); + this._period = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getPeriod(); + this._evaluations = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties)arg).getEvaluations(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties]"); + } + + public AlarmKey key() { + return key; + } + + public Actions getActions() { + return _actions; + } + + public String getAlarmId() { + return _alarmId; + } + + public String getDescription() { + return _description; + } + + public Uint32 getEvaluations() { + return _evaluations; + } + + public String getName() { + return _name; + } + + public RelationalOperationType getOperation() { + return _operation; + } + + public Uint32 getPeriod() { + return _period; + } + + public AlarmSeverityType getSeverity() { + return _severity; + } + + public AlarmStatisticType getStatistic() { + return _statistic; + } + + public BigDecimal getValue() { + return _value; + } + + public String getVdurId() { + return _vdurId; + } + + public String getVnfMonitoringParamRef() { + return _vnfMonitoringParamRef; + } + + public Boolean isEnabled() { + return _enabled; + } + + public Boolean isRepeat() { + return _repeat; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AlarmBuilder withKey(final AlarmKey key) { + this.key = key; + return this; + } + + public AlarmBuilder setActions(final Actions value) { + this._actions = value; + return this; + } + + public AlarmBuilder setAlarmId(final String value) { + this._alarmId = value; + return this; + } + + public AlarmBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public AlarmBuilder setEvaluations(final Uint32 value) { + this._evaluations = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setEvaluations(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public AlarmBuilder setEvaluations(final Long value) { + return setEvaluations(CodeHelpers.compatUint(value)); + } + + public AlarmBuilder setName(final String value) { + this._name = value; + return this; + } + + public AlarmBuilder setOperation(final RelationalOperationType value) { + this._operation = value; + return this; + } + + public AlarmBuilder setPeriod(final Uint32 value) { + this._period = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setPeriod(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public AlarmBuilder setPeriod(final Long value) { + return setPeriod(CodeHelpers.compatUint(value)); + } + + public AlarmBuilder setSeverity(final AlarmSeverityType value) { + this._severity = value; + return this; + } + + public AlarmBuilder setStatistic(final AlarmStatisticType value) { + this._statistic = value; + return this; + } + + + public AlarmBuilder setValue(final BigDecimal value) { + if (value != null) { + + } + this._value = value; + return this; + } + + public AlarmBuilder setVdurId(final String value) { + this._vdurId = value; + return this; + } + + public AlarmBuilder setVnfMonitoringParamRef(final String value) { + this._vnfMonitoringParamRef = value; + return this; + } + + public AlarmBuilder setEnabled(final Boolean value) { + this._enabled = value; + return this; + } + + public AlarmBuilder setRepeat(final Boolean value) { + this._repeat = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AlarmBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AlarmBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AlarmBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AlarmBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Alarm build() { + return new AlarmImpl(this); + } + + private static final class AlarmImpl + extends AbstractAugmentable + implements Alarm { + + private final Actions _actions; + private final String _alarmId; + private final String _description; + private final Uint32 _evaluations; + private final String _name; + private final RelationalOperationType _operation; + private final Uint32 _period; + private final AlarmSeverityType _severity; + private final AlarmStatisticType _statistic; + private final BigDecimal _value; + private final String _vdurId; + private final String _vnfMonitoringParamRef; + private final Boolean _enabled; + private final Boolean _repeat; + private final AlarmKey key; + + AlarmImpl(AlarmBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AlarmKey(base.getAlarmId()); + } + this._alarmId = key.getAlarmId(); + this._actions = base.getActions(); + this._description = base.getDescription(); + this._evaluations = base.getEvaluations(); + this._name = base.getName(); + this._operation = base.getOperation(); + this._period = base.getPeriod(); + this._severity = base.getSeverity(); + this._statistic = base.getStatistic(); + this._value = base.getValue(); + this._vdurId = base.getVdurId(); + this._vnfMonitoringParamRef = base.getVnfMonitoringParamRef(); + this._enabled = base.isEnabled(); + this._repeat = base.isRepeat(); + } + + @Override + public AlarmKey key() { + return key; + } + + @Override + public Actions getActions() { + return _actions; + } + + @Override + public String getAlarmId() { + return _alarmId; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public Uint32 getEvaluations() { + return _evaluations; + } + + @Override + public String getName() { + return _name; + } + + @Override + public RelationalOperationType getOperation() { + return _operation; + } + + @Override + public Uint32 getPeriod() { + return _period; + } + + @Override + public AlarmSeverityType getSeverity() { + return _severity; + } + + @Override + public AlarmStatisticType getStatistic() { + return _statistic; + } + + @Override + public BigDecimal getValue() { + return _value; + } + + @Override + public String getVdurId() { + return _vdurId; + } + + @Override + public String getVnfMonitoringParamRef() { + return _vnfMonitoringParamRef; + } + + @Override + public Boolean isEnabled() { + return _enabled; + } + + @Override + public Boolean isRepeat() { + return _repeat; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_actions); + result = prime * result + Objects.hashCode(_alarmId); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_evaluations); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_operation); + result = prime * result + Objects.hashCode(_period); + result = prime * result + Objects.hashCode(_severity); + result = prime * result + Objects.hashCode(_statistic); + result = prime * result + Objects.hashCode(_value); + result = prime * result + Objects.hashCode(_vdurId); + result = prime * result + Objects.hashCode(_vnfMonitoringParamRef); + result = prime * result + Objects.hashCode(_enabled); + result = prime * result + Objects.hashCode(_repeat); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Alarm.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Alarm other = (Alarm)obj; + if (!Objects.equals(_actions, other.getActions())) { + return false; + } + if (!Objects.equals(_alarmId, other.getAlarmId())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_evaluations, other.getEvaluations())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_operation, other.getOperation())) { + return false; + } + if (!Objects.equals(_period, other.getPeriod())) { + return false; + } + if (!Objects.equals(_severity, other.getSeverity())) { + return false; + } + if (!Objects.equals(_statistic, other.getStatistic())) { + return false; + } + if (!Objects.equals(_value, other.getValue())) { + return false; + } + if (!Objects.equals(_vdurId, other.getVdurId())) { + return false; + } + if (!Objects.equals(_vnfMonitoringParamRef, other.getVnfMonitoringParamRef())) { + return false; + } + if (!Objects.equals(_enabled, other.isEnabled())) { + return false; + } + if (!Objects.equals(_repeat, other.isRepeat())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AlarmImpl otherImpl = (AlarmImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Alarm"); + CodeHelpers.appendValue(helper, "_actions", _actions); + CodeHelpers.appendValue(helper, "_alarmId", _alarmId); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_evaluations", _evaluations); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_operation", _operation); + CodeHelpers.appendValue(helper, "_period", _period); + CodeHelpers.appendValue(helper, "_severity", _severity); + CodeHelpers.appendValue(helper, "_statistic", _statistic); + CodeHelpers.appendValue(helper, "_value", _value); + CodeHelpers.appendValue(helper, "_vdurId", _vdurId); + CodeHelpers.appendValue(helper, "_vnfMonitoringParamRef", _vnfMonitoringParamRef); + CodeHelpers.appendValue(helper, "_enabled", _enabled); + CodeHelpers.appendValue(helper, "_repeat", _repeat); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmKey.java new file mode 100644 index 0000000..b0e48e9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/alarm/norev/extended/alarm/AlarmKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.alarm.norev.extended.alarm; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AlarmKey + implements Identifier { + private static final long serialVersionUID = 6949511475175144069L; + private final String _alarmId; + + + public AlarmKey(String _alarmId) { + + this._alarmId = _alarmId; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AlarmKey(AlarmKey source) { + this._alarmId = source._alarmId; + } + + + public String getAlarmId() { + return _alarmId; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_alarmId); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AlarmKey)) { + return false; + } + final AlarmKey other = (AlarmKey) obj; + if (!Objects.equals(_alarmId, other._alarmId)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AlarmKey.class); + CodeHelpers.appendValue(helper, "_alarmId", _alarmId); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..c256d71 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..932f1f4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:cloud-init", "cloud-init").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/cloud-init.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/ExtendedCloudInit.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/ExtendedCloudInit.java new file mode 100644 index 0000000..7736e64 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/ExtendedCloudInit.java @@ -0,0 +1,56 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.CloudInitInput; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module cloud-init + *

+ * grouping extended-cloud-init {
+ *   choice cloud-init-input {
+ *     case inline {
+ *       leaf cloud-init {
+ *         type string;
+ *       }
+ *     }
+ *     case filename {
+ *       leaf cloud-init-file {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * cloud-init/extended-cloud-init + * + */ +public interface ExtendedCloudInit + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-cloud-init"); + + @Override + Class implementedInterface(); + + /** + * Indicates how the contents of cloud-init script are provided. There are 2 + * choices - inline or in a file + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.CloudInitInput cloudInitInput, or null if not present + */ + @Nullable CloudInitInput getCloudInitInput(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1.java new file mode 100644 index 0000000..d9d17a1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface Vdu1 + extends + Augmentation, + ExtendedCloudInit +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.Vdu1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1Builder.java new file mode 100644 index 0000000..ffd59a7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/Vdu1Builder.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.CloudInitInput; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Vdu1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Vdu1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Vdu1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Vdu1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Vdu1Builder + * @see Builder + * + */ +public class Vdu1Builder implements Builder { + + private CloudInitInput _cloudInitInput; + + + + public Vdu1Builder() { + } + public Vdu1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.ExtendedCloudInit arg) { + this._cloudInitInput = arg.getCloudInitInput(); + } + + public Vdu1Builder(Vdu1 base) { + this._cloudInitInput = base.getCloudInitInput(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.ExtendedCloudInit
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.ExtendedCloudInit) { + this._cloudInitInput = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.ExtendedCloudInit)arg).getCloudInitInput(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.ExtendedCloudInit]"); + } + + public CloudInitInput getCloudInitInput() { + return _cloudInitInput; + } + + + public Vdu1Builder setCloudInitInput(final CloudInitInput value) { + this._cloudInitInput = value; + return this; + } + + + @Override + public Vdu1 build() { + return new Vdu1Impl(this); + } + + private static final class Vdu1Impl + implements Vdu1 { + + private final CloudInitInput _cloudInitInput; + + Vdu1Impl(Vdu1Builder base) { + this._cloudInitInput = base.getCloudInitInput(); + } + + @Override + public CloudInitInput getCloudInitInput() { + return _cloudInitInput; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cloudInitInput); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vdu1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vdu1 other = (Vdu1)obj; + if (!Objects.equals(_cloudInitInput, other.getCloudInitInput())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vdu1"); + CodeHelpers.appendValue(helper, "_cloudInitInput", _cloudInitInput); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/CloudInitInput.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/CloudInitInput.java new file mode 100644 index 0000000..43b3232 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/CloudInitInput.java @@ -0,0 +1,42 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.ExtendedCloudInit; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Indicates how the contents of cloud-init script are provided. There are 2 + * choices - inline or in a file + * + *

+ * This class represents the following YANG schema fragment defined in module cloud-init + *

+ * choice cloud-init-input {
+ *   case inline {
+ *     leaf cloud-init {
+ *       type string;
+ *     }
+ *   }
+ *   case filename {
+ *     leaf cloud-init-file {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * cloud-init/extended-cloud-init/cloud-init-input + * + */ +public interface CloudInitInput + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cloud-init-input"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Filename.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Filename.java new file mode 100644 index 0000000..95bad0e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Filename.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.cloud.init.input; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.CloudInitInput; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module cloud-init + *

+ * case filename {
+ *   leaf cloud-init-file {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * cloud-init/extended-cloud-init/cloud-init-input/filename + * + */ +public interface Filename + extends + DataObject, + Augmentable, + CloudInitInput +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("filename"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.cloud.init.input.Filename.class; + } + + /** + * Name of file with contents of cloud-init script in cloud-config format + * + * + * + * @return java.lang.String cloudInitFile, or null if not present + */ + @Nullable String getCloudInitFile(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/FilenameBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/FilenameBuilder.java new file mode 100644 index 0000000..2cbeba2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/FilenameBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.cloud.init.input; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link FilenameBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     FilenameBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new FilenameBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of FilenameBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see FilenameBuilder + * @see Builder + * + */ +public class FilenameBuilder implements Builder { + + private String _cloudInitFile; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public FilenameBuilder() { + } + + public FilenameBuilder(Filename base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cloudInitFile = base.getCloudInitFile(); + } + + + public String getCloudInitFile() { + return _cloudInitFile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public FilenameBuilder setCloudInitFile(final String value) { + this._cloudInitFile = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public FilenameBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public FilenameBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public FilenameBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private FilenameBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Filename build() { + return new FilenameImpl(this); + } + + private static final class FilenameImpl + extends AbstractAugmentable + implements Filename { + + private final String _cloudInitFile; + + FilenameImpl(FilenameBuilder base) { + super(base.augmentation); + this._cloudInitFile = base.getCloudInitFile(); + } + + @Override + public String getCloudInitFile() { + return _cloudInitFile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cloudInitFile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Filename.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Filename other = (Filename)obj; + if (!Objects.equals(_cloudInitFile, other.getCloudInitFile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + FilenameImpl otherImpl = (FilenameImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Filename"); + CodeHelpers.appendValue(helper, "_cloudInitFile", _cloudInitFile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Inline.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Inline.java new file mode 100644 index 0000000..9de1352 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/Inline.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.cloud.init.input; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.CloudInitInput; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module cloud-init + *

+ * case inline {
+ *   leaf cloud-init {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * cloud-init/extended-cloud-init/cloud-init-input/inline + * + */ +public interface Inline + extends + DataObject, + Augmentable, + CloudInitInput +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("inline"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.cloud.init.input.Inline.class; + } + + /** + * Contents of cloud-init script, provided inline, in cloud-config format + * + * + * + * @return java.lang.String cloudInit, or null if not present + */ + @Nullable String getCloudInit(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/InlineBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/InlineBuilder.java new file mode 100644 index 0000000..622f614 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/cloud/init/norev/extended/cloud/init/cloud/init/input/InlineBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.cloud.init.norev.extended.cloud.init.cloud.init.input; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link InlineBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     InlineBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new InlineBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of InlineBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see InlineBuilder + * @see Builder + * + */ +public class InlineBuilder implements Builder { + + private String _cloudInit; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public InlineBuilder() { + } + + public InlineBuilder(Inline base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cloudInit = base.getCloudInit(); + } + + + public String getCloudInit() { + return _cloudInit; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public InlineBuilder setCloudInit(final String value) { + this._cloudInit = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public InlineBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public InlineBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public InlineBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private InlineBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Inline build() { + return new InlineImpl(this); + } + + private static final class InlineImpl + extends AbstractAugmentable + implements Inline { + + private final String _cloudInit; + + InlineImpl(InlineBuilder base) { + super(base.augmentation); + this._cloudInit = base.getCloudInit(); + } + + @Override + public String getCloudInit() { + return _cloudInit; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cloudInit); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Inline.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Inline other = (Inline)obj; + if (!Objects.equals(_cloudInit, other.getCloudInit())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + InlineImpl otherImpl = (InlineImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Inline"); + CodeHelpers.appendValue(helper, "_cloudInit", _cloudInit); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..d894dc6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..500052c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/$YangModuleInfoImpl.java @@ -0,0 +1,48 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:day1-2", "day1-2").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/day1-2.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/ExtendedVnfConfiguration.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/ExtendedVnfConfiguration.java new file mode 100644 index 0000000..cb43a81 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/ExtendedVnfConfiguration.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration.Day12; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration.Day12Key; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module day1-2 + *

+ * grouping extended-vnf-configuration {
+ *   list day1-2 {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     uses common:vnfc-configuration;
+ *     uses common:vnfc-relations;
+ *     uses common:vdu-config-access;
+ *     leaf-list blacklist-config-primitive {
+ *       type enumeration {
+ *         enum upgrade;
+ *         enum rollback;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * day1-2/extended-vnf-configuration + * + */ +public interface ExtendedVnfConfiguration + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-vnf-configuration"); + + @Override + Class implementedInterface(); + + /** + * @return java.util.Map day12, or null if not present + */ + @Nullable Map getDay12(); + + /** + * @return java.util.Map day12, or an empty list if it is not present + */ + default @NonNull Map nonnullDay12() { + return CodeHelpers.nonnull(getDay12()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1.java new file mode 100644 index 0000000..32afdd0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.df.lcm.operations.configuration.OperateVnfOpConfig; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface OperateVnfOpConfig1 + extends + Augmentation, + ExtendedVnfConfiguration +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.OperateVnfOpConfig1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1Builder.java new file mode 100644 index 0000000..34c88b1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/OperateVnfOpConfig1Builder.java @@ -0,0 +1,179 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev; +import com.google.common.base.MoreObjects; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration.Day12; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration.Day12Key; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link OperateVnfOpConfig1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     OperateVnfOpConfig1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new OperateVnfOpConfig1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of OperateVnfOpConfig1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see OperateVnfOpConfig1Builder + * @see Builder + * + */ +public class OperateVnfOpConfig1Builder implements Builder { + + private Map _day12; + + + + public OperateVnfOpConfig1Builder() { + } + public OperateVnfOpConfig1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.ExtendedVnfConfiguration arg) { + this._day12 = arg.getDay12(); + } + + public OperateVnfOpConfig1Builder(OperateVnfOpConfig1 base) { + this._day12 = base.getDay12(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.ExtendedVnfConfiguration
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.ExtendedVnfConfiguration) { + this._day12 = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.ExtendedVnfConfiguration)arg).getDay12(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.ExtendedVnfConfiguration]"); + } + + public Map getDay12() { + return _day12; + } + + public OperateVnfOpConfig1Builder setDay12(final Map values) { + this._day12 = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDay12(Map)} instead. + */ + @Deprecated(forRemoval = true) + public OperateVnfOpConfig1Builder setDay12(final List values) { + return setDay12(CodeHelpers.compatMap(values)); + } + + + @Override + public OperateVnfOpConfig1 build() { + return new OperateVnfOpConfig1Impl(this); + } + + private static final class OperateVnfOpConfig1Impl + implements OperateVnfOpConfig1 { + + private final Map _day12; + + OperateVnfOpConfig1Impl(OperateVnfOpConfig1Builder base) { + this._day12 = CodeHelpers.emptyToNull(base.getDay12()); + } + + @Override + public Map getDay12() { + return _day12; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_day12); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!OperateVnfOpConfig1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + OperateVnfOpConfig1 other = (OperateVnfOpConfig1)obj; + if (!Objects.equals(_day12, other.getDay12())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("OperateVnfOpConfig1"); + CodeHelpers.appendValue(helper, "_day12", _day12); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12.java new file mode 100644 index 0000000..737990d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12.java @@ -0,0 +1,155 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.ExtendedVnfConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VduConfigAccess; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcRelations; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module day1-2 + *

+ * list day1-2 {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   uses common:vnfc-configuration;
+ *   uses common:vnfc-relations;
+ *   uses common:vdu-config-access;
+ *   leaf-list blacklist-config-primitive {
+ *     type enumeration {
+ *       enum upgrade;
+ *       enum rollback;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * day1-2/extended-vnf-configuration/day1-2 + * + *

To create instances of this class use {@link Day12Builder}. + * @see Day12Builder + * @see Day12Key + * + */ +public interface Day12 + extends + ChildOf, + Augmentable, + VnfcConfiguration, + VnfcRelations, + VduConfigAccess, + Identifiable +{ + + + public enum BlacklistConfigPrimitive implements Enumeration { + Upgrade(0, "upgrade"), + + Rollback(1, "rollback") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (BlacklistConfigPrimitive enumItem : BlacklistConfigPrimitive.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private BlacklistConfigPrimitive(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding BlacklistConfigPrimitive item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding BlacklistConfigPrimitive item, or null if no such item exists + */ + public static BlacklistConfigPrimitive forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("day1-2"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration.Day12.class; + } + + /** + * Internal identifier for the VNF/VDU/KNF/KDU configuration + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * List of blacklisted config primitives from the list of default kdu config + * primitives + * + * + * + * @return java.util.List blacklistConfigPrimitive, or null if not present + */ + @Nullable List getBlacklistConfigPrimitive(); + + @Override + Day12Key key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Builder.java new file mode 100644 index 0000000..5656116 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Builder.java @@ -0,0 +1,588 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.ConfigMethod; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vdu.config.access.ConfigAccess; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.ConfigPrimitive; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.ConfigPrimitiveKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.InitialConfigPrimitive; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.InitialConfigPrimitiveKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.TerminateConfigPrimitive; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.TerminateConfigPrimitiveKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.metrics.Metrics; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.metrics.MetricsKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.relations.Relation; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.relations.RelationKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Day12Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Day12Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Day12BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Day12Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Day12Builder + * @see Builder + * + */ +public class Day12Builder implements Builder { + + private List _blacklistConfigPrimitive; + private ConfigAccess _configAccess; + private ConfigMethod _configMethod; + private Map _configPrimitive; + private String _id; + private Map _initialConfigPrimitive; + private Map _metrics; + private Map _relation; + private Map _terminateConfigPrimitive; + private Day12Key key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public Day12Builder() { + } + public Day12Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration arg) { + this._configPrimitive = arg.getConfigPrimitive(); + this._initialConfigPrimitive = arg.getInitialConfigPrimitive(); + this._terminateConfigPrimitive = arg.getTerminateConfigPrimitive(); + this._configMethod = arg.getConfigMethod(); + this._metrics = arg.getMetrics(); + } + public Day12Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.ConfigurationMethod arg) { + this._configMethod = arg.getConfigMethod(); + } + public Day12Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcMetrics arg) { + this._metrics = arg.getMetrics(); + } + public Day12Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcRelations arg) { + this._relation = arg.getRelation(); + } + public Day12Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VduConfigAccess arg) { + this._configAccess = arg.getConfigAccess(); + } + + public Day12Builder(Day12 base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._blacklistConfigPrimitive = base.getBlacklistConfigPrimitive(); + this._configAccess = base.getConfigAccess(); + this._configMethod = base.getConfigMethod(); + this._configPrimitive = base.getConfigPrimitive(); + this._initialConfigPrimitive = base.getInitialConfigPrimitive(); + this._metrics = base.getMetrics(); + this._relation = base.getRelation(); + this._terminateConfigPrimitive = base.getTerminateConfigPrimitive(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcMetrics
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.ConfigurationMethod
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcRelations
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VduConfigAccess
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcMetrics) { + this._metrics = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcMetrics)arg).getMetrics(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.ConfigurationMethod) { + this._configMethod = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.ConfigurationMethod)arg).getConfigMethod(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcRelations) { + this._relation = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcRelations)arg).getRelation(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration) { + this._configPrimitive = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration)arg).getConfigPrimitive(); + this._initialConfigPrimitive = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration)arg).getInitialConfigPrimitive(); + this._terminateConfigPrimitive = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration)arg).getTerminateConfigPrimitive(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VduConfigAccess) { + this._configAccess = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VduConfigAccess)arg).getConfigAccess(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcMetrics, org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.ConfigurationMethod, org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcRelations, org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VnfcConfiguration, org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.VduConfigAccess]"); + } + + public Day12Key key() { + return key; + } + + public List getBlacklistConfigPrimitive() { + return _blacklistConfigPrimitive; + } + + public ConfigAccess getConfigAccess() { + return _configAccess; + } + + public ConfigMethod getConfigMethod() { + return _configMethod; + } + + public Map getConfigPrimitive() { + return _configPrimitive; + } + + public String getId() { + return _id; + } + + public Map getInitialConfigPrimitive() { + return _initialConfigPrimitive; + } + + public Map getMetrics() { + return _metrics; + } + + public Map getRelation() { + return _relation; + } + + public Map getTerminateConfigPrimitive() { + return _terminateConfigPrimitive; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public Day12Builder withKey(final Day12Key key) { + this.key = key; + return this; + } + public Day12Builder setBlacklistConfigPrimitive(final List values) { + this._blacklistConfigPrimitive = values; + return this; + } + + + public Day12Builder setConfigAccess(final ConfigAccess value) { + this._configAccess = value; + return this; + } + + public Day12Builder setConfigMethod(final ConfigMethod value) { + this._configMethod = value; + return this; + } + public Day12Builder setConfigPrimitive(final Map values) { + this._configPrimitive = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setConfigPrimitive(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Day12Builder setConfigPrimitive(final List values) { + return setConfigPrimitive(CodeHelpers.compatMap(values)); + } + + public Day12Builder setId(final String value) { + this._id = value; + return this; + } + public Day12Builder setInitialConfigPrimitive(final Map values) { + this._initialConfigPrimitive = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setInitialConfigPrimitive(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Day12Builder setInitialConfigPrimitive(final List values) { + return setInitialConfigPrimitive(CodeHelpers.compatMap(values)); + } + public Day12Builder setMetrics(final Map values) { + this._metrics = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setMetrics(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Day12Builder setMetrics(final List values) { + return setMetrics(CodeHelpers.compatMap(values)); + } + public Day12Builder setRelation(final Map values) { + this._relation = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setRelation(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Day12Builder setRelation(final List values) { + return setRelation(CodeHelpers.compatMap(values)); + } + public Day12Builder setTerminateConfigPrimitive(final Map values) { + this._terminateConfigPrimitive = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setTerminateConfigPrimitive(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Day12Builder setTerminateConfigPrimitive(final List values) { + return setTerminateConfigPrimitive(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public Day12Builder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public Day12Builder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public Day12Builder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private Day12Builder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Day12 build() { + return new Day12Impl(this); + } + + private static final class Day12Impl + extends AbstractAugmentable + implements Day12 { + + private final List _blacklistConfigPrimitive; + private final ConfigAccess _configAccess; + private final ConfigMethod _configMethod; + private final Map _configPrimitive; + private final String _id; + private final Map _initialConfigPrimitive; + private final Map _metrics; + private final Map _relation; + private final Map _terminateConfigPrimitive; + private final Day12Key key; + + Day12Impl(Day12Builder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new Day12Key(base.getId()); + } + this._id = key.getId(); + this._blacklistConfigPrimitive = base.getBlacklistConfigPrimitive(); + this._configAccess = base.getConfigAccess(); + this._configMethod = base.getConfigMethod(); + this._configPrimitive = CodeHelpers.emptyToNull(base.getConfigPrimitive()); + this._initialConfigPrimitive = CodeHelpers.emptyToNull(base.getInitialConfigPrimitive()); + this._metrics = CodeHelpers.emptyToNull(base.getMetrics()); + this._relation = CodeHelpers.emptyToNull(base.getRelation()); + this._terminateConfigPrimitive = CodeHelpers.emptyToNull(base.getTerminateConfigPrimitive()); + } + + @Override + public Day12Key key() { + return key; + } + + @Override + public List getBlacklistConfigPrimitive() { + return _blacklistConfigPrimitive; + } + + @Override + public ConfigAccess getConfigAccess() { + return _configAccess; + } + + @Override + public ConfigMethod getConfigMethod() { + return _configMethod; + } + + @Override + public Map getConfigPrimitive() { + return _configPrimitive; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getInitialConfigPrimitive() { + return _initialConfigPrimitive; + } + + @Override + public Map getMetrics() { + return _metrics; + } + + @Override + public Map getRelation() { + return _relation; + } + + @Override + public Map getTerminateConfigPrimitive() { + return _terminateConfigPrimitive; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_blacklistConfigPrimitive); + result = prime * result + Objects.hashCode(_configAccess); + result = prime * result + Objects.hashCode(_configMethod); + result = prime * result + Objects.hashCode(_configPrimitive); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_initialConfigPrimitive); + result = prime * result + Objects.hashCode(_metrics); + result = prime * result + Objects.hashCode(_relation); + result = prime * result + Objects.hashCode(_terminateConfigPrimitive); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Day12.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Day12 other = (Day12)obj; + if (!Objects.equals(_blacklistConfigPrimitive, other.getBlacklistConfigPrimitive())) { + return false; + } + if (!Objects.equals(_configAccess, other.getConfigAccess())) { + return false; + } + if (!Objects.equals(_configMethod, other.getConfigMethod())) { + return false; + } + if (!Objects.equals(_configPrimitive, other.getConfigPrimitive())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_initialConfigPrimitive, other.getInitialConfigPrimitive())) { + return false; + } + if (!Objects.equals(_metrics, other.getMetrics())) { + return false; + } + if (!Objects.equals(_relation, other.getRelation())) { + return false; + } + if (!Objects.equals(_terminateConfigPrimitive, other.getTerminateConfigPrimitive())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + Day12Impl otherImpl = (Day12Impl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Day12"); + CodeHelpers.appendValue(helper, "_blacklistConfigPrimitive", _blacklistConfigPrimitive); + CodeHelpers.appendValue(helper, "_configAccess", _configAccess); + CodeHelpers.appendValue(helper, "_configMethod", _configMethod); + CodeHelpers.appendValue(helper, "_configPrimitive", _configPrimitive); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_initialConfigPrimitive", _initialConfigPrimitive); + CodeHelpers.appendValue(helper, "_metrics", _metrics); + CodeHelpers.appendValue(helper, "_relation", _relation); + CodeHelpers.appendValue(helper, "_terminateConfigPrimitive", _terminateConfigPrimitive); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Key.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Key.java new file mode 100644 index 0000000..777c44e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/day1/_2/norev/extended/vnf/configuration/Day12Key.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.day1._2.norev.extended.vnf.configuration; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class Day12Key + implements Identifier { + private static final long serialVersionUID = 927482176980315623L; + private final String _id; + + + public Day12Key(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public Day12Key(Day12Key source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof Day12Key)) { + return false; + } + final Day12Key other = (Day12Key) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(Day12Key.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..cd070c7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..4ac719b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:epa", "epa").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/epa.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/AllocationProperties.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/AllocationProperties.java new file mode 100644 index 0000000..fb1d48e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/AllocationProperties.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping allocation-properties {
+ *   leaf limit {
+ *     type uint64;
+ *   }
+ *   leaf reserve {
+ *     type uint64;
+ *   }
+ *   leaf shares {
+ *     type uint64;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/allocation-properties + * + */ +public interface AllocationProperties + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("allocation-properties"); + + @Override + Class implementedInterface(); + + /** + * Defines the maximum allocation. The value 0 indicates that usage is not limited. + * This parameter ensures that the instance never uses more than the defined amount + * of resource. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 limit, or null if not present + */ + @Nullable Uint64 getLimit(); + + /** + * Defines the guaranteed minimum reservation. If needed, the machine will + * definitely get allocated the reserved amount of resources. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 reserve, or null if not present + */ + @Nullable Uint64 getReserve(); + + /** + * Number of shares allocated. Specifies the proportional weighted share for the + * domain. If this element is omitted, the service defaults to the OS provided + * defaults + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 shares, or null if not present + */ + @Nullable Uint64 getShares(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuPolicy.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuPolicy.java new file mode 100644 index 0000000..3699d34 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuPolicy.java @@ -0,0 +1,127 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping extended-cpu-policy {
+ *   leaf thread-policy {
+ *     type enumeration {
+ *       enum AVOID;
+ *       enum SEPARATE;
+ *       enum ISOLATE;
+ *       enum PREFER;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-cpu-policy + * + */ +public interface ExtendedCpuPolicy + extends + DataObject +{ + + + public enum ThreadPolicy implements Enumeration { + AVOID(0, "AVOID"), + + SEPARATE(1, "SEPARATE"), + + ISOLATE(2, "ISOLATE"), + + PREFER(3, "PREFER") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (ThreadPolicy enumItem : ThreadPolicy.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private ThreadPolicy(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding ThreadPolicy item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding ThreadPolicy item, or null if no such item exists + */ + public static ThreadPolicy forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-cpu-policy"); + + @Override + Class implementedInterface(); + + /** + * CPU thread pinning policy describes how to place the guest CPUs when the host + * supports hyper threads: AVOID : Avoids placing a guest on a host with threads. + * SEPARATE: Places vCPUs on separate cores, and avoids placing two vCPUs on two + * threads of same core. ISOLATE : Places each vCPU on a different core, and places + * no vCPUs from a different guest on the same core. PREFER : Attempts to place + * vCPUs on threads of the same core. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuPolicy.ThreadPolicy threadPolicy, or null if not present + */ + @Nullable ThreadPolicy getThreadPolicy(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuQuota.java new file mode 100644 index 0000000..8195777 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedCpuQuota.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.cpu.quota.CpuQuota; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping extended-cpu-quota {
+ *   container cpu-quota {
+ *     uses allocation-properties;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-cpu-quota + * + */ +public interface ExtendedCpuQuota + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-cpu-quota"); + + @Override + Class implementedInterface(); + + /** + * CPU quota describes the CPU resource allocation policy. Limit and Reserve values + * are defined in MHz + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.cpu.quota.CpuQuota cpuQuota, or null if not present + */ + @Nullable CpuQuota getCpuQuota(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedDiskIoQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedDiskIoQuota.java new file mode 100644 index 0000000..8921e40 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedDiskIoQuota.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.disk.io.quota.DiskIoQuota; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping extended-disk-io-quota {
+ *   container disk-io-quota {
+ *     uses allocation-properties;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-disk-io-quota + * + */ +public interface ExtendedDiskIoQuota + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-disk-io-quota"); + + @Override + Class implementedInterface(); + + /** + * Disk IO quota describes the disk IO operations resource allocation policy. Limit + * and Reserve values are defined in IOPS + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.disk.io.quota.DiskIoQuota diskIoQuota, or null if not present + */ + @Nullable DiskIoQuota getDiskIoQuota(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMemQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMemQuota.java new file mode 100644 index 0000000..f7d39a7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMemQuota.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.mem.quota.MemQuota; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping extended-mem-quota {
+ *   container mem-quota {
+ *     uses allocation-properties;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-mem-quota + * + */ +public interface ExtendedMemQuota + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-mem-quota"); + + @Override + Class implementedInterface(); + + /** + * Memory quota describes the memory resource allocation policy. Limit and Reserve + * values are defined in MB + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.mem.quota.MemQuota memQuota, or null if not present + */ + @Nullable MemQuota getMemQuota(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMempageSize.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMempageSize.java new file mode 100644 index 0000000..56a01e9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedMempageSize.java @@ -0,0 +1,129 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping extended-mempage-size {
+ *   leaf mempage-size {
+ *     type enumeration {
+ *       enum LARGE;
+ *       enum SMALL;
+ *       enum SIZE_2MB;
+ *       enum SIZE_1GB;
+ *       enum PREFER_LARGE;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-mempage-size + * + */ +public interface ExtendedMempageSize + extends + DataObject +{ + + + public enum MempageSize implements Enumeration { + LARGE(0, "LARGE"), + + SMALL(1, "SMALL"), + + SIZE2MB(2, "SIZE_2MB"), + + SIZE1GB(3, "SIZE_1GB"), + + PREFERLARGE(4, "PREFER_LARGE") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (MempageSize enumItem : MempageSize.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private MempageSize(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding MempageSize item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding MempageSize item, or null if no such item exists + */ + public static MempageSize forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-mempage-size"); + + @Override + Class implementedInterface(); + + /** + * Memory page allocation size. If a VM requires hugepages, it should choose LARGE + * or SIZE_2MB or SIZE_1GB. If the VM prefers hugepages it should choose + * PREFER_LARGE. LARGE : Require hugepages (either 2MB or 1GB) SMALL : Doesn't + * require hugepages SIZE_2MB : Requires 2MB hugepages SIZE_1GB : Requires 1GB + * hugepages PREFER_LARGE : Application prefers hugepages + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMempageSize.MempageSize mempageSize, or null if not present + */ + @Nullable MempageSize getMempageSize(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedNuma.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedNuma.java new file mode 100644 index 0000000..f727276 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedNuma.java @@ -0,0 +1,103 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.NumaNodePolicy; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping extended-numa {
+ *   container numa-node-policy {
+ *     leaf node-cnt {
+ *       type uint16;
+ *     }
+ *     leaf mem-policy {
+ *       type enumeration {
+ *         enum STRICT;
+ *         enum PREFERRED;
+ *       }
+ *     }
+ *     list node {
+ *       key id;
+ *       leaf id {
+ *         type uint64;
+ *       }
+ *       list vcpu {
+ *         key id;
+ *         leaf id {
+ *           type uint64;
+ *         }
+ *       }
+ *       leaf memory-mb {
+ *         type uint64;
+ *       }
+ *       choice om-numa-type {
+ *         case cores {
+ *           leaf num-cores {
+ *             type uint8;
+ *           }
+ *         }
+ *         case paired-threads {
+ *           container paired-threads {
+ *             leaf num-paired-threads {
+ *               type uint8;
+ *             }
+ *             list paired-thread-ids {
+ *               max-elements 16;
+ *               key thread-a;
+ *               leaf thread-a {
+ *                 type uint8;
+ *               }
+ *               leaf thread-b {
+ *                 type uint8;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case threads {
+ *           leaf num-threads {
+ *             type uint8;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa + * + */ +public interface ExtendedNuma + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-numa"); + + @Override + Class implementedInterface(); + + /** + * This policy defines NUMA topology of the guest. Specifically identifies if the + * guest should be run on a host with one NUMA node or multiple NUMA nodes. As an + * example a guest might need 8 VCPUs and 4 GB of memory. However, it might need + * the VCPUs and memory distributed across multiple NUMA nodes. In this scenario, + * NUMA node 1 could run with 6 VCPUs and 3GB, and NUMA node 2 could run with 2 + * VCPUs and 1GB. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.NumaNodePolicy numaNodePolicy, or null if not present + */ + @Nullable NumaNodePolicy getNumaNodePolicy(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedVifQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedVifQuota.java new file mode 100644 index 0000000..dff2724 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/ExtendedVifQuota.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.vif.quota.VifQuota; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * grouping extended-vif-quota {
+ *   container vif-quota {
+ *     uses allocation-properties;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-vif-quota + * + */ +public interface ExtendedVifQuota + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-vif-quota"); + + @Override + Class implementedInterface(); + + /** + * Virtual interfaces quota describes the virtual interface bandwidth resource + * allocation policy. Limit and Reserve values are defined in Mbps + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.vif.quota.VifQuota vifQuota, or null if not present + */ + @Nullable VifQuota getVifQuota(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1.java new file mode 100644 index 0000000..0f574da --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.virtual.cpu.Pinning; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface Pinning1 + extends + Augmentation, + ExtendedCpuPolicy +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.Pinning1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1Builder.java new file mode 100644 index 0000000..75fe7e5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/Pinning1Builder.java @@ -0,0 +1,157 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Pinning1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Pinning1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Pinning1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Pinning1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Pinning1Builder + * @see Builder + * + */ +public class Pinning1Builder implements Builder { + + private ExtendedCpuPolicy.ThreadPolicy _threadPolicy; + + + + public Pinning1Builder() { + } + public Pinning1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuPolicy arg) { + this._threadPolicy = arg.getThreadPolicy(); + } + + public Pinning1Builder(Pinning1 base) { + this._threadPolicy = base.getThreadPolicy(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuPolicy
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuPolicy) { + this._threadPolicy = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuPolicy)arg).getThreadPolicy(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuPolicy]"); + } + + public ExtendedCpuPolicy.ThreadPolicy getThreadPolicy() { + return _threadPolicy; + } + + + public Pinning1Builder setThreadPolicy(final ExtendedCpuPolicy.ThreadPolicy value) { + this._threadPolicy = value; + return this; + } + + + @Override + public Pinning1 build() { + return new Pinning1Impl(this); + } + + private static final class Pinning1Impl + implements Pinning1 { + + private final ExtendedCpuPolicy.ThreadPolicy _threadPolicy; + + Pinning1Impl(Pinning1Builder base) { + this._threadPolicy = base.getThreadPolicy(); + } + + @Override + public ExtendedCpuPolicy.ThreadPolicy getThreadPolicy() { + return _threadPolicy; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_threadPolicy); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pinning1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pinning1 other = (Pinning1)obj; + if (!Objects.equals(_threadPolicy, other.getThreadPolicy())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pinning1"); + CodeHelpers.appendValue(helper, "_threadPolicy", _threadPolicy); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1.java new file mode 100644 index 0000000..3578e17 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualCpu; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface VirtualCpu1 + extends + Augmentation, + ExtendedCpuQuota +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.VirtualCpu1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1Builder.java new file mode 100644 index 0000000..50a6ee4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualCpu1Builder.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.cpu.quota.CpuQuota; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualCpu1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualCpu1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualCpu1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualCpu1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualCpu1Builder + * @see Builder + * + */ +public class VirtualCpu1Builder implements Builder { + + private CpuQuota _cpuQuota; + + + + public VirtualCpu1Builder() { + } + public VirtualCpu1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuQuota arg) { + this._cpuQuota = arg.getCpuQuota(); + } + + public VirtualCpu1Builder(VirtualCpu1 base) { + this._cpuQuota = base.getCpuQuota(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuQuota
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuQuota) { + this._cpuQuota = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuQuota)arg).getCpuQuota(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuQuota]"); + } + + public CpuQuota getCpuQuota() { + return _cpuQuota; + } + + + public VirtualCpu1Builder setCpuQuota(final CpuQuota value) { + this._cpuQuota = value; + return this; + } + + + @Override + public VirtualCpu1 build() { + return new VirtualCpu1Impl(this); + } + + private static final class VirtualCpu1Impl + implements VirtualCpu1 { + + private final CpuQuota _cpuQuota; + + VirtualCpu1Impl(VirtualCpu1Builder base) { + this._cpuQuota = base.getCpuQuota(); + } + + @Override + public CpuQuota getCpuQuota() { + return _cpuQuota; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpuQuota); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualCpu1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualCpu1 other = (VirtualCpu1)obj; + if (!Objects.equals(_cpuQuota, other.getCpuQuota())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualCpu1"); + CodeHelpers.appendValue(helper, "_cpuQuota", _cpuQuota); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1.java new file mode 100644 index 0000000..175e83c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1.java @@ -0,0 +1,24 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.virtual.compute.desc.VirtualMemory; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface VirtualMemory1 + extends + Augmentation, + ExtendedNuma, + ExtendedMempageSize, + ExtendedMemQuota +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.VirtualMemory1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1Builder.java new file mode 100644 index 0000000..0104cc6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualMemory1Builder.java @@ -0,0 +1,221 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.mem.quota.MemQuota; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.NumaNodePolicy; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualMemory1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualMemory1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualMemory1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualMemory1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualMemory1Builder + * @see Builder + * + */ +public class VirtualMemory1Builder implements Builder { + + private MemQuota _memQuota; + private ExtendedMempageSize.MempageSize _mempageSize; + private NumaNodePolicy _numaNodePolicy; + + + + public VirtualMemory1Builder() { + } + public VirtualMemory1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedNuma arg) { + this._numaNodePolicy = arg.getNumaNodePolicy(); + } + public VirtualMemory1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMempageSize arg) { + this._mempageSize = arg.getMempageSize(); + } + public VirtualMemory1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMemQuota arg) { + this._memQuota = arg.getMemQuota(); + } + + public VirtualMemory1Builder(VirtualMemory1 base) { + this._memQuota = base.getMemQuota(); + this._mempageSize = base.getMempageSize(); + this._numaNodePolicy = base.getNumaNodePolicy(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedNuma
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMempageSize
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMemQuota
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedNuma) { + this._numaNodePolicy = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedNuma)arg).getNumaNodePolicy(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMempageSize) { + this._mempageSize = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMempageSize)arg).getMempageSize(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMemQuota) { + this._memQuota = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMemQuota)arg).getMemQuota(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedNuma, org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMempageSize, org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMemQuota]"); + } + + public MemQuota getMemQuota() { + return _memQuota; + } + + public ExtendedMempageSize.MempageSize getMempageSize() { + return _mempageSize; + } + + public NumaNodePolicy getNumaNodePolicy() { + return _numaNodePolicy; + } + + + public VirtualMemory1Builder setMemQuota(final MemQuota value) { + this._memQuota = value; + return this; + } + + public VirtualMemory1Builder setMempageSize(final ExtendedMempageSize.MempageSize value) { + this._mempageSize = value; + return this; + } + + public VirtualMemory1Builder setNumaNodePolicy(final NumaNodePolicy value) { + this._numaNodePolicy = value; + return this; + } + + + @Override + public VirtualMemory1 build() { + return new VirtualMemory1Impl(this); + } + + private static final class VirtualMemory1Impl + implements VirtualMemory1 { + + private final MemQuota _memQuota; + private final ExtendedMempageSize.MempageSize _mempageSize; + private final NumaNodePolicy _numaNodePolicy; + + VirtualMemory1Impl(VirtualMemory1Builder base) { + this._memQuota = base.getMemQuota(); + this._mempageSize = base.getMempageSize(); + this._numaNodePolicy = base.getNumaNodePolicy(); + } + + @Override + public MemQuota getMemQuota() { + return _memQuota; + } + + @Override + public ExtendedMempageSize.MempageSize getMempageSize() { + return _mempageSize; + } + + @Override + public NumaNodePolicy getNumaNodePolicy() { + return _numaNodePolicy; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_memQuota); + result = prime * result + Objects.hashCode(_mempageSize); + result = prime * result + Objects.hashCode(_numaNodePolicy); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualMemory1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualMemory1 other = (VirtualMemory1)obj; + if (!Objects.equals(_memQuota, other.getMemQuota())) { + return false; + } + if (!Objects.equals(_mempageSize, other.getMempageSize())) { + return false; + } + if (!Objects.equals(_numaNodePolicy, other.getNumaNodePolicy())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualMemory1"); + CodeHelpers.appendValue(helper, "_memQuota", _memQuota); + CodeHelpers.appendValue(helper, "_mempageSize", _mempageSize); + CodeHelpers.appendValue(helper, "_numaNodePolicy", _numaNodePolicy); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1.java new file mode 100644 index 0000000..6095aed --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface VirtualNetworkInterfaceRequirement1 + extends + Augmentation, + ExtendedVifQuota +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.VirtualNetworkInterfaceRequirement1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1Builder.java new file mode 100644 index 0000000..4bf35af --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualNetworkInterfaceRequirement1Builder.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.vif.quota.VifQuota; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualNetworkInterfaceRequirement1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualNetworkInterfaceRequirement1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualNetworkInterfaceRequirement1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualNetworkInterfaceRequirement1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualNetworkInterfaceRequirement1Builder + * @see Builder + * + */ +public class VirtualNetworkInterfaceRequirement1Builder implements Builder { + + private VifQuota _vifQuota; + + + + public VirtualNetworkInterfaceRequirement1Builder() { + } + public VirtualNetworkInterfaceRequirement1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedVifQuota arg) { + this._vifQuota = arg.getVifQuota(); + } + + public VirtualNetworkInterfaceRequirement1Builder(VirtualNetworkInterfaceRequirement1 base) { + this._vifQuota = base.getVifQuota(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedVifQuota
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedVifQuota) { + this._vifQuota = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedVifQuota)arg).getVifQuota(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedVifQuota]"); + } + + public VifQuota getVifQuota() { + return _vifQuota; + } + + + public VirtualNetworkInterfaceRequirement1Builder setVifQuota(final VifQuota value) { + this._vifQuota = value; + return this; + } + + + @Override + public VirtualNetworkInterfaceRequirement1 build() { + return new VirtualNetworkInterfaceRequirement1Impl(this); + } + + private static final class VirtualNetworkInterfaceRequirement1Impl + implements VirtualNetworkInterfaceRequirement1 { + + private final VifQuota _vifQuota; + + VirtualNetworkInterfaceRequirement1Impl(VirtualNetworkInterfaceRequirement1Builder base) { + this._vifQuota = base.getVifQuota(); + } + + @Override + public VifQuota getVifQuota() { + return _vifQuota; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_vifQuota); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualNetworkInterfaceRequirement1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualNetworkInterfaceRequirement1 other = (VirtualNetworkInterfaceRequirement1)obj; + if (!Objects.equals(_vifQuota, other.getVifQuota())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualNetworkInterfaceRequirement1"); + CodeHelpers.appendValue(helper, "_vifQuota", _vifQuota); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1.java new file mode 100644 index 0000000..fbb098a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface VirtualStorageDesc1 + extends + Augmentation, + ExtendedDiskIoQuota +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.VirtualStorageDesc1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1Builder.java new file mode 100644 index 0000000..52faa54 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/VirtualStorageDesc1Builder.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.disk.io.quota.DiskIoQuota; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualStorageDesc1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualStorageDesc1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualStorageDesc1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualStorageDesc1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualStorageDesc1Builder + * @see Builder + * + */ +public class VirtualStorageDesc1Builder implements Builder { + + private DiskIoQuota _diskIoQuota; + + + + public VirtualStorageDesc1Builder() { + } + public VirtualStorageDesc1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedDiskIoQuota arg) { + this._diskIoQuota = arg.getDiskIoQuota(); + } + + public VirtualStorageDesc1Builder(VirtualStorageDesc1 base) { + this._diskIoQuota = base.getDiskIoQuota(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedDiskIoQuota
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedDiskIoQuota) { + this._diskIoQuota = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedDiskIoQuota)arg).getDiskIoQuota(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedDiskIoQuota]"); + } + + public DiskIoQuota getDiskIoQuota() { + return _diskIoQuota; + } + + + public VirtualStorageDesc1Builder setDiskIoQuota(final DiskIoQuota value) { + this._diskIoQuota = value; + return this; + } + + + @Override + public VirtualStorageDesc1 build() { + return new VirtualStorageDesc1Impl(this); + } + + private static final class VirtualStorageDesc1Impl + implements VirtualStorageDesc1 { + + private final DiskIoQuota _diskIoQuota; + + VirtualStorageDesc1Impl(VirtualStorageDesc1Builder base) { + this._diskIoQuota = base.getDiskIoQuota(); + } + + @Override + public DiskIoQuota getDiskIoQuota() { + return _diskIoQuota; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_diskIoQuota); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualStorageDesc1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualStorageDesc1 other = (VirtualStorageDesc1)obj; + if (!Objects.equals(_diskIoQuota, other.getDiskIoQuota())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualStorageDesc1"); + CodeHelpers.appendValue(helper, "_diskIoQuota", _diskIoQuota); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuota.java new file mode 100644 index 0000000..dcf91ee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuota.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.cpu.quota; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedCpuQuota; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * CPU quota describes the CPU resource allocation policy. Limit and Reserve + * are defined in MHz + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * container cpu-quota {
+ *   uses allocation-properties;
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-cpu-quota/cpu-quota + * + *

To create instances of this class use {@link CpuQuotaBuilder}. + * @see CpuQuotaBuilder + * + */ +public interface CpuQuota + extends + ChildOf, + Augmentable, + AllocationProperties +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cpu-quota"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.cpu.quota.CpuQuota.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuotaBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuotaBuilder.java new file mode 100644 index 0000000..82f15fd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/cpu/quota/CpuQuotaBuilder.java @@ -0,0 +1,335 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.cpu.quota; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link CpuQuotaBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     CpuQuotaBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new CpuQuotaBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of CpuQuotaBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see CpuQuotaBuilder + * @see Builder + * + */ +public class CpuQuotaBuilder implements Builder { + + private Uint64 _limit; + private Uint64 _reserve; + private Uint64 _shares; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public CpuQuotaBuilder() { + } + public CpuQuotaBuilder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties arg) { + this._limit = arg.getLimit(); + this._reserve = arg.getReserve(); + this._shares = arg.getShares(); + } + + public CpuQuotaBuilder(CpuQuota base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties) { + this._limit = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getLimit(); + this._reserve = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getReserve(); + this._shares = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getShares(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties]"); + } + + public Uint64 getLimit() { + return _limit; + } + + public Uint64 getReserve() { + return _reserve; + } + + public Uint64 getShares() { + return _shares; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public CpuQuotaBuilder setLimit(final Uint64 value) { + this._limit = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLimit(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public CpuQuotaBuilder setLimit(final BigInteger value) { + return setLimit(CodeHelpers.compatUint(value)); + } + + public CpuQuotaBuilder setReserve(final Uint64 value) { + this._reserve = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setReserve(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public CpuQuotaBuilder setReserve(final BigInteger value) { + return setReserve(CodeHelpers.compatUint(value)); + } + + public CpuQuotaBuilder setShares(final Uint64 value) { + this._shares = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setShares(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public CpuQuotaBuilder setShares(final BigInteger value) { + return setShares(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public CpuQuotaBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public CpuQuotaBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public CpuQuotaBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private CpuQuotaBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public CpuQuota build() { + return new CpuQuotaImpl(this); + } + + private static final class CpuQuotaImpl + extends AbstractAugmentable + implements CpuQuota { + + private final Uint64 _limit; + private final Uint64 _reserve; + private final Uint64 _shares; + + CpuQuotaImpl(CpuQuotaBuilder base) { + super(base.augmentation); + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + @Override + public Uint64 getLimit() { + return _limit; + } + + @Override + public Uint64 getReserve() { + return _reserve; + } + + @Override + public Uint64 getShares() { + return _shares; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_limit); + result = prime * result + Objects.hashCode(_reserve); + result = prime * result + Objects.hashCode(_shares); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!CpuQuota.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + CpuQuota other = (CpuQuota)obj; + if (!Objects.equals(_limit, other.getLimit())) { + return false; + } + if (!Objects.equals(_reserve, other.getReserve())) { + return false; + } + if (!Objects.equals(_shares, other.getShares())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + CpuQuotaImpl otherImpl = (CpuQuotaImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("CpuQuota"); + CodeHelpers.appendValue(helper, "_limit", _limit); + CodeHelpers.appendValue(helper, "_reserve", _reserve); + CodeHelpers.appendValue(helper, "_shares", _shares); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuota.java new file mode 100644 index 0000000..835fbce --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuota.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.disk.io.quota; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedDiskIoQuota; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Disk IO quota describes the disk IO operations resource allocation policy. + * and Reserve values are defined in IOPS + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * container disk-io-quota {
+ *   uses allocation-properties;
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-disk-io-quota/disk-io-quota + * + *

To create instances of this class use {@link DiskIoQuotaBuilder}. + * @see DiskIoQuotaBuilder + * + */ +public interface DiskIoQuota + extends + ChildOf, + Augmentable, + AllocationProperties +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("disk-io-quota"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.disk.io.quota.DiskIoQuota.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuotaBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuotaBuilder.java new file mode 100644 index 0000000..1de3b58 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/disk/io/quota/DiskIoQuotaBuilder.java @@ -0,0 +1,335 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.disk.io.quota; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link DiskIoQuotaBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DiskIoQuotaBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DiskIoQuotaBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DiskIoQuotaBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DiskIoQuotaBuilder + * @see Builder + * + */ +public class DiskIoQuotaBuilder implements Builder { + + private Uint64 _limit; + private Uint64 _reserve; + private Uint64 _shares; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DiskIoQuotaBuilder() { + } + public DiskIoQuotaBuilder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties arg) { + this._limit = arg.getLimit(); + this._reserve = arg.getReserve(); + this._shares = arg.getShares(); + } + + public DiskIoQuotaBuilder(DiskIoQuota base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties) { + this._limit = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getLimit(); + this._reserve = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getReserve(); + this._shares = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getShares(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties]"); + } + + public Uint64 getLimit() { + return _limit; + } + + public Uint64 getReserve() { + return _reserve; + } + + public Uint64 getShares() { + return _shares; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public DiskIoQuotaBuilder setLimit(final Uint64 value) { + this._limit = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLimit(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public DiskIoQuotaBuilder setLimit(final BigInteger value) { + return setLimit(CodeHelpers.compatUint(value)); + } + + public DiskIoQuotaBuilder setReserve(final Uint64 value) { + this._reserve = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setReserve(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public DiskIoQuotaBuilder setReserve(final BigInteger value) { + return setReserve(CodeHelpers.compatUint(value)); + } + + public DiskIoQuotaBuilder setShares(final Uint64 value) { + this._shares = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setShares(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public DiskIoQuotaBuilder setShares(final BigInteger value) { + return setShares(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DiskIoQuotaBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DiskIoQuotaBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DiskIoQuotaBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DiskIoQuotaBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public DiskIoQuota build() { + return new DiskIoQuotaImpl(this); + } + + private static final class DiskIoQuotaImpl + extends AbstractAugmentable + implements DiskIoQuota { + + private final Uint64 _limit; + private final Uint64 _reserve; + private final Uint64 _shares; + + DiskIoQuotaImpl(DiskIoQuotaBuilder base) { + super(base.augmentation); + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + @Override + public Uint64 getLimit() { + return _limit; + } + + @Override + public Uint64 getReserve() { + return _reserve; + } + + @Override + public Uint64 getShares() { + return _shares; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_limit); + result = prime * result + Objects.hashCode(_reserve); + result = prime * result + Objects.hashCode(_shares); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!DiskIoQuota.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + DiskIoQuota other = (DiskIoQuota)obj; + if (!Objects.equals(_limit, other.getLimit())) { + return false; + } + if (!Objects.equals(_reserve, other.getReserve())) { + return false; + } + if (!Objects.equals(_shares, other.getShares())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DiskIoQuotaImpl otherImpl = (DiskIoQuotaImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("DiskIoQuota"); + CodeHelpers.appendValue(helper, "_limit", _limit); + CodeHelpers.appendValue(helper, "_reserve", _reserve); + CodeHelpers.appendValue(helper, "_shares", _shares); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuota.java new file mode 100644 index 0000000..81b16fb --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuota.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.mem.quota; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedMemQuota; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Memory quota describes the memory resource allocation policy. Limit and Reserve + * values are defined in MB + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * container mem-quota {
+ *   uses allocation-properties;
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-mem-quota/mem-quota + * + *

To create instances of this class use {@link MemQuotaBuilder}. + * @see MemQuotaBuilder + * + */ +public interface MemQuota + extends + ChildOf, + Augmentable, + AllocationProperties +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("mem-quota"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.mem.quota.MemQuota.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuotaBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuotaBuilder.java new file mode 100644 index 0000000..950e5a2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/mem/quota/MemQuotaBuilder.java @@ -0,0 +1,335 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.mem.quota; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link MemQuotaBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MemQuotaBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MemQuotaBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MemQuotaBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MemQuotaBuilder + * @see Builder + * + */ +public class MemQuotaBuilder implements Builder { + + private Uint64 _limit; + private Uint64 _reserve; + private Uint64 _shares; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MemQuotaBuilder() { + } + public MemQuotaBuilder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties arg) { + this._limit = arg.getLimit(); + this._reserve = arg.getReserve(); + this._shares = arg.getShares(); + } + + public MemQuotaBuilder(MemQuota base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties) { + this._limit = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getLimit(); + this._reserve = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getReserve(); + this._shares = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getShares(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties]"); + } + + public Uint64 getLimit() { + return _limit; + } + + public Uint64 getReserve() { + return _reserve; + } + + public Uint64 getShares() { + return _shares; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public MemQuotaBuilder setLimit(final Uint64 value) { + this._limit = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLimit(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MemQuotaBuilder setLimit(final BigInteger value) { + return setLimit(CodeHelpers.compatUint(value)); + } + + public MemQuotaBuilder setReserve(final Uint64 value) { + this._reserve = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setReserve(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MemQuotaBuilder setReserve(final BigInteger value) { + return setReserve(CodeHelpers.compatUint(value)); + } + + public MemQuotaBuilder setShares(final Uint64 value) { + this._shares = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setShares(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public MemQuotaBuilder setShares(final BigInteger value) { + return setShares(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MemQuotaBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MemQuotaBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MemQuotaBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MemQuotaBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MemQuota build() { + return new MemQuotaImpl(this); + } + + private static final class MemQuotaImpl + extends AbstractAugmentable + implements MemQuota { + + private final Uint64 _limit; + private final Uint64 _reserve; + private final Uint64 _shares; + + MemQuotaImpl(MemQuotaBuilder base) { + super(base.augmentation); + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + @Override + public Uint64 getLimit() { + return _limit; + } + + @Override + public Uint64 getReserve() { + return _reserve; + } + + @Override + public Uint64 getShares() { + return _shares; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_limit); + result = prime * result + Objects.hashCode(_reserve); + result = prime * result + Objects.hashCode(_shares); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MemQuota.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MemQuota other = (MemQuota)obj; + if (!Objects.equals(_limit, other.getLimit())) { + return false; + } + if (!Objects.equals(_reserve, other.getReserve())) { + return false; + } + if (!Objects.equals(_shares, other.getShares())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MemQuotaImpl otherImpl = (MemQuotaImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MemQuota"); + CodeHelpers.appendValue(helper, "_limit", _limit); + CodeHelpers.appendValue(helper, "_reserve", _reserve); + CodeHelpers.appendValue(helper, "_shares", _shares); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicy.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicy.java new file mode 100644 index 0000000..1d21ab7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicy.java @@ -0,0 +1,206 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedNuma; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.Node; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.NodeKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * This policy defines NUMA topology of the guest. Specifically identifies if the + * guest should be run on a host with one NUMA node or multiple NUMA nodes. As an + * example a guest might need 8 VCPUs and 4 GB of memory. However, it might need + * the VCPUs and memory distributed across multiple NUMA nodes. In this scenario, + * NUMA node 1 could run with 6 VCPUs and 3GB, and NUMA node 2 could run with 2 + * VCPUs and 1GB. + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * container numa-node-policy {
+ *   leaf node-cnt {
+ *     type uint16;
+ *   }
+ *   leaf mem-policy {
+ *     type enumeration {
+ *       enum STRICT;
+ *       enum PREFERRED;
+ *     }
+ *   }
+ *   list node {
+ *     key id;
+ *     leaf id {
+ *       type uint64;
+ *     }
+ *     list vcpu {
+ *       key id;
+ *       leaf id {
+ *         type uint64;
+ *       }
+ *     }
+ *     leaf memory-mb {
+ *       type uint64;
+ *     }
+ *     choice om-numa-type {
+ *       case cores {
+ *         leaf num-cores {
+ *           type uint8;
+ *         }
+ *       }
+ *       case paired-threads {
+ *         container paired-threads {
+ *           leaf num-paired-threads {
+ *             type uint8;
+ *           }
+ *           list paired-thread-ids {
+ *             max-elements 16;
+ *             key thread-a;
+ *             leaf thread-a {
+ *               type uint8;
+ *             }
+ *             leaf thread-b {
+ *               type uint8;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case threads {
+ *         leaf num-threads {
+ *           type uint8;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy + * + *

To create instances of this class use {@link NumaNodePolicyBuilder}. + * @see NumaNodePolicyBuilder + * + */ +public interface NumaNodePolicy + extends + ChildOf, + Augmentable +{ + + + public enum MemPolicy implements Enumeration { + STRICT(0, "STRICT"), + + PREFERRED(1, "PREFERRED") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (MemPolicy enumItem : MemPolicy.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private MemPolicy(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding MemPolicy item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding MemPolicy item, or null if no such item exists + */ + public static MemPolicy forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("numa-node-policy"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.NumaNodePolicy.class; + } + + /** + * The number of NUMA nodes to expose to the VM. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 nodeCnt, or null if not present + */ + @Nullable Uint16 getNodeCnt(); + + /** + * This policy specifies how the memory should be allocated in a multi-node + * scenario. STRICT : The memory must be allocated strictly from the memory + * attached to the NUMA node. PREFERRED : The memory should be allocated + * preferentially from the memory attached to the NUMA node + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.NumaNodePolicy.MemPolicy memPolicy, or null if not present + */ + @Nullable MemPolicy getMemPolicy(); + + /** + * @return java.util.Map node, or null if not present + */ + @Nullable Map getNode(); + + /** + * @return java.util.Map node, or an empty list if it is not present + */ + default @NonNull Map nonnullNode() { + return CodeHelpers.nonnull(getNode()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicyBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicyBuilder.java new file mode 100644 index 0000000..1745058 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/NumaNodePolicyBuilder.java @@ -0,0 +1,307 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.Node; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.NodeKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link NumaNodePolicyBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NumaNodePolicyBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NumaNodePolicyBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NumaNodePolicyBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NumaNodePolicyBuilder + * @see Builder + * + */ +public class NumaNodePolicyBuilder implements Builder { + + private NumaNodePolicy.MemPolicy _memPolicy; + private Map _node; + private Uint16 _nodeCnt; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NumaNodePolicyBuilder() { + } + + public NumaNodePolicyBuilder(NumaNodePolicy base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._memPolicy = base.getMemPolicy(); + this._node = base.getNode(); + this._nodeCnt = base.getNodeCnt(); + } + + + public NumaNodePolicy.MemPolicy getMemPolicy() { + return _memPolicy; + } + + public Map getNode() { + return _node; + } + + public Uint16 getNodeCnt() { + return _nodeCnt; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public NumaNodePolicyBuilder setMemPolicy(final NumaNodePolicy.MemPolicy value) { + this._memPolicy = value; + return this; + } + public NumaNodePolicyBuilder setNode(final Map values) { + this._node = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNode(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NumaNodePolicyBuilder setNode(final List values) { + return setNode(CodeHelpers.compatMap(values)); + } + + public NumaNodePolicyBuilder setNodeCnt(final Uint16 value) { + this._nodeCnt = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNodeCnt(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public NumaNodePolicyBuilder setNodeCnt(final Integer value) { + return setNodeCnt(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NumaNodePolicyBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NumaNodePolicyBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NumaNodePolicyBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NumaNodePolicyBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NumaNodePolicy build() { + return new NumaNodePolicyImpl(this); + } + + private static final class NumaNodePolicyImpl + extends AbstractAugmentable + implements NumaNodePolicy { + + private final NumaNodePolicy.MemPolicy _memPolicy; + private final Map _node; + private final Uint16 _nodeCnt; + + NumaNodePolicyImpl(NumaNodePolicyBuilder base) { + super(base.augmentation); + this._memPolicy = base.getMemPolicy(); + this._node = CodeHelpers.emptyToNull(base.getNode()); + this._nodeCnt = base.getNodeCnt(); + } + + @Override + public NumaNodePolicy.MemPolicy getMemPolicy() { + return _memPolicy; + } + + @Override + public Map getNode() { + return _node; + } + + @Override + public Uint16 getNodeCnt() { + return _nodeCnt; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_memPolicy); + result = prime * result + Objects.hashCode(_node); + result = prime * result + Objects.hashCode(_nodeCnt); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NumaNodePolicy.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NumaNodePolicy other = (NumaNodePolicy)obj; + if (!Objects.equals(_memPolicy, other.getMemPolicy())) { + return false; + } + if (!Objects.equals(_node, other.getNode())) { + return false; + } + if (!Objects.equals(_nodeCnt, other.getNodeCnt())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NumaNodePolicyImpl otherImpl = (NumaNodePolicyImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NumaNodePolicy"); + CodeHelpers.appendValue(helper, "_memPolicy", _memPolicy); + CodeHelpers.appendValue(helper, "_node", _node); + CodeHelpers.appendValue(helper, "_nodeCnt", _nodeCnt); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/Node.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/Node.java new file mode 100644 index 0000000..3b49c7a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/Node.java @@ -0,0 +1,139 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.NumaNodePolicy; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.OmNumaType; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.Vcpu; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.VcpuKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * list node {
+ *   key id;
+ *   leaf id {
+ *     type uint64;
+ *   }
+ *   list vcpu {
+ *     key id;
+ *     leaf id {
+ *       type uint64;
+ *     }
+ *   }
+ *   leaf memory-mb {
+ *     type uint64;
+ *   }
+ *   choice om-numa-type {
+ *     case cores {
+ *       leaf num-cores {
+ *         type uint8;
+ *       }
+ *     }
+ *     case paired-threads {
+ *       container paired-threads {
+ *         leaf num-paired-threads {
+ *           type uint8;
+ *         }
+ *         list paired-thread-ids {
+ *           max-elements 16;
+ *           key thread-a;
+ *           leaf thread-a {
+ *             type uint8;
+ *           }
+ *           leaf thread-b {
+ *             type uint8;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case threads {
+ *       leaf num-threads {
+ *         type uint8;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node + * + *

To create instances of this class use {@link NodeBuilder}. + * @see NodeBuilder + * @see NodeKey + * + */ +public interface Node + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("node"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.Node.class; + } + + /** + * NUMA node identification. Typically it's 0 or 1 + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 id, or null if not present + */ + @Nullable Uint64 getId(); + + /** + * List of VCPUs to allocate on this NUMA node. + * + * + * + * @return java.util.Map vcpu, or null if not present + */ + @Nullable Map getVcpu(); + + /** + * @return java.util.Map vcpu, or an empty list if it is not present + */ + default @NonNull Map nonnullVcpu() { + return CodeHelpers.nonnull(getVcpu()); + } + + /** + * Memory size expressed in MB for this NUMA node. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 memoryMb, or null if not present + */ + @Nullable Uint64 getMemoryMb(); + + /** + * OpenMANO Numa type selection + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.OmNumaType omNumaType, or null if not present + */ + @Nullable OmNumaType getOmNumaType(); + + @Override + NodeKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeBuilder.java new file mode 100644 index 0000000..07718ed --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeBuilder.java @@ -0,0 +1,364 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.OmNumaType; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.Vcpu; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.VcpuKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link NodeBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NodeBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NodeBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NodeBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NodeBuilder + * @see Builder + * + */ +public class NodeBuilder implements Builder { + + private Uint64 _id; + private Uint64 _memoryMb; + private OmNumaType _omNumaType; + private Map _vcpu; + private NodeKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NodeBuilder() { + } + + public NodeBuilder(Node base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._memoryMb = base.getMemoryMb(); + this._omNumaType = base.getOmNumaType(); + this._vcpu = base.getVcpu(); + } + + + public NodeKey key() { + return key; + } + + public Uint64 getId() { + return _id; + } + + public Uint64 getMemoryMb() { + return _memoryMb; + } + + public OmNumaType getOmNumaType() { + return _omNumaType; + } + + public Map getVcpu() { + return _vcpu; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NodeBuilder withKey(final NodeKey key) { + this.key = key; + return this; + } + + public NodeBuilder setId(final Uint64 value) { + this._id = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setId(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public NodeBuilder setId(final BigInteger value) { + return setId(CodeHelpers.compatUint(value)); + } + + public NodeBuilder setMemoryMb(final Uint64 value) { + this._memoryMb = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMemoryMb(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public NodeBuilder setMemoryMb(final BigInteger value) { + return setMemoryMb(CodeHelpers.compatUint(value)); + } + + public NodeBuilder setOmNumaType(final OmNumaType value) { + this._omNumaType = value; + return this; + } + public NodeBuilder setVcpu(final Map values) { + this._vcpu = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVcpu(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NodeBuilder setVcpu(final List values) { + return setVcpu(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NodeBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NodeBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NodeBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NodeBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Node build() { + return new NodeImpl(this); + } + + private static final class NodeImpl + extends AbstractAugmentable + implements Node { + + private final Uint64 _id; + private final Uint64 _memoryMb; + private final OmNumaType _omNumaType; + private final Map _vcpu; + private final NodeKey key; + + NodeImpl(NodeBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NodeKey(base.getId()); + } + this._id = key.getId(); + this._memoryMb = base.getMemoryMb(); + this._omNumaType = base.getOmNumaType(); + this._vcpu = CodeHelpers.emptyToNull(base.getVcpu()); + } + + @Override + public NodeKey key() { + return key; + } + + @Override + public Uint64 getId() { + return _id; + } + + @Override + public Uint64 getMemoryMb() { + return _memoryMb; + } + + @Override + public OmNumaType getOmNumaType() { + return _omNumaType; + } + + @Override + public Map getVcpu() { + return _vcpu; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_memoryMb); + result = prime * result + Objects.hashCode(_omNumaType); + result = prime * result + Objects.hashCode(_vcpu); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Node.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Node other = (Node)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_memoryMb, other.getMemoryMb())) { + return false; + } + if (!Objects.equals(_omNumaType, other.getOmNumaType())) { + return false; + } + if (!Objects.equals(_vcpu, other.getVcpu())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NodeImpl otherImpl = (NodeImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Node"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_memoryMb", _memoryMb); + CodeHelpers.appendValue(helper, "_omNumaType", _omNumaType); + CodeHelpers.appendValue(helper, "_vcpu", _vcpu); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeKey.java new file mode 100644 index 0000000..a730ca0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/NodeKey.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.math.BigInteger; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; +import org.opendaylight.yangtools.yang.common.Uint64; + +public class NodeKey + implements Identifier { + private static final long serialVersionUID = 7805731164917659700L; + private final Uint64 _id; + + + public NodeKey(Uint64 _id) { + + this._id = _id; + } + + /** + * Utility migration constructor. + * + * @param _id id in legacy Java type + * @deprecated Use {#link NodeKey(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public NodeKey(BigInteger _id) { + this(CodeHelpers.compatUint(_id)); + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NodeKey(NodeKey source) { + this._id = source._id; + } + + + public Uint64 getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NodeKey)) { + return false; + } + final NodeKey other = (NodeKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NodeKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/OmNumaType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/OmNumaType.java new file mode 100644 index 0000000..a4b4579 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/OmNumaType.java @@ -0,0 +1,58 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.Node; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * OpenMANO Numa type selection + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * choice om-numa-type {
+ *   case cores {
+ *     leaf num-cores {
+ *       type uint8;
+ *     }
+ *   }
+ *   case paired-threads {
+ *     container paired-threads {
+ *       leaf num-paired-threads {
+ *         type uint8;
+ *       }
+ *       list paired-thread-ids {
+ *         max-elements 16;
+ *         key thread-a;
+ *         leaf thread-a {
+ *           type uint8;
+ *         }
+ *         leaf thread-b {
+ *           type uint8;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case threads {
+ *     leaf num-threads {
+ *       type uint8;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node/om-numa-type + * + */ +public interface OmNumaType + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("om-numa-type"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/Vcpu.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/Vcpu.java new file mode 100644 index 0000000..1d2a2a3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/Vcpu.java @@ -0,0 +1,63 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.Node; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * List of VCPUs to allocate on this NUMA node. + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * list vcpu {
+ *   key id;
+ *   leaf id {
+ *     type uint64;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node/vcpu + * + *

To create instances of this class use {@link VcpuBuilder}. + * @see VcpuBuilder + * @see VcpuKey + * + */ +public interface Vcpu + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vcpu"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.Vcpu.class; + } + + /** + * List of VCPUs ids to allocate on this NUMA node + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 id, or null if not present + */ + @Nullable Uint64 getId(); + + @Override + VcpuKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuBuilder.java new file mode 100644 index 0000000..8261e73 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuBuilder.java @@ -0,0 +1,262 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link VcpuBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VcpuBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VcpuBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VcpuBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VcpuBuilder + * @see Builder + * + */ +public class VcpuBuilder implements Builder { + + private Uint64 _id; + private VcpuKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VcpuBuilder() { + } + + public VcpuBuilder(Vcpu base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + } + + + public VcpuKey key() { + return key; + } + + public Uint64 getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VcpuBuilder withKey(final VcpuKey key) { + this.key = key; + return this; + } + + public VcpuBuilder setId(final Uint64 value) { + this._id = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setId(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VcpuBuilder setId(final BigInteger value) { + return setId(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VcpuBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VcpuBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VcpuBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VcpuBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vcpu build() { + return new VcpuImpl(this); + } + + private static final class VcpuImpl + extends AbstractAugmentable + implements Vcpu { + + private final Uint64 _id; + private final VcpuKey key; + + VcpuImpl(VcpuBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VcpuKey(base.getId()); + } + this._id = key.getId(); + } + + @Override + public VcpuKey key() { + return key; + } + + @Override + public Uint64 getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vcpu.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vcpu other = (Vcpu)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VcpuImpl otherImpl = (VcpuImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vcpu"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuKey.java new file mode 100644 index 0000000..547220d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/VcpuKey.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.math.BigInteger; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; +import org.opendaylight.yangtools.yang.common.Uint64; + +public class VcpuKey + implements Identifier { + private static final long serialVersionUID = 3724147881547077701L; + private final Uint64 _id; + + + public VcpuKey(Uint64 _id) { + + this._id = _id; + } + + /** + * Utility migration constructor. + * + * @param _id id in legacy Java type + * @deprecated Use {#link VcpuKey(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VcpuKey(BigInteger _id) { + this(CodeHelpers.compatUint(_id)); + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VcpuKey(VcpuKey source) { + this._id = source._id; + } + + + public Uint64 getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VcpuKey)) { + return false; + } + final VcpuKey other = (VcpuKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VcpuKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Cores.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Cores.java new file mode 100644 index 0000000..b767a79 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Cores.java @@ -0,0 +1,49 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.OmNumaType; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * case cores {
+ *   leaf num-cores {
+ *     type uint8;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node/om-numa-type/cores + * + */ +public interface Cores + extends + DataObject, + Augmentable, + OmNumaType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cores"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.Cores.class; + } + + /** + * @return org.opendaylight.yangtools.yang.common.Uint8 numCores, or null if not present + */ + @Nullable Uint8 getNumCores(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/CoresBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/CoresBuilder.java new file mode 100644 index 0000000..e3d2577 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/CoresBuilder.java @@ -0,0 +1,241 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.Short; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * Class that builds {@link CoresBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     CoresBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new CoresBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of CoresBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see CoresBuilder + * @see Builder + * + */ +public class CoresBuilder implements Builder { + + private Uint8 _numCores; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public CoresBuilder() { + } + + public CoresBuilder(Cores base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._numCores = base.getNumCores(); + } + + + public Uint8 getNumCores() { + return _numCores; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public CoresBuilder setNumCores(final Uint8 value) { + this._numCores = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumCores(Uint8)} instead. + */ + @Deprecated(forRemoval = true) + public CoresBuilder setNumCores(final Short value) { + return setNumCores(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public CoresBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public CoresBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public CoresBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private CoresBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Cores build() { + return new CoresImpl(this); + } + + private static final class CoresImpl + extends AbstractAugmentable + implements Cores { + + private final Uint8 _numCores; + + CoresImpl(CoresBuilder base) { + super(base.augmentation); + this._numCores = base.getNumCores(); + } + + @Override + public Uint8 getNumCores() { + return _numCores; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_numCores); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Cores.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Cores other = (Cores)obj; + if (!Objects.equals(_numCores, other.getNumCores())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + CoresImpl otherImpl = (CoresImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Cores"); + CodeHelpers.appendValue(helper, "_numCores", _numCores); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreads.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreads.java new file mode 100644 index 0000000..1b9cacf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreads.java @@ -0,0 +1,60 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.OmNumaType; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * case paired-threads {
+ *   container paired-threads {
+ *     leaf num-paired-threads {
+ *       type uint8;
+ *     }
+ *     list paired-thread-ids {
+ *       max-elements 16;
+ *       key thread-a;
+ *       leaf thread-a {
+ *         type uint8;
+ *       }
+ *       leaf thread-b {
+ *         type uint8;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node/om-numa-type/paired-threads + * + */ +public interface PairedThreads + extends + DataObject, + Augmentable, + OmNumaType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("paired-threads"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.PairedThreads.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads pairedThreads, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.@Nullable PairedThreads getPairedThreads(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreadsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreadsBuilder.java new file mode 100644 index 0000000..35782d8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/PairedThreadsBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PairedThreadsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PairedThreadsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PairedThreadsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PairedThreadsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PairedThreadsBuilder + * @see Builder + * + */ +public class PairedThreadsBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads _pairedThreads; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PairedThreadsBuilder() { + } + + public PairedThreadsBuilder(PairedThreads base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._pairedThreads = base.getPairedThreads(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads getPairedThreads() { + return _pairedThreads; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PairedThreadsBuilder setPairedThreads(final org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads value) { + this._pairedThreads = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PairedThreadsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PairedThreadsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PairedThreadsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PairedThreads build() { + return new PairedThreadsImpl(this); + } + + private static final class PairedThreadsImpl + extends AbstractAugmentable + implements PairedThreads { + + private final org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads _pairedThreads; + + PairedThreadsImpl(PairedThreadsBuilder base) { + super(base.augmentation); + this._pairedThreads = base.getPairedThreads(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads getPairedThreads() { + return _pairedThreads; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_pairedThreads); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PairedThreads.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PairedThreads other = (PairedThreads)obj; + if (!Objects.equals(_pairedThreads, other.getPairedThreads())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PairedThreadsImpl otherImpl = (PairedThreadsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PairedThreads"); + CodeHelpers.appendValue(helper, "_pairedThreads", _pairedThreads); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Threads.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Threads.java new file mode 100644 index 0000000..77cf6fd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/Threads.java @@ -0,0 +1,49 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.OmNumaType; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * case threads {
+ *   leaf num-threads {
+ *     type uint8;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node/om-numa-type/threads + * + */ +public interface Threads + extends + DataObject, + Augmentable, + OmNumaType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("threads"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.Threads.class; + } + + /** + * @return org.opendaylight.yangtools.yang.common.Uint8 numThreads, or null if not present + */ + @Nullable Uint8 getNumThreads(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/ThreadsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/ThreadsBuilder.java new file mode 100644 index 0000000..1006005 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/ThreadsBuilder.java @@ -0,0 +1,241 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.Short; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * Class that builds {@link ThreadsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ThreadsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ThreadsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ThreadsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ThreadsBuilder + * @see Builder + * + */ +public class ThreadsBuilder implements Builder { + + private Uint8 _numThreads; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ThreadsBuilder() { + } + + public ThreadsBuilder(Threads base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._numThreads = base.getNumThreads(); + } + + + public Uint8 getNumThreads() { + return _numThreads; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public ThreadsBuilder setNumThreads(final Uint8 value) { + this._numThreads = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumThreads(Uint8)} instead. + */ + @Deprecated(forRemoval = true) + public ThreadsBuilder setNumThreads(final Short value) { + return setNumThreads(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ThreadsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ThreadsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ThreadsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ThreadsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Threads build() { + return new ThreadsImpl(this); + } + + private static final class ThreadsImpl + extends AbstractAugmentable + implements Threads { + + private final Uint8 _numThreads; + + ThreadsImpl(ThreadsBuilder base) { + super(base.augmentation); + this._numThreads = base.getNumThreads(); + } + + @Override + public Uint8 getNumThreads() { + return _numThreads; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_numThreads); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Threads.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Threads other = (Threads)obj; + if (!Objects.equals(_numThreads, other.getNumThreads())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ThreadsImpl otherImpl = (ThreadsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Threads"); + CodeHelpers.appendValue(helper, "_numThreads", _numThreads); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreads.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreads.java new file mode 100644 index 0000000..d04f576 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreads.java @@ -0,0 +1,81 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.Node; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads.PairedThreadIds; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads.PairedThreadIdsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * container paired-threads {
+ *   leaf num-paired-threads {
+ *     type uint8;
+ *   }
+ *   list paired-thread-ids {
+ *     max-elements 16;
+ *     key thread-a;
+ *     leaf thread-a {
+ *       type uint8;
+ *     }
+ *     leaf thread-b {
+ *       type uint8;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node/om-numa-type/paired-threads/paired-threads + * + *

To create instances of this class use {@link PairedThreadsBuilder}. + * @see PairedThreadsBuilder + * + */ +public interface PairedThreads + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("paired-threads"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads.class; + } + + /** + * @return org.opendaylight.yangtools.yang.common.Uint8 numPairedThreads, or null if not present + */ + @Nullable Uint8 getNumPairedThreads(); + + /** + * List of thread pairs to use in case of paired-thread NUMA + * + * + * + * @return java.util.Map pairedThreadIds, or null if not present + */ + @Nullable Map getPairedThreadIds(); + + /** + * @return java.util.Map pairedThreadIds, or an empty list if it is not present + */ + default @NonNull Map nonnullPairedThreadIds() { + return CodeHelpers.nonnull(getPairedThreadIds()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreadsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreadsBuilder.java new file mode 100644 index 0000000..36db122 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/PairedThreadsBuilder.java @@ -0,0 +1,284 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.Short; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads.PairedThreadIds; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads.PairedThreadIdsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * Class that builds {@link PairedThreadsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PairedThreadsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PairedThreadsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PairedThreadsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PairedThreadsBuilder + * @see Builder + * + */ +public class PairedThreadsBuilder implements Builder { + + private Uint8 _numPairedThreads; + private Map _pairedThreadIds; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PairedThreadsBuilder() { + } + + public PairedThreadsBuilder(PairedThreads base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._numPairedThreads = base.getNumPairedThreads(); + this._pairedThreadIds = base.getPairedThreadIds(); + } + + + public Uint8 getNumPairedThreads() { + return _numPairedThreads; + } + + public Map getPairedThreadIds() { + return _pairedThreadIds; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public PairedThreadsBuilder setNumPairedThreads(final Uint8 value) { + this._numPairedThreads = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumPairedThreads(Uint8)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadsBuilder setNumPairedThreads(final Short value) { + return setNumPairedThreads(CodeHelpers.compatUint(value)); + } + public PairedThreadsBuilder setPairedThreadIds(final Map values) { + this._pairedThreadIds = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setPairedThreadIds(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadsBuilder setPairedThreadIds(final List values) { + return setPairedThreadIds(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PairedThreadsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PairedThreadsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PairedThreadsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PairedThreads build() { + return new PairedThreadsImpl(this); + } + + private static final class PairedThreadsImpl + extends AbstractAugmentable + implements PairedThreads { + + private final Uint8 _numPairedThreads; + private final Map _pairedThreadIds; + + PairedThreadsImpl(PairedThreadsBuilder base) { + super(base.augmentation); + this._numPairedThreads = base.getNumPairedThreads(); + this._pairedThreadIds = CodeHelpers.emptyToNull(base.getPairedThreadIds()); + } + + @Override + public Uint8 getNumPairedThreads() { + return _numPairedThreads; + } + + @Override + public Map getPairedThreadIds() { + return _pairedThreadIds; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_numPairedThreads); + result = prime * result + Objects.hashCode(_pairedThreadIds); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PairedThreads.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PairedThreads other = (PairedThreads)obj; + if (!Objects.equals(_numPairedThreads, other.getNumPairedThreads())) { + return false; + } + if (!Objects.equals(_pairedThreadIds, other.getPairedThreadIds())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PairedThreadsImpl otherImpl = (PairedThreadsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PairedThreads"); + CodeHelpers.appendValue(helper, "_numPairedThreads", _numPairedThreads); + CodeHelpers.appendValue(helper, "_pairedThreadIds", _pairedThreadIds); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIds.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIds.java new file mode 100644 index 0000000..d27345f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIds.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.PairedThreads; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * List of thread pairs to use in case of paired-thread NUMA + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * list paired-thread-ids {
+ *   max-elements 16;
+ *   key thread-a;
+ *   leaf thread-a {
+ *     type uint8;
+ *   }
+ *   leaf thread-b {
+ *     type uint8;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-numa/numa-node-policy/node/om-numa-type/paired-threads/paired-threads/paired-thread-ids + * + *

To create instances of this class use {@link PairedThreadIdsBuilder}. + * @see PairedThreadIdsBuilder + * @see PairedThreadIdsKey + * + */ +public interface PairedThreadIds + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("paired-thread-ids"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads.PairedThreadIds.class; + } + + /** + * @return org.opendaylight.yangtools.yang.common.Uint8 threadA, or null if not present + */ + @Nullable Uint8 getThreadA(); + + /** + * @return org.opendaylight.yangtools.yang.common.Uint8 threadB, or null if not present + */ + @Nullable Uint8 getThreadB(); + + @Override + PairedThreadIdsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsBuilder.java new file mode 100644 index 0000000..0a150be --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsBuilder.java @@ -0,0 +1,297 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.Short; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint8; + +/** + * Class that builds {@link PairedThreadIdsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PairedThreadIdsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PairedThreadIdsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PairedThreadIdsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PairedThreadIdsBuilder + * @see Builder + * + */ +public class PairedThreadIdsBuilder implements Builder { + + private Uint8 _threadA; + private Uint8 _threadB; + private PairedThreadIdsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PairedThreadIdsBuilder() { + } + + public PairedThreadIdsBuilder(PairedThreadIds base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._threadA = base.getThreadA(); + this._threadB = base.getThreadB(); + } + + + public PairedThreadIdsKey key() { + return key; + } + + public Uint8 getThreadA() { + return _threadA; + } + + public Uint8 getThreadB() { + return _threadB; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PairedThreadIdsBuilder withKey(final PairedThreadIdsKey key) { + this.key = key; + return this; + } + + public PairedThreadIdsBuilder setThreadA(final Uint8 value) { + this._threadA = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setThreadA(Uint8)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadIdsBuilder setThreadA(final Short value) { + return setThreadA(CodeHelpers.compatUint(value)); + } + + public PairedThreadIdsBuilder setThreadB(final Uint8 value) { + this._threadB = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setThreadB(Uint8)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadIdsBuilder setThreadB(final Short value) { + return setThreadB(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PairedThreadIdsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadIdsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PairedThreadIdsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PairedThreadIdsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PairedThreadIds build() { + return new PairedThreadIdsImpl(this); + } + + private static final class PairedThreadIdsImpl + extends AbstractAugmentable + implements PairedThreadIds { + + private final Uint8 _threadA; + private final Uint8 _threadB; + private final PairedThreadIdsKey key; + + PairedThreadIdsImpl(PairedThreadIdsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new PairedThreadIdsKey(base.getThreadA()); + } + this._threadA = key.getThreadA(); + this._threadB = base.getThreadB(); + } + + @Override + public PairedThreadIdsKey key() { + return key; + } + + @Override + public Uint8 getThreadA() { + return _threadA; + } + + @Override + public Uint8 getThreadB() { + return _threadB; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_threadA); + result = prime * result + Objects.hashCode(_threadB); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PairedThreadIds.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PairedThreadIds other = (PairedThreadIds)obj; + if (!Objects.equals(_threadA, other.getThreadA())) { + return false; + } + if (!Objects.equals(_threadB, other.getThreadB())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PairedThreadIdsImpl otherImpl = (PairedThreadIdsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PairedThreadIds"); + CodeHelpers.appendValue(helper, "_threadA", _threadA); + CodeHelpers.appendValue(helper, "_threadB", _threadB); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsKey.java new file mode 100644 index 0000000..2946c4a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/numa/numa/node/policy/node/om/numa/type/paired/threads/paired/threads/PairedThreadIdsKey.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.numa.numa.node.policy.node.om.numa.type.paired.threads.paired.threads; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.Short; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; +import org.opendaylight.yangtools.yang.common.Uint8; + +public class PairedThreadIdsKey + implements Identifier { + private static final long serialVersionUID = 5657393331481948923L; + private final Uint8 _threadA; + + + public PairedThreadIdsKey(Uint8 _threadA) { + + this._threadA = _threadA; + } + + /** + * Utility migration constructor. + * + * @param _threadA threadA in legacy Java type + * @deprecated Use {#link PairedThreadIdsKey(Uint8)} instead. + */ + @Deprecated(forRemoval = true) + public PairedThreadIdsKey(Short _threadA) { + this(CodeHelpers.compatUint(_threadA)); + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public PairedThreadIdsKey(PairedThreadIdsKey source) { + this._threadA = source._threadA; + } + + + public Uint8 getThreadA() { + return _threadA; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_threadA); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof PairedThreadIdsKey)) { + return false; + } + final PairedThreadIdsKey other = (PairedThreadIdsKey) obj; + if (!Objects.equals(_threadA, other._threadA)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(PairedThreadIdsKey.class); + CodeHelpers.appendValue(helper, "_threadA", _threadA); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuota.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuota.java new file mode 100644 index 0000000..71caaee --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuota.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.vif.quota; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.ExtendedVifQuota; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Virtual interfaces quota describes the virtual interface bandwidth resource + * allocation policy. Limit and Reserve values are defined in Mbps + * + *

+ * This class represents the following YANG schema fragment defined in module epa + *

+ * container vif-quota {
+ *   uses allocation-properties;
+ * }
+ * 
The schema path to identify an instance is + * epa/extended-vif-quota/vif-quota + * + *

To create instances of this class use {@link VifQuotaBuilder}. + * @see VifQuotaBuilder + * + */ +public interface VifQuota + extends + ChildOf, + Augmentable, + AllocationProperties +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vif-quota"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.vif.quota.VifQuota.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuotaBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuotaBuilder.java new file mode 100644 index 0000000..fdf4585 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/epa/norev/extended/vif/quota/VifQuotaBuilder.java @@ -0,0 +1,335 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.extended.vif.quota; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.math.BigInteger; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * Class that builds {@link VifQuotaBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VifQuotaBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VifQuotaBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VifQuotaBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VifQuotaBuilder + * @see Builder + * + */ +public class VifQuotaBuilder implements Builder { + + private Uint64 _limit; + private Uint64 _reserve; + private Uint64 _shares; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VifQuotaBuilder() { + } + public VifQuotaBuilder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties arg) { + this._limit = arg.getLimit(); + this._reserve = arg.getReserve(); + this._shares = arg.getShares(); + } + + public VifQuotaBuilder(VifQuota base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties) { + this._limit = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getLimit(); + this._reserve = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getReserve(); + this._shares = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties)arg).getShares(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.epa.norev.AllocationProperties]"); + } + + public Uint64 getLimit() { + return _limit; + } + + public Uint64 getReserve() { + return _reserve; + } + + public Uint64 getShares() { + return _shares; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VifQuotaBuilder setLimit(final Uint64 value) { + this._limit = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setLimit(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VifQuotaBuilder setLimit(final BigInteger value) { + return setLimit(CodeHelpers.compatUint(value)); + } + + public VifQuotaBuilder setReserve(final Uint64 value) { + this._reserve = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setReserve(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VifQuotaBuilder setReserve(final BigInteger value) { + return setReserve(CodeHelpers.compatUint(value)); + } + + public VifQuotaBuilder setShares(final Uint64 value) { + this._shares = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setShares(Uint64)} instead. + */ + @Deprecated(forRemoval = true) + public VifQuotaBuilder setShares(final BigInteger value) { + return setShares(CodeHelpers.compatUint(value)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VifQuotaBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VifQuotaBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VifQuotaBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VifQuotaBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VifQuota build() { + return new VifQuotaImpl(this); + } + + private static final class VifQuotaImpl + extends AbstractAugmentable + implements VifQuota { + + private final Uint64 _limit; + private final Uint64 _reserve; + private final Uint64 _shares; + + VifQuotaImpl(VifQuotaBuilder base) { + super(base.augmentation); + this._limit = base.getLimit(); + this._reserve = base.getReserve(); + this._shares = base.getShares(); + } + + @Override + public Uint64 getLimit() { + return _limit; + } + + @Override + public Uint64 getReserve() { + return _reserve; + } + + @Override + public Uint64 getShares() { + return _shares; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_limit); + result = prime * result + Objects.hashCode(_reserve); + result = prime * result + Objects.hashCode(_shares); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VifQuota.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VifQuota other = (VifQuota)obj; + if (!Objects.equals(_limit, other.getLimit())) { + return false; + } + if (!Objects.equals(_reserve, other.getReserve())) { + return false; + } + if (!Objects.equals(_shares, other.getShares())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VifQuotaImpl otherImpl = (VifQuotaImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VifQuota"); + CodeHelpers.appendValue(helper, "_limit", _limit); + CodeHelpers.appendValue(helper, "_reserve", _reserve); + CodeHelpers.appendValue(helper, "_shares", _shares); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..9cb0a87 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..cd7edea --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/$YangModuleInfoImpl.java @@ -0,0 +1,49 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:ip-profiles", "ip-profiles").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/ip-profiles.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/ExtendedVldProtocolData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/ExtendedVldProtocolData.java new file mode 100644 index 0000000..0bbb6b0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/ExtendedVldProtocolData.java @@ -0,0 +1,105 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.VirtualLinkProtocolData; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module ip-profiles + *

+ * grouping extended-vld-protocol-data {
+ *   container virtual-link-protocol-data {
+ *     leaf associated-layer-protocol {
+ *       type identityref {
+ *         base layer-protocol;
+ *       }
+ *     }
+ *     container l2-protocol-data {
+ *       when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf network-type {
+ *         type enumeration {
+ *           enum flat;
+ *           enum vlan;
+ *           enum vxlan;
+ *           enum gre;
+ *         }
+ *       }
+ *       leaf vlan-transparent {
+ *         type boolean;
+ *       }
+ *       leaf mtu {
+ *         type uint16;
+ *       }
+ *     }
+ *     container l3-protocol-data {
+ *       when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf ip-version {
+ *         type enumeration {
+ *           enum ipv4;
+ *           enum ipv6;
+ *         }
+ *         default ipv4;
+ *       }
+ *       leaf cidr {
+ *         type string;
+ *       }
+ *       leaf-list ip-allocation-pools {
+ *         type string;
+ *       }
+ *       leaf gateway-ip {
+ *         type inet:ip-address;
+ *       }
+ *       leaf dhcp-enabled {
+ *         type boolean;
+ *         default true;
+ *       }
+ *       leaf ipv6-address-mode {
+ *         when "../ip-version = 'ipv6'";
+ *         type enumeration {
+ *           enum slaac;
+ *           enum dhcpv6-stateful;
+ *           enum dhcpv6-stateless;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * ip-profiles/extended-vld-protocol-data + * + */ +public interface ExtendedVldProtocolData + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-vld-protocol-data"); + + @Override + Class implementedInterface(); + + /** + * Specifies the protocol data for a VL instantiated according to this profile. + * Cardinality 0 is used when no protocol data needs to be specified. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.VirtualLinkProtocolData virtualLinkProtocolData, or null if not present + */ + @Nullable VirtualLinkProtocolData getVirtualLinkProtocolData(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1.java new file mode 100644 index 0000000..ccbaf2d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface VirtualLinkProfile1 + extends + Augmentation, + ExtendedVldProtocolData +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.VirtualLinkProfile1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1Builder.java new file mode 100644 index 0000000..96737c1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/VirtualLinkProfile1Builder.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.VirtualLinkProtocolData; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkProfile1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkProfile1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkProfile1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkProfile1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkProfile1Builder + * @see Builder + * + */ +public class VirtualLinkProfile1Builder implements Builder { + + private VirtualLinkProtocolData _virtualLinkProtocolData; + + + + public VirtualLinkProfile1Builder() { + } + public VirtualLinkProfile1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.ExtendedVldProtocolData arg) { + this._virtualLinkProtocolData = arg.getVirtualLinkProtocolData(); + } + + public VirtualLinkProfile1Builder(VirtualLinkProfile1 base) { + this._virtualLinkProtocolData = base.getVirtualLinkProtocolData(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.ExtendedVldProtocolData
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.ExtendedVldProtocolData) { + this._virtualLinkProtocolData = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.ExtendedVldProtocolData)arg).getVirtualLinkProtocolData(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.ExtendedVldProtocolData]"); + } + + public VirtualLinkProtocolData getVirtualLinkProtocolData() { + return _virtualLinkProtocolData; + } + + + public VirtualLinkProfile1Builder setVirtualLinkProtocolData(final VirtualLinkProtocolData value) { + this._virtualLinkProtocolData = value; + return this; + } + + + @Override + public VirtualLinkProfile1 build() { + return new VirtualLinkProfile1Impl(this); + } + + private static final class VirtualLinkProfile1Impl + implements VirtualLinkProfile1 { + + private final VirtualLinkProtocolData _virtualLinkProtocolData; + + VirtualLinkProfile1Impl(VirtualLinkProfile1Builder base) { + this._virtualLinkProtocolData = base.getVirtualLinkProtocolData(); + } + + @Override + public VirtualLinkProtocolData getVirtualLinkProtocolData() { + return _virtualLinkProtocolData; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_virtualLinkProtocolData); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkProfile1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkProfile1 other = (VirtualLinkProfile1)obj; + if (!Objects.equals(_virtualLinkProtocolData, other.getVirtualLinkProtocolData())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkProfile1"); + CodeHelpers.appendValue(helper, "_virtualLinkProtocolData", _virtualLinkProtocolData); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolData.java new file mode 100644 index 0000000..5f88040 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolData.java @@ -0,0 +1,137 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.ExtendedVldProtocolData; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L2ProtocolData; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L3ProtocolData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the protocol data for a VL instantiated according to this profile. + * Cardinality 0 is used when no protocol data needs to be specified. + * + *

+ * This class represents the following YANG schema fragment defined in module ip-profiles + *

+ * container virtual-link-protocol-data {
+ *   leaf associated-layer-protocol {
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   container l2-protocol-data {
+ *     when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf network-type {
+ *       type enumeration {
+ *         enum flat;
+ *         enum vlan;
+ *         enum vxlan;
+ *         enum gre;
+ *       }
+ *     }
+ *     leaf vlan-transparent {
+ *       type boolean;
+ *     }
+ *     leaf mtu {
+ *       type uint16;
+ *     }
+ *   }
+ *   container l3-protocol-data {
+ *     when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf ip-version {
+ *       type enumeration {
+ *         enum ipv4;
+ *         enum ipv6;
+ *       }
+ *       default ipv4;
+ *     }
+ *     leaf cidr {
+ *       type string;
+ *     }
+ *     leaf-list ip-allocation-pools {
+ *       type string;
+ *     }
+ *     leaf gateway-ip {
+ *       type inet:ip-address;
+ *     }
+ *     leaf dhcp-enabled {
+ *       type boolean;
+ *       default true;
+ *     }
+ *     leaf ipv6-address-mode {
+ *       when "../ip-version = 'ipv6'";
+ *       type enumeration {
+ *         enum slaac;
+ *         enum dhcpv6-stateful;
+ *         enum dhcpv6-stateless;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * ip-profiles/extended-vld-protocol-data/virtual-link-protocol-data + * + *

To create instances of this class use {@link VirtualLinkProtocolDataBuilder}. + * @see VirtualLinkProtocolDataBuilder + * + */ +public interface VirtualLinkProtocolData + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-protocol-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.VirtualLinkProtocolData.class; + } + + /** + * One of the values of the attribute layerProtocol of the ConnectivityType IE. + * + * + * + * @return java.lang.Class associatedLayerProtocol, or null if not present + */ + @Nullable Class getAssociatedLayerProtocol(); + + /** + * Specifies the L2 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L2 protocol and shall be absent + * otherwise. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L2ProtocolData l2ProtocolData, or null if not present + */ + @Nullable L2ProtocolData getL2ProtocolData(); + + /** + * Specifies the L3 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L3 protocol and shall be absent + * otherwise. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L3ProtocolData l3ProtocolData, or null if not present + */ + @Nullable L3ProtocolData getL3ProtocolData(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolDataBuilder.java new file mode 100644 index 0000000..3663d17 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/VirtualLinkProtocolDataBuilder.java @@ -0,0 +1,276 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L2ProtocolData; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L3ProtocolData; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkProtocolDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkProtocolDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkProtocolDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkProtocolDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkProtocolDataBuilder + * @see Builder + * + */ +public class VirtualLinkProtocolDataBuilder implements Builder { + + private Class _associatedLayerProtocol; + private L2ProtocolData _l2ProtocolData; + private L3ProtocolData _l3ProtocolData; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkProtocolDataBuilder() { + } + + public VirtualLinkProtocolDataBuilder(VirtualLinkProtocolData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._associatedLayerProtocol = base.getAssociatedLayerProtocol(); + this._l2ProtocolData = base.getL2ProtocolData(); + this._l3ProtocolData = base.getL3ProtocolData(); + } + + + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + public L2ProtocolData getL2ProtocolData() { + return _l2ProtocolData; + } + + public L3ProtocolData getL3ProtocolData() { + return _l3ProtocolData; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public VirtualLinkProtocolDataBuilder setAssociatedLayerProtocol(final Class value) { + this._associatedLayerProtocol = value; + return this; + } + + public VirtualLinkProtocolDataBuilder setL2ProtocolData(final L2ProtocolData value) { + this._l2ProtocolData = value; + return this; + } + + public VirtualLinkProtocolDataBuilder setL3ProtocolData(final L3ProtocolData value) { + this._l3ProtocolData = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkProtocolDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkProtocolDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkProtocolDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkProtocolDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkProtocolData build() { + return new VirtualLinkProtocolDataImpl(this); + } + + private static final class VirtualLinkProtocolDataImpl + extends AbstractAugmentable + implements VirtualLinkProtocolData { + + private final Class _associatedLayerProtocol; + private final L2ProtocolData _l2ProtocolData; + private final L3ProtocolData _l3ProtocolData; + + VirtualLinkProtocolDataImpl(VirtualLinkProtocolDataBuilder base) { + super(base.augmentation); + this._associatedLayerProtocol = base.getAssociatedLayerProtocol(); + this._l2ProtocolData = base.getL2ProtocolData(); + this._l3ProtocolData = base.getL3ProtocolData(); + } + + @Override + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + @Override + public L2ProtocolData getL2ProtocolData() { + return _l2ProtocolData; + } + + @Override + public L3ProtocolData getL3ProtocolData() { + return _l3ProtocolData; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_associatedLayerProtocol); + result = prime * result + Objects.hashCode(_l2ProtocolData); + result = prime * result + Objects.hashCode(_l3ProtocolData); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkProtocolData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkProtocolData other = (VirtualLinkProtocolData)obj; + if (!Objects.equals(_associatedLayerProtocol, other.getAssociatedLayerProtocol())) { + return false; + } + if (!Objects.equals(_l2ProtocolData, other.getL2ProtocolData())) { + return false; + } + if (!Objects.equals(_l3ProtocolData, other.getL3ProtocolData())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkProtocolDataImpl otherImpl = (VirtualLinkProtocolDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkProtocolData"); + CodeHelpers.appendValue(helper, "_associatedLayerProtocol", _associatedLayerProtocol); + CodeHelpers.appendValue(helper, "_l2ProtocolData", _l2ProtocolData); + CodeHelpers.appendValue(helper, "_l3ProtocolData", _l3ProtocolData); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolData.java new file mode 100644 index 0000000..31ee3e9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolData.java @@ -0,0 +1,174 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.VirtualLinkProtocolData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Specifies the L2 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L2 protocol and shall be absent + * otherwise. + * + *

+ * This class represents the following YANG schema fragment defined in module ip-profiles + *

+ * container l2-protocol-data {
+ *   when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf network-type {
+ *     type enumeration {
+ *       enum flat;
+ *       enum vlan;
+ *       enum vxlan;
+ *       enum gre;
+ *     }
+ *   }
+ *   leaf vlan-transparent {
+ *     type boolean;
+ *   }
+ *   leaf mtu {
+ *     type uint16;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * ip-profiles/extended-vld-protocol-data/virtual-link-protocol-data/l2-protocol-data + * + *

To create instances of this class use {@link L2ProtocolDataBuilder}. + * @see L2ProtocolDataBuilder + * + */ +public interface L2ProtocolData + extends + ChildOf, + Augmentable +{ + + + public enum NetworkType implements Enumeration { + Flat(0, "flat"), + + Vlan(1, "vlan"), + + Vxlan(2, "vxlan"), + + Gre(3, "gre") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (NetworkType enumItem : NetworkType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private NetworkType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding NetworkType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding NetworkType item, or null if no such item exists + */ + public static NetworkType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l2-protocol-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L2ProtocolData.class; + } + + /** + * Network name associated with this L2 protocol. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Specifies the network type for this L2 protocol. Possible values: FLAT, VLAN, + * VXLAN, GRE. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L2ProtocolData.NetworkType networkType, or null if not present + */ + @Nullable NetworkType getNetworkType(); + + /** + * Specifies whether to support VLAN transparency for this L2 protocol or not. + * + * + * + * @return java.lang.Boolean vlanTransparent, or null if not present + */ + @Nullable Boolean isVlanTransparent(); + + /** + * Specifies the maximum transmission unit (MTU) value for this L2 protocol. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 mtu, or null if not present + */ + @Nullable Uint16 getMtu(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolDataBuilder.java new file mode 100644 index 0000000..91cf05c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L2ProtocolDataBuilder.java @@ -0,0 +1,311 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link L2ProtocolDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L2ProtocolDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L2ProtocolDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L2ProtocolDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L2ProtocolDataBuilder + * @see Builder + * + */ +public class L2ProtocolDataBuilder implements Builder { + + private Uint16 _mtu; + private String _name; + private L2ProtocolData.NetworkType _networkType; + private Boolean _vlanTransparent; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L2ProtocolDataBuilder() { + } + + public L2ProtocolDataBuilder(L2ProtocolData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._mtu = base.getMtu(); + this._name = base.getName(); + this._networkType = base.getNetworkType(); + this._vlanTransparent = base.isVlanTransparent(); + } + + + public Uint16 getMtu() { + return _mtu; + } + + public String getName() { + return _name; + } + + public L2ProtocolData.NetworkType getNetworkType() { + return _networkType; + } + + public Boolean isVlanTransparent() { + return _vlanTransparent; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L2ProtocolDataBuilder setMtu(final Uint16 value) { + this._mtu = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMtu(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public L2ProtocolDataBuilder setMtu(final Integer value) { + return setMtu(CodeHelpers.compatUint(value)); + } + + public L2ProtocolDataBuilder setName(final String value) { + this._name = value; + return this; + } + + public L2ProtocolDataBuilder setNetworkType(final L2ProtocolData.NetworkType value) { + this._networkType = value; + return this; + } + + public L2ProtocolDataBuilder setVlanTransparent(final Boolean value) { + this._vlanTransparent = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L2ProtocolDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L2ProtocolDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L2ProtocolDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L2ProtocolDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L2ProtocolData build() { + return new L2ProtocolDataImpl(this); + } + + private static final class L2ProtocolDataImpl + extends AbstractAugmentable + implements L2ProtocolData { + + private final Uint16 _mtu; + private final String _name; + private final L2ProtocolData.NetworkType _networkType; + private final Boolean _vlanTransparent; + + L2ProtocolDataImpl(L2ProtocolDataBuilder base) { + super(base.augmentation); + this._mtu = base.getMtu(); + this._name = base.getName(); + this._networkType = base.getNetworkType(); + this._vlanTransparent = base.isVlanTransparent(); + } + + @Override + public Uint16 getMtu() { + return _mtu; + } + + @Override + public String getName() { + return _name; + } + + @Override + public L2ProtocolData.NetworkType getNetworkType() { + return _networkType; + } + + @Override + public Boolean isVlanTransparent() { + return _vlanTransparent; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_mtu); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_networkType); + result = prime * result + Objects.hashCode(_vlanTransparent); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L2ProtocolData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L2ProtocolData other = (L2ProtocolData)obj; + if (!Objects.equals(_mtu, other.getMtu())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_networkType, other.getNetworkType())) { + return false; + } + if (!Objects.equals(_vlanTransparent, other.isVlanTransparent())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L2ProtocolDataImpl otherImpl = (L2ProtocolDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L2ProtocolData"); + CodeHelpers.appendValue(helper, "_mtu", _mtu); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_networkType", _networkType); + CodeHelpers.appendValue(helper, "_vlanTransparent", _vlanTransparent); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolData.java new file mode 100644 index 0000000..4607ad8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolData.java @@ -0,0 +1,278 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.VirtualLinkProtocolData; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the L3 protocol data for this virtual link. Shall be present when the + * associatedLayerProtocol attribute indicates a L3 protocol and shall be absent + * otherwise. + * + *

+ * This class represents the following YANG schema fragment defined in module ip-profiles + *

+ * container l3-protocol-data {
+ *   when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf ip-version {
+ *     type enumeration {
+ *       enum ipv4;
+ *       enum ipv6;
+ *     }
+ *     default ipv4;
+ *   }
+ *   leaf cidr {
+ *     type string;
+ *   }
+ *   leaf-list ip-allocation-pools {
+ *     type string;
+ *   }
+ *   leaf gateway-ip {
+ *     type inet:ip-address;
+ *   }
+ *   leaf dhcp-enabled {
+ *     type boolean;
+ *     default true;
+ *   }
+ *   leaf ipv6-address-mode {
+ *     when "../ip-version = 'ipv6'";
+ *     type enumeration {
+ *       enum slaac;
+ *       enum dhcpv6-stateful;
+ *       enum dhcpv6-stateless;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * ip-profiles/extended-vld-protocol-data/virtual-link-protocol-data/l3-protocol-data + * + *

To create instances of this class use {@link L3ProtocolDataBuilder}. + * @see L3ProtocolDataBuilder + * + */ +public interface L3ProtocolData + extends + ChildOf, + Augmentable +{ + + + public enum IpVersion implements Enumeration { + Ipv4(0, "ipv4"), + + Ipv6(1, "ipv6") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (IpVersion enumItem : IpVersion.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private IpVersion(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding IpVersion item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding IpVersion item, or null if no such item exists + */ + public static IpVersion forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public enum Ipv6AddressMode implements Enumeration { + Slaac(0, "slaac"), + + Dhcpv6Stateful(1, "dhcpv6-stateful"), + + Dhcpv6Stateless(2, "dhcpv6-stateless") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Ipv6AddressMode enumItem : Ipv6AddressMode.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Ipv6AddressMode(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Ipv6AddressMode item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Ipv6AddressMode item, or null if no such item exists + */ + public static Ipv6AddressMode forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l3-protocol-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L3ProtocolData.class; + } + + /** + * Network name associated with this L3 protocol. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Specifies IP version of this L3 protocol. Value: • IPV4. • IPV6. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L3ProtocolData.IpVersion ipVersion, or null if not present + */ + @Nullable IpVersion getIpVersion(); + + /** + * Specifies the CIDR (Classless InterDomain Routing) of this L3 protocol. + * + * + * + * @return java.lang.String cidr, or null if not present + */ + @Nullable String getCidr(); + + /** + * Specifies the allocation pools with start and end IP addresses for this L3 + * protocol. + * + * + * + * @return java.util.List ipAllocationPools, or null if not present + */ + @Nullable List getIpAllocationPools(); + + /** + * Specifies the gateway IP address for this L3 protocol. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress gatewayIp, or null if not present + */ + @Nullable IpAddress getGatewayIp(); + + /** + * Indicates whether DHCP (Dynamic Host Configuration Protocol) is enabled or + * disabled for this L3 protocol. + * + * + * + * @return java.lang.Boolean dhcpEnabled, or null if not present + */ + @Nullable Boolean isDhcpEnabled(); + + /** + * Specifies IPv6 address mode. Possible values: • SLAAC. • DHCPV6-STATEFUL. • + * DHCPV6-STATELESS. May be present when the value of the ipVersion attribute is + * 'IPV6' and shall be absent otherwise. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data.L3ProtocolData.Ipv6AddressMode ipv6AddressMode, or null if not present + */ + @Nullable Ipv6AddressMode getIpv6AddressMode(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolDataBuilder.java new file mode 100644 index 0000000..e9af8c6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ip/profiles/norev/extended/vld/protocol/data/virtual/link/protocol/data/L3ProtocolDataBuilder.java @@ -0,0 +1,368 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ip.profiles.norev.extended.vld.protocol.data.virtual.link.protocol.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link L3ProtocolDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L3ProtocolDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L3ProtocolDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L3ProtocolDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L3ProtocolDataBuilder + * @see Builder + * + */ +public class L3ProtocolDataBuilder implements Builder { + + private String _cidr; + private IpAddress _gatewayIp; + private List _ipAllocationPools; + private L3ProtocolData.IpVersion _ipVersion; + private L3ProtocolData.Ipv6AddressMode _ipv6AddressMode; + private String _name; + private Boolean _dhcpEnabled; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L3ProtocolDataBuilder() { + } + + public L3ProtocolDataBuilder(L3ProtocolData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cidr = base.getCidr(); + this._gatewayIp = base.getGatewayIp(); + this._ipAllocationPools = base.getIpAllocationPools(); + this._ipVersion = base.getIpVersion(); + this._ipv6AddressMode = base.getIpv6AddressMode(); + this._name = base.getName(); + this._dhcpEnabled = base.isDhcpEnabled(); + } + + + public String getCidr() { + return _cidr; + } + + public IpAddress getGatewayIp() { + return _gatewayIp; + } + + public List getIpAllocationPools() { + return _ipAllocationPools; + } + + public L3ProtocolData.IpVersion getIpVersion() { + return _ipVersion; + } + + public L3ProtocolData.Ipv6AddressMode getIpv6AddressMode() { + return _ipv6AddressMode; + } + + public String getName() { + return _name; + } + + public Boolean isDhcpEnabled() { + return _dhcpEnabled; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L3ProtocolDataBuilder setCidr(final String value) { + this._cidr = value; + return this; + } + + public L3ProtocolDataBuilder setGatewayIp(final IpAddress value) { + this._gatewayIp = value; + return this; + } + public L3ProtocolDataBuilder setIpAllocationPools(final List values) { + this._ipAllocationPools = values; + return this; + } + + + public L3ProtocolDataBuilder setIpVersion(final L3ProtocolData.IpVersion value) { + this._ipVersion = value; + return this; + } + + public L3ProtocolDataBuilder setIpv6AddressMode(final L3ProtocolData.Ipv6AddressMode value) { + this._ipv6AddressMode = value; + return this; + } + + public L3ProtocolDataBuilder setName(final String value) { + this._name = value; + return this; + } + + public L3ProtocolDataBuilder setDhcpEnabled(final Boolean value) { + this._dhcpEnabled = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L3ProtocolDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L3ProtocolDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L3ProtocolDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L3ProtocolDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L3ProtocolData build() { + return new L3ProtocolDataImpl(this); + } + + private static final class L3ProtocolDataImpl + extends AbstractAugmentable + implements L3ProtocolData { + + private final String _cidr; + private final IpAddress _gatewayIp; + private final List _ipAllocationPools; + private final L3ProtocolData.IpVersion _ipVersion; + private final L3ProtocolData.Ipv6AddressMode _ipv6AddressMode; + private final String _name; + private final Boolean _dhcpEnabled; + + L3ProtocolDataImpl(L3ProtocolDataBuilder base) { + super(base.augmentation); + this._cidr = base.getCidr(); + this._gatewayIp = base.getGatewayIp(); + this._ipAllocationPools = base.getIpAllocationPools(); + this._ipVersion = base.getIpVersion(); + this._ipv6AddressMode = base.getIpv6AddressMode(); + this._name = base.getName(); + this._dhcpEnabled = base.isDhcpEnabled(); + } + + @Override + public String getCidr() { + return _cidr; + } + + @Override + public IpAddress getGatewayIp() { + return _gatewayIp; + } + + @Override + public List getIpAllocationPools() { + return _ipAllocationPools; + } + + @Override + public L3ProtocolData.IpVersion getIpVersion() { + return _ipVersion; + } + + @Override + public L3ProtocolData.Ipv6AddressMode getIpv6AddressMode() { + return _ipv6AddressMode; + } + + @Override + public String getName() { + return _name; + } + + @Override + public Boolean isDhcpEnabled() { + return _dhcpEnabled; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cidr); + result = prime * result + Objects.hashCode(_gatewayIp); + result = prime * result + Objects.hashCode(_ipAllocationPools); + result = prime * result + Objects.hashCode(_ipVersion); + result = prime * result + Objects.hashCode(_ipv6AddressMode); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_dhcpEnabled); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L3ProtocolData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L3ProtocolData other = (L3ProtocolData)obj; + if (!Objects.equals(_cidr, other.getCidr())) { + return false; + } + if (!Objects.equals(_gatewayIp, other.getGatewayIp())) { + return false; + } + if (!Objects.equals(_ipAllocationPools, other.getIpAllocationPools())) { + return false; + } + if (!Objects.equals(_ipVersion, other.getIpVersion())) { + return false; + } + if (!Objects.equals(_ipv6AddressMode, other.getIpv6AddressMode())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_dhcpEnabled, other.isDhcpEnabled())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L3ProtocolDataImpl otherImpl = (L3ProtocolDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L3ProtocolData"); + CodeHelpers.appendValue(helper, "_cidr", _cidr); + CodeHelpers.appendValue(helper, "_gatewayIp", _gatewayIp); + CodeHelpers.appendValue(helper, "_ipAllocationPools", _ipAllocationPools); + CodeHelpers.appendValue(helper, "_ipVersion", _ipVersion); + CodeHelpers.appendValue(helper, "_ipv6AddressMode", _ipv6AddressMode); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_dhcpEnabled", _dhcpEnabled); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..9fcfa57 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..12c3384 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:kdu", "kdu").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/kdu.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedExtCpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedExtCpd.java new file mode 100644 index 0000000..570b362 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedExtCpd.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * grouping extended-ext-cpd {
+ *   leaf k8s-cluster-net {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-ext-cpd + * + */ +public interface ExtendedExtCpd + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-ext-cpd"); + + @Override + Class implementedInterface(); + + /** + * Reference to the K8s cluster network to which CPs instantiated from this + * external CP Descriptor (CPD) connect. + * + * + * + * @return java.lang.String k8sClusterNet, or null if not present + */ + @Nullable String getK8sClusterNet(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedKdu.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedKdu.java new file mode 100644 index 0000000..84e293e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/ExtendedKdu.java @@ -0,0 +1,138 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.K8sCluster; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.Kdu; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.KduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.Service; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.ServiceKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * grouping extended-kdu {
+ *   list kdu {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     choice kdu-model {
+ *       case helm-chart {
+ *         leaf helm-chart {
+ *           type string;
+ *         }
+ *         leaf helm-version {
+ *           type enumeration {
+ *             enum v2;
+ *             enum v3;
+ *           }
+ *           default v3;
+ *         }
+ *       }
+ *       case juju-bundle {
+ *         leaf juju-bundle {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   container k8s-cluster {
+ *     leaf-list version {
+ *       type string;
+ *     }
+ *     leaf-list cni {
+ *       type enumeration {
+ *         enum calico;
+ *         enum flannel;
+ *         enum multus;
+ *       }
+ *     }
+ *     list nets {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   list service {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf mgmt-service {
+ *       type boolean;
+ *       default false;
+ *     }
+ *     leaf external-connection-point-ref {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu + * + */ +public interface ExtendedKdu + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-kdu"); + + @Override + Class implementedInterface(); + + /** + * List of K8s Deployment Units + * + * + * + * @return java.util.Map kdu, or null if not present + */ + @Nullable Map getKdu(); + + /** + * @return java.util.Map kdu, or an empty list if it is not present + */ + default @NonNull Map nonnullKdu() { + return CodeHelpers.nonnull(getKdu()); + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.K8sCluster k8sCluster, or null if not present + */ + @Nullable K8sCluster getK8sCluster(); + + /** + * List of Kubernetes services exposed by the KDU. If empty, all services are + * assumed to be exposed in the CP associated to the first network in + * k8s-cluster.nets. + * + * + * + * @return java.util.Map service, or null if not present + */ + @Nullable Map getService(); + + /** + * @return java.util.Map service, or an empty list if it is not present + */ + default @NonNull Map nonnullService() { + return CodeHelpers.nonnull(getService()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1.java new file mode 100644 index 0000000..0e4ea54 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.Vnfd; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface Vnfd1 + extends + Augmentation, + ExtendedKdu +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.Vnfd1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1Builder.java new file mode 100644 index 0000000..6e19a50 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/Vnfd1Builder.java @@ -0,0 +1,249 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev; +import com.google.common.base.MoreObjects; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.K8sCluster; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.Kdu; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.KduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.Service; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.ServiceKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Vnfd1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Vnfd1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Vnfd1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Vnfd1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Vnfd1Builder + * @see Builder + * + */ +public class Vnfd1Builder implements Builder { + + private K8sCluster _k8sCluster; + private Map _kdu; + private Map _service; + + + + public Vnfd1Builder() { + } + public Vnfd1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu arg) { + this._kdu = arg.getKdu(); + this._k8sCluster = arg.getK8sCluster(); + this._service = arg.getService(); + } + + public Vnfd1Builder(Vnfd1 base) { + this._k8sCluster = base.getK8sCluster(); + this._kdu = base.getKdu(); + this._service = base.getService(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu) { + this._kdu = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu)arg).getKdu(); + this._k8sCluster = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu)arg).getK8sCluster(); + this._service = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu)arg).getService(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu]"); + } + + public K8sCluster getK8sCluster() { + return _k8sCluster; + } + + public Map getKdu() { + return _kdu; + } + + public Map getService() { + return _service; + } + + + public Vnfd1Builder setK8sCluster(final K8sCluster value) { + this._k8sCluster = value; + return this; + } + public Vnfd1Builder setKdu(final Map values) { + this._kdu = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setKdu(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Vnfd1Builder setKdu(final List values) { + return setKdu(CodeHelpers.compatMap(values)); + } + public Vnfd1Builder setService(final Map values) { + this._service = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setService(Map)} instead. + */ + @Deprecated(forRemoval = true) + public Vnfd1Builder setService(final List values) { + return setService(CodeHelpers.compatMap(values)); + } + + + @Override + public Vnfd1 build() { + return new Vnfd1Impl(this); + } + + private static final class Vnfd1Impl + implements Vnfd1 { + + private final K8sCluster _k8sCluster; + private final Map _kdu; + private final Map _service; + + Vnfd1Impl(Vnfd1Builder base) { + this._k8sCluster = base.getK8sCluster(); + this._kdu = CodeHelpers.emptyToNull(base.getKdu()); + this._service = CodeHelpers.emptyToNull(base.getService()); + } + + @Override + public K8sCluster getK8sCluster() { + return _k8sCluster; + } + + @Override + public Map getKdu() { + return _kdu; + } + + @Override + public Map getService() { + return _service; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_k8sCluster); + result = prime * result + Objects.hashCode(_kdu); + result = prime * result + Objects.hashCode(_service); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnfd1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnfd1 other = (Vnfd1)obj; + if (!Objects.equals(_k8sCluster, other.getK8sCluster())) { + return false; + } + if (!Objects.equals(_kdu, other.getKdu())) { + return false; + } + if (!Objects.equals(_service, other.getService())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnfd1"); + CodeHelpers.appendValue(helper, "_k8sCluster", _k8sCluster); + CodeHelpers.appendValue(helper, "_kdu", _kdu); + CodeHelpers.appendValue(helper, "_service", _service); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sCluster.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sCluster.java new file mode 100644 index 0000000..b9bf5bf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sCluster.java @@ -0,0 +1,169 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster.Nets; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster.NetsKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * container k8s-cluster {
+ *   leaf-list version {
+ *     type string;
+ *   }
+ *   leaf-list cni {
+ *     type enumeration {
+ *       enum calico;
+ *       enum flannel;
+ *       enum multus;
+ *     }
+ *   }
+ *   list nets {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu/k8s-cluster + * + *

To create instances of this class use {@link K8sClusterBuilder}. + * @see K8sClusterBuilder + * + */ +public interface K8sCluster + extends + ChildOf, + Augmentable +{ + + + public enum Cni implements Enumeration { + Calico(0, "calico"), + + Flannel(1, "flannel"), + + Multus(2, "multus") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (Cni enumItem : Cni.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private Cni(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding Cni item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding Cni item, or null if no such item exists + */ + public static Cni forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("k8s-cluster"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.K8sCluster.class; + } + + /** + * List of supported K8s versions. The cluster where the KDUs will be deployed will + * have to match one of these versions. + * + * + * + * @return java.util.List version, or null if not present + */ + @Nullable List getVersion(); + + /** + * List of supported CNI plugins. The cluster where the KDUs will be deployed will + * have to use one of these CNI plugins. + * + * + * + * @return java.util.List cni, or null if not present + */ + @Nullable List getCni(); + + /** + * List of required networks in the K8s cluster. The cluster where the KDUs will be + * deployed will have to use one of these CNI plugins. + * + * + * + * @return java.util.Map nets, or null if not present + */ + @Nullable Map getNets(); + + /** + * @return java.util.Map nets, or an empty list if it is not present + */ + default @NonNull Map nonnullNets() { + return CodeHelpers.nonnull(getNets()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sClusterBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sClusterBuilder.java new file mode 100644 index 0000000..034f0b7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/K8sClusterBuilder.java @@ -0,0 +1,293 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster.Nets; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster.NetsKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link K8sClusterBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     K8sClusterBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new K8sClusterBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of K8sClusterBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see K8sClusterBuilder + * @see Builder + * + */ +public class K8sClusterBuilder implements Builder { + + private List _cni; + private Map _nets; + private List _version; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public K8sClusterBuilder() { + } + + public K8sClusterBuilder(K8sCluster base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._cni = base.getCni(); + this._nets = base.getNets(); + this._version = base.getVersion(); + } + + + public List getCni() { + return _cni; + } + + public Map getNets() { + return _nets; + } + + public List getVersion() { + return _version; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public K8sClusterBuilder setCni(final List values) { + this._cni = values; + return this; + } + + public K8sClusterBuilder setNets(final Map values) { + this._nets = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNets(Map)} instead. + */ + @Deprecated(forRemoval = true) + public K8sClusterBuilder setNets(final List values) { + return setNets(CodeHelpers.compatMap(values)); + } + public K8sClusterBuilder setVersion(final List values) { + this._version = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public K8sClusterBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public K8sClusterBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public K8sClusterBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private K8sClusterBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public K8sCluster build() { + return new K8sClusterImpl(this); + } + + private static final class K8sClusterImpl + extends AbstractAugmentable + implements K8sCluster { + + private final List _cni; + private final Map _nets; + private final List _version; + + K8sClusterImpl(K8sClusterBuilder base) { + super(base.augmentation); + this._cni = base.getCni(); + this._nets = CodeHelpers.emptyToNull(base.getNets()); + this._version = base.getVersion(); + } + + @Override + public List getCni() { + return _cni; + } + + @Override + public Map getNets() { + return _nets; + } + + @Override + public List getVersion() { + return _version; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cni); + result = prime * result + Objects.hashCode(_nets); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!K8sCluster.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + K8sCluster other = (K8sCluster)obj; + if (!Objects.equals(_cni, other.getCni())) { + return false; + } + if (!Objects.equals(_nets, other.getNets())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + K8sClusterImpl otherImpl = (K8sClusterImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("K8sCluster"); + CodeHelpers.appendValue(helper, "_cni", _cni); + CodeHelpers.appendValue(helper, "_nets", _nets); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Kdu.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Kdu.java new file mode 100644 index 0000000..3055e8f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Kdu.java @@ -0,0 +1,104 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.KduModel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * List of K8s Deployment Units + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * list kdu {
+ *   key name;
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   choice kdu-model {
+ *     case helm-chart {
+ *       leaf helm-chart {
+ *         type string;
+ *       }
+ *       leaf helm-version {
+ *         type enumeration {
+ *           enum v2;
+ *           enum v3;
+ *         }
+ *         default v3;
+ *       }
+ *     }
+ *     case juju-bundle {
+ *       leaf juju-bundle {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu/kdu + * + *

To create instances of this class use {@link KduBuilder}. + * @see KduBuilder + * @see KduKey + * + */ +public interface Kdu + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("kdu"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.Kdu.class; + } + + /** + * Unique name for the KDU + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Description of the KDU. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Indicates the KDU model, either as a helm-chart or as a juju-bundle. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.KduModel kduModel, or null if not present + */ + @Nullable KduModel getKduModel(); + + @Override + KduKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduBuilder.java new file mode 100644 index 0000000..7953493 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduBuilder.java @@ -0,0 +1,295 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.KduModel; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link KduBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     KduBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new KduBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of KduBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see KduBuilder + * @see Builder + * + */ +public class KduBuilder implements Builder { + + private String _description; + private KduModel _kduModel; + private String _name; + private KduKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public KduBuilder() { + } + + public KduBuilder(Kdu base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._name = base.getName(); + this._description = base.getDescription(); + this._kduModel = base.getKduModel(); + } + + + public KduKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public KduModel getKduModel() { + return _kduModel; + } + + public String getName() { + return _name; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public KduBuilder withKey(final KduKey key) { + this.key = key; + return this; + } + + public KduBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public KduBuilder setKduModel(final KduModel value) { + this._kduModel = value; + return this; + } + + public KduBuilder setName(final String value) { + this._name = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public KduBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public KduBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public KduBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private KduBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Kdu build() { + return new KduImpl(this); + } + + private static final class KduImpl + extends AbstractAugmentable + implements Kdu { + + private final String _description; + private final KduModel _kduModel; + private final String _name; + private final KduKey key; + + KduImpl(KduBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new KduKey(base.getName()); + } + this._name = key.getName(); + this._description = base.getDescription(); + this._kduModel = base.getKduModel(); + } + + @Override + public KduKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public KduModel getKduModel() { + return _kduModel; + } + + @Override + public String getName() { + return _name; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_kduModel); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Kdu.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Kdu other = (Kdu)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_kduModel, other.getKduModel())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + KduImpl otherImpl = (KduImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Kdu"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_kduModel", _kduModel); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduKey.java new file mode 100644 index 0000000..50f6e1e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/KduKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class KduKey + implements Identifier { + private static final long serialVersionUID = -1781471998111978536L; + private final String _name; + + + public KduKey(String _name) { + + this._name = _name; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public KduKey(KduKey source) { + this._name = source._name; + } + + + public String getName() { + return _name; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_name); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof KduKey)) { + return false; + } + final KduKey other = (KduKey) obj; + if (!Objects.equals(_name, other._name)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(KduKey.class); + CodeHelpers.appendValue(helper, "_name", _name); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Service.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Service.java new file mode 100644 index 0000000..67ed2da --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/Service.java @@ -0,0 +1,96 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.ExtendedKdu; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * List of Kubernetes services exposed by the KDU. If empty, all services are + * assumed to be exposed in the CP associated to the first network in + * k8s-cluster.nets. + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * list service {
+ *   key name;
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf mgmt-service {
+ *     type boolean;
+ *     default false;
+ *   }
+ *   leaf external-connection-point-ref {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu/service + * + *

To create instances of this class use {@link ServiceBuilder}. + * @see ServiceBuilder + * @see ServiceKey + * + */ +public interface Service + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("service"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.Service.class; + } + + /** + * Name of the Kubernetes service exposed by he KDU model + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Flag to indicate that this Kubernetes service is a mgmt service to be used for + * KDU configuration. Defaults to false (if no present). All services with + * mgmt-service set to true will be passed to the execution environment in charge + * of the KDU configuration. + * + * + * + * @return java.lang.Boolean mgmtService, or null if not present + */ + @Nullable Boolean isMgmtService(); + + /** + * String representing a leaf reference to the particular external connection + * point. This field should match + * /etsi-nfv-vnfd:vnfd/etsi-nfv-vnfd:ext-cpd/etsi-nfv-vnfd:id + * + * + * + * @return java.lang.String externalConnectionPointRef, or null if not present + */ + @Nullable String getExternalConnectionPointRef(); + + @Override + ServiceKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceBuilder.java new file mode 100644 index 0000000..09646a1 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceBuilder.java @@ -0,0 +1,295 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ServiceBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ServiceBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ServiceBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ServiceBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ServiceBuilder + * @see Builder + * + */ +public class ServiceBuilder implements Builder { + + private String _externalConnectionPointRef; + private String _name; + private Boolean _mgmtService; + private ServiceKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ServiceBuilder() { + } + + public ServiceBuilder(Service base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._name = base.getName(); + this._externalConnectionPointRef = base.getExternalConnectionPointRef(); + this._mgmtService = base.isMgmtService(); + } + + + public ServiceKey key() { + return key; + } + + public String getExternalConnectionPointRef() { + return _externalConnectionPointRef; + } + + public String getName() { + return _name; + } + + public Boolean isMgmtService() { + return _mgmtService; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ServiceBuilder withKey(final ServiceKey key) { + this.key = key; + return this; + } + + public ServiceBuilder setExternalConnectionPointRef(final String value) { + this._externalConnectionPointRef = value; + return this; + } + + public ServiceBuilder setName(final String value) { + this._name = value; + return this; + } + + public ServiceBuilder setMgmtService(final Boolean value) { + this._mgmtService = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ServiceBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ServiceBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ServiceBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ServiceBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Service build() { + return new ServiceImpl(this); + } + + private static final class ServiceImpl + extends AbstractAugmentable + implements Service { + + private final String _externalConnectionPointRef; + private final String _name; + private final Boolean _mgmtService; + private final ServiceKey key; + + ServiceImpl(ServiceBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ServiceKey(base.getName()); + } + this._name = key.getName(); + this._externalConnectionPointRef = base.getExternalConnectionPointRef(); + this._mgmtService = base.isMgmtService(); + } + + @Override + public ServiceKey key() { + return key; + } + + @Override + public String getExternalConnectionPointRef() { + return _externalConnectionPointRef; + } + + @Override + public String getName() { + return _name; + } + + @Override + public Boolean isMgmtService() { + return _mgmtService; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_externalConnectionPointRef); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_mgmtService); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Service.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Service other = (Service)obj; + if (!Objects.equals(_externalConnectionPointRef, other.getExternalConnectionPointRef())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_mgmtService, other.isMgmtService())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ServiceImpl otherImpl = (ServiceImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Service"); + CodeHelpers.appendValue(helper, "_externalConnectionPointRef", _externalConnectionPointRef); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_mgmtService", _mgmtService); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceKey.java new file mode 100644 index 0000000..e32f3c4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/ServiceKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ServiceKey + implements Identifier { + private static final long serialVersionUID = 6159412498490091992L; + private final String _name; + + + public ServiceKey(String _name) { + + this._name = _name; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ServiceKey(ServiceKey source) { + this._name = source._name; + } + + + public String getName() { + return _name; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_name); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ServiceKey)) { + return false; + } + final ServiceKey other = (ServiceKey) obj; + if (!Objects.equals(_name, other._name)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ServiceKey.class); + CodeHelpers.appendValue(helper, "_name", _name); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/Nets.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/Nets.java new file mode 100644 index 0000000..27bf854 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/Nets.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.K8sCluster; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * List of required networks in the K8s cluster. The cluster where the KDUs will + * deployed will have to use one of these CNI plugins. + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * list nets {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu/k8s-cluster/nets + * + *

To create instances of this class use {@link NetsBuilder}. + * @see NetsBuilder + * @see NetsKey + * + */ +public interface Nets + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nets"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster.Nets.class; + } + + /** + * Internal identifier for the K8s cluster network in this VNF + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + @Override + NetsKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsBuilder.java new file mode 100644 index 0000000..b3e67c8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NetsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NetsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NetsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NetsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NetsBuilder + * @see Builder + * + */ +public class NetsBuilder implements Builder { + + private String _id; + private NetsKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NetsBuilder() { + } + + public NetsBuilder(Nets base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + } + + + public NetsKey key() { + return key; + } + + public String getId() { + return _id; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NetsBuilder withKey(final NetsKey key) { + this.key = key; + return this; + } + + public NetsBuilder setId(final String value) { + this._id = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NetsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NetsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NetsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NetsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nets build() { + return new NetsImpl(this); + } + + private static final class NetsImpl + extends AbstractAugmentable + implements Nets { + + private final String _id; + private final NetsKey key; + + NetsImpl(NetsBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NetsKey(base.getId()); + } + this._id = key.getId(); + } + + @Override + public NetsKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nets.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nets other = (Nets)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NetsImpl otherImpl = (NetsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nets"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsKey.java new file mode 100644 index 0000000..779f2b0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/k8s/cluster/NetsKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.k8s.cluster; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NetsKey + implements Identifier { + private static final long serialVersionUID = -8522176258253854917L; + private final String _id; + + + public NetsKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NetsKey(NetsKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NetsKey)) { + return false; + } + final NetsKey other = (NetsKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NetsKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/KduModel.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/KduModel.java new file mode 100644 index 0000000..a5ea155 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/KduModel.java @@ -0,0 +1,48 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.Kdu; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Indicates the KDU model, either as a helm-chart or as a juju-bundle. + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * choice kdu-model {
+ *   case helm-chart {
+ *     leaf helm-chart {
+ *       type string;
+ *     }
+ *     leaf helm-version {
+ *       type enumeration {
+ *         enum v2;
+ *         enum v3;
+ *       }
+ *       default v3;
+ *     }
+ *   }
+ *   case juju-bundle {
+ *     leaf juju-bundle {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu/kdu/kdu-model + * + */ +public interface KduModel + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("kdu-model"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChart.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChart.java new file mode 100644 index 0000000..9344448 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChart.java @@ -0,0 +1,140 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.kdu.model; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.KduModel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * case helm-chart {
+ *   leaf helm-chart {
+ *     type string;
+ *   }
+ *   leaf helm-version {
+ *     type enumeration {
+ *       enum v2;
+ *       enum v3;
+ *     }
+ *     default v3;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu/kdu/kdu-model/helm-chart + * + */ +public interface HelmChart + extends + DataObject, + Augmentable, + KduModel +{ + + + public enum HelmVersion implements Enumeration { + V2(0, "v2"), + + V3(1, "v3") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (HelmVersion enumItem : HelmVersion.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private HelmVersion(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding HelmVersion item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding HelmVersion item, or null if no such item exists + */ + public static HelmVersion forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("helm-chart"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.kdu.model.HelmChart.class; + } + + /** + * Helm chart that models the KDU, in any of the following ways: - + * &lt;helm-repo&gt;/&lt;helm-chart&gt; - &lt;helm-chart folder + * under k8s_models folder in the package&gt; - &lt;helm-chart tgz file (w/ + * or w/o extension) under k8s_models folder in the package&gt; - + * &lt;URL_where_to_fetch_chart&gt; + * + * + * + * @return java.lang.String helmChart, or null if not present + */ + @Nullable String getHelmChart(); + + /** + * Helm version to use for this helm-chart, v3 by default + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.kdu.model.HelmChart.HelmVersion helmVersion, or null if not present + */ + @Nullable HelmVersion getHelmVersion(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChartBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChartBuilder.java new file mode 100644 index 0000000..176e6bd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/HelmChartBuilder.java @@ -0,0 +1,250 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.kdu.model; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link HelmChartBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     HelmChartBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new HelmChartBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of HelmChartBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see HelmChartBuilder + * @see Builder + * + */ +public class HelmChartBuilder implements Builder { + + private String _helmChart; + private HelmChart.HelmVersion _helmVersion; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public HelmChartBuilder() { + } + + public HelmChartBuilder(HelmChart base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._helmChart = base.getHelmChart(); + this._helmVersion = base.getHelmVersion(); + } + + + public String getHelmChart() { + return _helmChart; + } + + public HelmChart.HelmVersion getHelmVersion() { + return _helmVersion; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public HelmChartBuilder setHelmChart(final String value) { + this._helmChart = value; + return this; + } + + public HelmChartBuilder setHelmVersion(final HelmChart.HelmVersion value) { + this._helmVersion = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public HelmChartBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public HelmChartBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public HelmChartBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private HelmChartBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public HelmChart build() { + return new HelmChartImpl(this); + } + + private static final class HelmChartImpl + extends AbstractAugmentable + implements HelmChart { + + private final String _helmChart; + private final HelmChart.HelmVersion _helmVersion; + + HelmChartImpl(HelmChartBuilder base) { + super(base.augmentation); + this._helmChart = base.getHelmChart(); + this._helmVersion = base.getHelmVersion(); + } + + @Override + public String getHelmChart() { + return _helmChart; + } + + @Override + public HelmChart.HelmVersion getHelmVersion() { + return _helmVersion; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_helmChart); + result = prime * result + Objects.hashCode(_helmVersion); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!HelmChart.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + HelmChart other = (HelmChart)obj; + if (!Objects.equals(_helmChart, other.getHelmChart())) { + return false; + } + if (!Objects.equals(_helmVersion, other.getHelmVersion())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + HelmChartImpl otherImpl = (HelmChartImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("HelmChart"); + CodeHelpers.appendValue(helper, "_helmChart", _helmChart); + CodeHelpers.appendValue(helper, "_helmVersion", _helmVersion); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundle.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundle.java new file mode 100644 index 0000000..eff65c5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundle.java @@ -0,0 +1,57 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.kdu.model; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.KduModel; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module kdu + *

+ * case juju-bundle {
+ *   leaf juju-bundle {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * kdu/extended-kdu/kdu/kdu-model/juju-bundle + * + */ +public interface JujuBundle + extends + DataObject, + Augmentable, + KduModel +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("juju-bundle"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.kdu.model.JujuBundle.class; + } + + /** + * Juju bundle that models the KDU, in any of the following ways: - + * &lt;juju-repo&gt;/&lt;juju-bundle&gt; - &lt;juju-bundle + * folder under k8s_models folder in the package&gt; - &lt;juju-bundle tgz + * file (w/ or w/o extension) under k8s_models folder in the package&gt; - + * &lt;URL_where_to_fetch_juju_bundle&gt; + * + * + * + * @return java.lang.String jujuBundle, or null if not present + */ + @Nullable String getJujuBundle(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundleBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundleBuilder.java new file mode 100644 index 0000000..0671a60 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/kdu/norev/extended/kdu/kdu/kdu/model/JujuBundleBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.kdu.norev.extended.kdu.kdu.kdu.model; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link JujuBundleBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     JujuBundleBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new JujuBundleBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of JujuBundleBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see JujuBundleBuilder + * @see Builder + * + */ +public class JujuBundleBuilder implements Builder { + + private String _jujuBundle; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public JujuBundleBuilder() { + } + + public JujuBundleBuilder(JujuBundle base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._jujuBundle = base.getJujuBundle(); + } + + + public String getJujuBundle() { + return _jujuBundle; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public JujuBundleBuilder setJujuBundle(final String value) { + this._jujuBundle = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public JujuBundleBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public JujuBundleBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public JujuBundleBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private JujuBundleBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public JujuBundle build() { + return new JujuBundleImpl(this); + } + + private static final class JujuBundleImpl + extends AbstractAugmentable + implements JujuBundle { + + private final String _jujuBundle; + + JujuBundleImpl(JujuBundleBuilder base) { + super(base.augmentation); + this._jujuBundle = base.getJujuBundle(); + } + + @Override + public String getJujuBundle() { + return _jujuBundle; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_jujuBundle); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!JujuBundle.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + JujuBundle other = (JujuBundle)obj; + if (!Objects.equals(_jujuBundle, other.getJujuBundle())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + JujuBundleImpl otherImpl = (JujuBundleImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("JujuBundle"); + CodeHelpers.appendValue(helper, "_jujuBundle", _jujuBundle); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..c599724 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..fc294a8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/$YangModuleInfoImpl.java @@ -0,0 +1,47 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments:mgmt-interface", "mgmt-interface").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/mgmt-interface.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/ExtendedMgmtInterface.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/ExtendedMgmtInterface.java new file mode 100644 index 0000000..0dec721 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/ExtendedMgmtInterface.java @@ -0,0 +1,48 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module mgmt-interface + *

+ * grouping extended-mgmt-interface {
+ *   leaf mgmt-cp {
+ *     type leafref {
+ *       path /vnfd:vnfd/vnfd:ext-cpd/vnfd:id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * mgmt-interface/extended-mgmt-interface + * + */ +public interface ExtendedMgmtInterface + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("extended-mgmt-interface"); + + @Override + Class implementedInterface(); + + /** + * Connection point over which the VNF is managed. + * + * + * + * @return java.lang.String mgmtCp, or null if not present + */ + @Nullable String getMgmtCp(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1.java new file mode 100644 index 0000000..edbb9ba --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1.java @@ -0,0 +1,22 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev; +import java.lang.Class; +import java.lang.Override; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.vnfd.rev190318.Vnfd; +import org.opendaylight.yangtools.yang.binding.Augmentation; + +public interface Vnfd1 + extends + Augmentation, + ExtendedMgmtInterface +{ + + + + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev.Vnfd1.class; + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1Builder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1Builder.java new file mode 100644 index 0000000..d320fbf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/mgmt/_interface/norev/Vnfd1Builder.java @@ -0,0 +1,157 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev; +import com.google.common.base.MoreObjects; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link Vnfd1Builder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     Vnfd1Builder createTarget(int fooXyzzy, int barBaz) {
+ *         return new Vnfd1BuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of Vnfd1Builder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see Vnfd1Builder + * @see Builder + * + */ +public class Vnfd1Builder implements Builder { + + private String _mgmtCp; + + + + public Vnfd1Builder() { + } + public Vnfd1Builder(org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev.ExtendedMgmtInterface arg) { + this._mgmtCp = arg.getMgmtCp(); + } + + public Vnfd1Builder(Vnfd1 base) { + this._mgmtCp = base.getMgmtCp(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev.ExtendedMgmtInterface
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev.ExtendedMgmtInterface) { + this._mgmtCp = ((org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev.ExtendedMgmtInterface)arg).getMgmtCp(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.mgmt._interface.norev.ExtendedMgmtInterface]"); + } + + public String getMgmtCp() { + return _mgmtCp; + } + + + public Vnfd1Builder setMgmtCp(final String value) { + this._mgmtCp = value; + return this; + } + + + @Override + public Vnfd1 build() { + return new Vnfd1Impl(this); + } + + private static final class Vnfd1Impl + implements Vnfd1 { + + private final String _mgmtCp; + + Vnfd1Impl(Vnfd1Builder base) { + this._mgmtCp = base.getMgmtCp(); + } + + @Override + public String getMgmtCp() { + return _mgmtCp; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_mgmtCp); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnfd1.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnfd1 other = (Vnfd1)obj; + if (!Objects.equals(_mgmtCp, other.getMgmtCp())) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnfd1"); + CodeHelpers.appendValue(helper, "_mgmtCp", _mgmtCp); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModelBindingProvider.java new file mode 100644 index 0000000..5e94ccf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModuleInfoImpl.java new file mode 100644 index 0000000..659fbf0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/$YangModuleInfoImpl.java @@ -0,0 +1,43 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:osm:yang:augments", "common-augments").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + importedModules = ImmutableSet.of(); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/common-augments.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmProperties.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmProperties.java new file mode 100644 index 0000000..31ed080 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmProperties.java @@ -0,0 +1,204 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.math.BigDecimal; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.Actions; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping alarm-properties {
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   leaf vdur-id {
+ *     type string;
+ *   }
+ *   container actions {
+ *     list ok {
+ *       key url;
+ *       leaf url {
+ *         type string;
+ *       }
+ *     }
+ *     list insufficient-data {
+ *       key url;
+ *       leaf url {
+ *         type string;
+ *       }
+ *     }
+ *     list alarm {
+ *       key url;
+ *       leaf url {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   leaf repeat {
+ *     type boolean;
+ *     default true;
+ *   }
+ *   leaf enabled {
+ *     type boolean;
+ *     default true;
+ *   }
+ *   leaf severity {
+ *     type alarm-severity-type;
+ *   }
+ *   leaf statistic {
+ *     type alarm-statistic-type;
+ *   }
+ *   leaf operation {
+ *     type relational-operation-type;
+ *   }
+ *   leaf value {
+ *     type decimal64 {
+ *       fraction-digits 4;
+ *     }
+ *   }
+ *   leaf period {
+ *     type uint32;
+ *   }
+ *   leaf evaluations {
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/alarm-properties + * + */ +public interface AlarmProperties + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("alarm-properties"); + + @Override + Class implementedInterface(); + + /** + * A human readable string to identify the alarm + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * A description of this alarm + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * The identifier of the VDUR that the alarm is associated with + * + * + * + * @return java.lang.String vdurId, or null if not present + */ + @Nullable String getVdurId(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.Actions actions, or null if not present + */ + @Nullable Actions getActions(); + + /** + * This flag indicates whether the alarm should be repeatedly emitted while the + * associated threshold has been crossed. + * + * + * + * @return java.lang.Boolean repeat, or null if not present + */ + @Nullable Boolean isRepeat(); + + /** + * This flag indicates whether the alarm has been enabled or disabled. + * + * + * + * @return java.lang.Boolean enabled, or null if not present + */ + @Nullable Boolean isEnabled(); + + /** + * A measure of the importance or urgency of the alarm + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmSeverityType severity, or null if not present + */ + @Nullable AlarmSeverityType getSeverity(); + + /** + * The type of metric statistic that is tracked by this alarm + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmStatisticType statistic, or null if not present + */ + @Nullable AlarmStatisticType getStatistic(); + + /** + * The relational operator used to define whether an alarm should be triggered in + * certain scenarios, such as if the metric statistic goes above or below a + * specified value. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.RelationalOperationType operation, or null if not present + */ + @Nullable RelationalOperationType getOperation(); + + /** + * This value defines the threshold that, if crossed, will trigger the alarm. + * + * + * + * @return java.math.BigDecimal value, or null if not present + */ + @Nullable BigDecimal getValue(); + + /** + * The period defines the length of time (seconds) that the metric data are + * collected over in oreder to evaluate the chosen statistic. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 period, or null if not present + */ + @Nullable Uint32 getPeriod(); + + /** + * Defines the length of time (seconds) in which metric data are collected in order + * to evaluate the chosen statistic. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 evaluations, or null if not present + */ + @Nullable Uint32 getEvaluations(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmSeverityType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmSeverityType.java new file mode 100644 index 0000000..302676e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmSeverityType.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum AlarmSeverityType implements Enumeration { + LOW(0, "LOW"), + + MODERATE(1, "MODERATE"), + + CRITICAL(2, "CRITICAL") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (AlarmSeverityType enumItem : AlarmSeverityType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private AlarmSeverityType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding AlarmSeverityType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding AlarmSeverityType item, or null if no such item exists + */ + public static AlarmSeverityType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmStatisticType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmStatisticType.java new file mode 100644 index 0000000..e0742bd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/AlarmStatisticType.java @@ -0,0 +1,77 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum AlarmStatisticType implements Enumeration { + AVERAGE(0, "AVERAGE"), + + MINIMUM(1, "MINIMUM"), + + MAXIMUM(2, "MAXIMUM"), + + COUNT(3, "COUNT"), + + SUM(4, "SUM") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (AlarmStatisticType enumItem : AlarmStatisticType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private AlarmStatisticType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding AlarmStatisticType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding AlarmStatisticType item, or null if no such item exists + */ + public static AlarmStatisticType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ConfigurationMethod.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ConfigurationMethod.java new file mode 100644 index 0000000..6dfc91b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ConfigurationMethod.java @@ -0,0 +1,118 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.ConfigMethod; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping configuration-method {
+ *   choice config-method {
+ *     case script {
+ *       container script {
+ *         leaf script-type {
+ *           type enumeration {
+ *             enum rift;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case juju {
+ *       container juju {
+ *         leaf charm {
+ *           type string;
+ *         }
+ *         leaf proxy {
+ *           type boolean;
+ *           default true;
+ *         }
+ *         leaf cloud {
+ *           type enumeration {
+ *             enum lxd;
+ *             enum k8s;
+ *           }
+ *           default lxd;
+ *         }
+ *       }
+ *     }
+ *     case execution-environment-list {
+ *       list execution-environment-list {
+ *         key id;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         choice execution-environment-model {
+ *           case juju {
+ *             container juju {
+ *               leaf charm {
+ *                 type string;
+ *               }
+ *               leaf proxy {
+ *                 type boolean;
+ *                 default true;
+ *               }
+ *               leaf cloud {
+ *                 type enumeration {
+ *                   enum lxd;
+ *                   enum k8s;
+ *                 }
+ *                 default lxd;
+ *               }
+ *             }
+ *           }
+ *           case helm-chart {
+ *             leaf helm-chart {
+ *               type string;
+ *             }
+ *             leaf helm-version {
+ *               type enumeration {
+ *                 enum v2;
+ *                 enum v3;
+ *               }
+ *               default v3;
+ *             }
+ *           }
+ *         }
+ *         leaf metric-service {
+ *           type string;
+ *         }
+ *         leaf external-connection-point-ref {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/configuration-method + * + */ +public interface ConfigurationMethod + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("configuration-method"); + + @Override + Class implementedInterface(); + + /** + * Defines the configuration method for the VNF or VDU. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.ConfigMethod configMethod, or null if not present + */ + @Nullable ConfigMethod getConfigMethod(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/Description.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/Description.java new file mode 100644 index 0000000..2d9df33 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/Description.java @@ -0,0 +1,42 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping description {
+ *   leaf description {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/description + * + */ +public interface Description + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("description"); + + @Override + Class implementedInterface(); + + /** + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ParameterDataType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ParameterDataType.java new file mode 100644 index 0000000..3eaa707 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ParameterDataType.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum ParameterDataType implements Enumeration { + STRING(0, "STRING"), + + INTEGER(1, "INTEGER"), + + BOOLEAN(2, "BOOLEAN") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (ParameterDataType enumItem : ParameterDataType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private ParameterDataType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding ParameterDataType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding ParameterDataType item, or null if no such item exists + */ + public static ParameterDataType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameter.java new file mode 100644 index 0000000..014a54f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameter.java @@ -0,0 +1,124 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping primitive-parameter {
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf data-type {
+ *     type common:parameter-data-type;
+ *   }
+ *   leaf mandatory {
+ *     type boolean;
+ *     default false;
+ *   }
+ *   leaf default-value {
+ *     type string;
+ *   }
+ *   leaf parameter-pool {
+ *     type string;
+ *   }
+ *   leaf read-only {
+ *     type boolean;
+ *     default false;
+ *   }
+ *   leaf hidden {
+ *     type boolean;
+ *     default false;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/primitive-parameter + * + */ +public interface PrimitiveParameter + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("primitive-parameter"); + + @Override + Class implementedInterface(); + + /** + * Name of the parameter. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Data type associated with the name. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.ParameterDataType dataType, or null if not present + */ + @Nullable ParameterDataType getDataType(); + + /** + * Is this field mandatory + * + * + * + * @return java.lang.Boolean mandatory, or null if not present + */ + @Nullable Boolean isMandatory(); + + /** + * The default value for this field + * + * + * + * @return java.lang.String defaultValue, or null if not present + */ + @Nullable String getDefaultValue(); + + /** + * NSD parameter pool name to use for this parameter + * + * + * + * @return java.lang.String parameterPool, or null if not present + */ + @Nullable String getParameterPool(); + + /** + * The value should be dimmed by the UI. Only applies to parameters with default + * values. + * + * + * + * @return java.lang.Boolean readOnly, or null if not present + */ + @Nullable Boolean isReadOnly(); + + /** + * The value should be hidden by the UI. Only applies to parameters with default + * values. + * + * + * + * @return java.lang.Boolean hidden, or null if not present + */ + @Nullable Boolean isHidden(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameterValue.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameterValue.java new file mode 100644 index 0000000..5ab3e9b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/PrimitiveParameterValue.java @@ -0,0 +1,65 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.primitive.parameter.value.Parameter; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.primitive.parameter.value.ParameterKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping primitive-parameter-value {
+ *   list parameter {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf data-type {
+ *       type common:parameter-data-type;
+ *     }
+ *     leaf value {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/primitive-parameter-value + * + */ +public interface PrimitiveParameterValue + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("primitive-parameter-value"); + + @Override + Class implementedInterface(); + + /** + * List of parameters to the configuration primitive. + * + * + * + * @return java.util.Map parameter, or null if not present + */ + @Nullable Map getParameter(); + + /** + * @return java.util.Map parameter, or an empty list if it is not present + */ + default @NonNull Map nonnullParameter() { + return CodeHelpers.nonnull(getParameter()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/RelationalOperationType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/RelationalOperationType.java new file mode 100644 index 0000000..da1bee7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/RelationalOperationType.java @@ -0,0 +1,77 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum RelationalOperationType implements Enumeration { + GE(0, "GE"), + + LE(1, "LE"), + + GT(2, "GT"), + + LT(3, "LT"), + + EQ(4, "EQ") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (RelationalOperationType enumItem : RelationalOperationType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private RelationalOperationType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding RelationalOperationType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding RelationalOperationType item, or null if no such item exists + */ + public static RelationalOperationType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingCriteriaOperation.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingCriteriaOperation.java new file mode 100644 index 0000000..ee357f7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingCriteriaOperation.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum ScalingCriteriaOperation implements Enumeration { + AND(1, "AND"), + + OR(2, "OR") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (ScalingCriteriaOperation enumItem : ScalingCriteriaOperation.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private ScalingCriteriaOperation(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding ScalingCriteriaOperation item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding ScalingCriteriaOperation item, or null if no such item exists + */ + public static ScalingCriteriaOperation forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingPolicyType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingPolicyType.java new file mode 100644 index 0000000..6e8c1c6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingPolicyType.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum ScalingPolicyType implements Enumeration { + Manual(1, "manual"), + + Automatic(2, "automatic") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (ScalingPolicyType enumItem : ScalingPolicyType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private ScalingPolicyType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding ScalingPolicyType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding ScalingPolicyType item, or null if no such item exists + */ + public static ScalingPolicyType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingTrigger.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingTrigger.java new file mode 100644 index 0000000..b651997 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/ScalingTrigger.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum ScalingTrigger implements Enumeration { + PreScaleIn(1, "pre-scale-in"), + + PostScaleIn(2, "post-scale-in"), + + PreScaleOut(3, "pre-scale-out"), + + PostScaleOut(4, "post-scale-out") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (ScalingTrigger enumItem : ScalingTrigger.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private ScalingTrigger(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding ScalingTrigger item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding ScalingTrigger item, or null if no such item exists + */ + public static ScalingTrigger forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VduConfigAccess.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VduConfigAccess.java new file mode 100644 index 0000000..d86abcd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VduConfigAccess.java @@ -0,0 +1,55 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vdu.config.access.ConfigAccess; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping vdu-config-access {
+ *   container config-access {
+ *     container ssh-access {
+ *       leaf required {
+ *         type boolean;
+ *         default false;
+ *       }
+ *       leaf default-user {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/vdu-config-access + * + */ +public interface VduConfigAccess + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vdu-config-access"); + + @Override + Class implementedInterface(); + + /** + * Indicates the way to access to the xNF or xDU for VCA configuration. For the + * moment there is a single way (ssh-access). + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vdu.config.access.ConfigAccess configAccess, or null if not present + */ + @Nullable ConfigAccess getConfigAccess(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VirtualInterface.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VirtualInterface.java new file mode 100644 index 0000000..8c8854b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VirtualInterface.java @@ -0,0 +1,63 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping virtual-interface {
+ *   container virtual-interface {
+ *     leaf type {
+ *       type enumeration {
+ *         enum PARAVIRT;
+ *         enum OM-MGMT;
+ *         enum PCI-PASSTHROUGH;
+ *         enum SR-IOV;
+ *         enum VIRTIO;
+ *         enum E1000;
+ *         enum RTL8139;
+ *         enum PCNET;
+ *       }
+ *       default PARAVIRT;
+ *     }
+ *     leaf vpci {
+ *       type string;
+ *     }
+ *     leaf bandwidth {
+ *       type uint64;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/virtual-interface + * + */ +public interface VirtualInterface + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-interface"); + + @Override + Class implementedInterface(); + + /** + * Container for the virtual interface properties + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.virtual._interface.VirtualInterface virtualInterface, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.virtual._interface.@Nullable VirtualInterface getVirtualInterface(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcConfiguration.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcConfiguration.java new file mode 100644 index 0000000..9140159 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcConfiguration.java @@ -0,0 +1,158 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.ConfigPrimitive; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.ConfigPrimitiveKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.InitialConfigPrimitive; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.InitialConfigPrimitiveKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.TerminateConfigPrimitive; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.configuration.TerminateConfigPrimitiveKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Common information in the descriptors for NS, VNF or VDU configuration. Note: + * the NS contains multiple instances of the same VNF or VDU, each instance could + * have a different configuration. + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping vnfc-configuration {
+ *   uses common:configuration-method;
+ *   list config-primitive {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf execution-environment-ref {
+ *       type leafref {
+ *         path ../../execution-environment-list/id;
+ *       }
+ *     }
+ *     leaf execution-environment-primitive {
+ *       type string;
+ *     }
+ *     list parameter {
+ *       key name;
+ *       uses primitive-parameter;
+ *     }
+ *     leaf user-defined-script {
+ *       type string;
+ *     }
+ *   }
+ *   list initial-config-primitive {
+ *     key seq;
+ *     leaf seq {
+ *       type uint64;
+ *     }
+ *     choice primitive-type {
+ *       case primitive-definition {
+ *         leaf name {
+ *           type string;
+ *         }
+ *         leaf execution-environment-ref {
+ *           type leafref {
+ *             path ../../execution-environment-list/id;
+ *           }
+ *         }
+ *         uses primitive-parameter-value;
+ *         leaf user-defined-script {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list terminate-config-primitive {
+ *     key seq;
+ *     leaf seq {
+ *       type uint64;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf execution-environment-ref {
+ *       type leafref {
+ *         path ../../execution-environment-list/id;
+ *       }
+ *     }
+ *     uses primitive-parameter-value;
+ *     leaf user-defined-script {
+ *       type string;
+ *     }
+ *   }
+ *   uses common:vnfc-metrics;
+ * }
+ * 
The schema path to identify an instance is + * common-augments/vnfc-configuration + * + */ +public interface VnfcConfiguration + extends + DataObject, + ConfigurationMethod, + VnfcMetrics +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfc-configuration"); + + @Override + Class implementedInterface(); + + /** + * List of config primitives supported by the configuration agent for this VNF or + * VDU. + * + * + * + * @return java.util.Map configPrimitive, or null if not present + */ + @Nullable Map getConfigPrimitive(); + + /** + * @return java.util.Map configPrimitive, or an empty list if it is not present + */ + default @NonNull Map nonnullConfigPrimitive() { + return CodeHelpers.nonnull(getConfigPrimitive()); + } + + /** + * Initial set of configuration primitives. + * + * + * + * @return java.util.Map initialConfigPrimitive, or null if not present + */ + @Nullable Map getInitialConfigPrimitive(); + + /** + * @return java.util.Map initialConfigPrimitive, or an empty list if it is not present + */ + default @NonNull Map nonnullInitialConfigPrimitive() { + return CodeHelpers.nonnull(getInitialConfigPrimitive()); + } + + /** + * Terminate set of configuration primitives. + * + * + * + * @return java.util.Map terminateConfigPrimitive, or null if not present + */ + @Nullable Map getTerminateConfigPrimitive(); + + /** + * @return java.util.Map terminateConfigPrimitive, or an empty list if it is not present + */ + default @NonNull Map nonnullTerminateConfigPrimitive() { + return CodeHelpers.nonnull(getTerminateConfigPrimitive()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcMetrics.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcMetrics.java new file mode 100644 index 0000000..d00f2da --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcMetrics.java @@ -0,0 +1,60 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.metrics.Metrics; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.metrics.MetricsKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Information about the VNF or VDU metrics + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping vnfc-metrics {
+ *   list metrics {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/vnfc-metrics + * + */ +public interface VnfcMetrics + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfc-metrics"); + + @Override + Class implementedInterface(); + + /** + * List of VNFC related metrics + * + * + * + * @return java.util.Map metrics, or null if not present + */ + @Nullable Map getMetrics(); + + /** + * @return java.util.Map metrics, or an empty list if it is not present + */ + default @NonNull Map nonnullMetrics() { + return CodeHelpers.nonnull(getMetrics()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcRelations.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcRelations.java new file mode 100644 index 0000000..be6f861 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/VnfcRelations.java @@ -0,0 +1,68 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.relations.Relation; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.vnfc.relations.RelationKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * grouping vnfc-relations {
+ *   list relation {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     list entities {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf endpoint {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/vnfc-relations + * + */ +public interface VnfcRelations + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfc-relations"); + + @Override + Class implementedInterface(); + + /** + * List of relations between elements in this descriptor. + * + * + * + * @return java.util.Map relation, or null if not present + */ + @Nullable Map getRelation(); + + /** + * @return java.util.Map relation, or an empty list if it is not present + */ + default @NonNull Map nonnullRelation() { + return CodeHelpers.nonnull(getRelation()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/Actions.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/Actions.java new file mode 100644 index 0000000..18e35dd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/Actions.java @@ -0,0 +1,104 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.AlarmProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.Alarm; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.AlarmKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.InsufficientData; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.InsufficientDataKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.Ok; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.OkKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * container actions {
+ *   list ok {
+ *     key url;
+ *     leaf url {
+ *       type string;
+ *     }
+ *   }
+ *   list insufficient-data {
+ *     key url;
+ *     leaf url {
+ *       type string;
+ *     }
+ *   }
+ *   list alarm {
+ *     key url;
+ *     leaf url {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/alarm-properties/actions + * + *

To create instances of this class use {@link ActionsBuilder}. + * @see ActionsBuilder + * + */ +public interface Actions + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("actions"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.Actions.class; + } + + /** + * @return java.util.Map ok, or null if not present + */ + @Nullable Map getOk(); + + /** + * @return java.util.Map ok, or an empty list if it is not present + */ + default @NonNull Map nonnullOk() { + return CodeHelpers.nonnull(getOk()); + } + + /** + * @return java.util.Map insufficientData, or null if not present + */ + @Nullable Map getInsufficientData(); + + /** + * @return java.util.Map insufficientData, or an empty list if it is not present + */ + default @NonNull Map nonnullInsufficientData() { + return CodeHelpers.nonnull(getInsufficientData()); + } + + /** + * @return java.util.Map alarm, or null if not present + */ + @Nullable Map getAlarm(); + + /** + * @return java.util.Map alarm, or an empty list if it is not present + */ + default @NonNull Map nonnullAlarm() { + return CodeHelpers.nonnull(getAlarm()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/ActionsBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/ActionsBuilder.java new file mode 100644 index 0000000..5053a62 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/ActionsBuilder.java @@ -0,0 +1,331 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.Alarm; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.AlarmKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.InsufficientData; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.InsufficientDataKey; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.Ok; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.OkKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ActionsBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ActionsBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ActionsBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ActionsBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ActionsBuilder + * @see Builder + * + */ +public class ActionsBuilder implements Builder { + + private Map _alarm; + private Map _insufficientData; + private Map _ok; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ActionsBuilder() { + } + + public ActionsBuilder(Actions base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._alarm = base.getAlarm(); + this._insufficientData = base.getInsufficientData(); + this._ok = base.getOk(); + } + + + public Map getAlarm() { + return _alarm; + } + + public Map getInsufficientData() { + return _insufficientData; + } + + public Map getOk() { + return _ok; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ActionsBuilder setAlarm(final Map values) { + this._alarm = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAlarm(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ActionsBuilder setAlarm(final List values) { + return setAlarm(CodeHelpers.compatMap(values)); + } + public ActionsBuilder setInsufficientData(final Map values) { + this._insufficientData = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setInsufficientData(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ActionsBuilder setInsufficientData(final List values) { + return setInsufficientData(CodeHelpers.compatMap(values)); + } + public ActionsBuilder setOk(final Map values) { + this._ok = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setOk(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ActionsBuilder setOk(final List values) { + return setOk(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ActionsBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ActionsBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ActionsBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ActionsBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Actions build() { + return new ActionsImpl(this); + } + + private static final class ActionsImpl + extends AbstractAugmentable + implements Actions { + + private final Map _alarm; + private final Map _insufficientData; + private final Map _ok; + + ActionsImpl(ActionsBuilder base) { + super(base.augmentation); + this._alarm = CodeHelpers.emptyToNull(base.getAlarm()); + this._insufficientData = CodeHelpers.emptyToNull(base.getInsufficientData()); + this._ok = CodeHelpers.emptyToNull(base.getOk()); + } + + @Override + public Map getAlarm() { + return _alarm; + } + + @Override + public Map getInsufficientData() { + return _insufficientData; + } + + @Override + public Map getOk() { + return _ok; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_alarm); + result = prime * result + Objects.hashCode(_insufficientData); + result = prime * result + Objects.hashCode(_ok); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Actions.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Actions other = (Actions)obj; + if (!Objects.equals(_alarm, other.getAlarm())) { + return false; + } + if (!Objects.equals(_insufficientData, other.getInsufficientData())) { + return false; + } + if (!Objects.equals(_ok, other.getOk())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ActionsImpl otherImpl = (ActionsImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Actions"); + CodeHelpers.appendValue(helper, "_alarm", _alarm); + CodeHelpers.appendValue(helper, "_insufficientData", _insufficientData); + CodeHelpers.appendValue(helper, "_ok", _ok); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Alarm.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Alarm.java new file mode 100644 index 0000000..be80e00 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Alarm.java @@ -0,0 +1,58 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.Actions; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * list alarm {
+ *   key url;
+ *   leaf url {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/alarm-properties/actions/alarm + * + *

To create instances of this class use {@link AlarmBuilder}. + * @see AlarmBuilder + * @see AlarmKey + * + */ +public interface Alarm + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("alarm"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.Alarm.class; + } + + /** + * @return java.lang.String url, or null if not present + */ + @Nullable String getUrl(); + + @Override + AlarmKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmBuilder.java new file mode 100644 index 0000000..f38c765 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AlarmBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AlarmBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AlarmBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AlarmBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AlarmBuilder + * @see Builder + * + */ +public class AlarmBuilder implements Builder { + + private String _url; + private AlarmKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AlarmBuilder() { + } + + public AlarmBuilder(Alarm base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._url = base.getUrl(); + } + + + public AlarmKey key() { + return key; + } + + public String getUrl() { + return _url; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AlarmBuilder withKey(final AlarmKey key) { + this.key = key; + return this; + } + + public AlarmBuilder setUrl(final String value) { + this._url = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AlarmBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AlarmBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AlarmBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AlarmBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Alarm build() { + return new AlarmImpl(this); + } + + private static final class AlarmImpl + extends AbstractAugmentable + implements Alarm { + + private final String _url; + private final AlarmKey key; + + AlarmImpl(AlarmBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AlarmKey(base.getUrl()); + } + this._url = key.getUrl(); + } + + @Override + public AlarmKey key() { + return key; + } + + @Override + public String getUrl() { + return _url; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_url); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Alarm.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Alarm other = (Alarm)obj; + if (!Objects.equals(_url, other.getUrl())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AlarmImpl otherImpl = (AlarmImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Alarm"); + CodeHelpers.appendValue(helper, "_url", _url); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmKey.java new file mode 100644 index 0000000..ce636ce --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/AlarmKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AlarmKey + implements Identifier { + private static final long serialVersionUID = 5352316849637502229L; + private final String _url; + + + public AlarmKey(String _url) { + + this._url = _url; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AlarmKey(AlarmKey source) { + this._url = source._url; + } + + + public String getUrl() { + return _url; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_url); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AlarmKey)) { + return false; + } + final AlarmKey other = (AlarmKey) obj; + if (!Objects.equals(_url, other._url)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AlarmKey.class); + CodeHelpers.appendValue(helper, "_url", _url); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientData.java new file mode 100644 index 0000000..505c089 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientData.java @@ -0,0 +1,58 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.Actions; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * list insufficient-data {
+ *   key url;
+ *   leaf url {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/alarm-properties/actions/insufficient-data + * + *

To create instances of this class use {@link InsufficientDataBuilder}. + * @see InsufficientDataBuilder + * @see InsufficientDataKey + * + */ +public interface InsufficientData + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("insufficient-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.InsufficientData.class; + } + + /** + * @return java.lang.String url, or null if not present + */ + @Nullable String getUrl(); + + @Override + InsufficientDataKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataBuilder.java new file mode 100644 index 0000000..4bb7d0d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link InsufficientDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     InsufficientDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new InsufficientDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of InsufficientDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see InsufficientDataBuilder + * @see Builder + * + */ +public class InsufficientDataBuilder implements Builder { + + private String _url; + private InsufficientDataKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public InsufficientDataBuilder() { + } + + public InsufficientDataBuilder(InsufficientData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._url = base.getUrl(); + } + + + public InsufficientDataKey key() { + return key; + } + + public String getUrl() { + return _url; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public InsufficientDataBuilder withKey(final InsufficientDataKey key) { + this.key = key; + return this; + } + + public InsufficientDataBuilder setUrl(final String value) { + this._url = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public InsufficientDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public InsufficientDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public InsufficientDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private InsufficientDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public InsufficientData build() { + return new InsufficientDataImpl(this); + } + + private static final class InsufficientDataImpl + extends AbstractAugmentable + implements InsufficientData { + + private final String _url; + private final InsufficientDataKey key; + + InsufficientDataImpl(InsufficientDataBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new InsufficientDataKey(base.getUrl()); + } + this._url = key.getUrl(); + } + + @Override + public InsufficientDataKey key() { + return key; + } + + @Override + public String getUrl() { + return _url; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_url); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!InsufficientData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + InsufficientData other = (InsufficientData)obj; + if (!Objects.equals(_url, other.getUrl())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + InsufficientDataImpl otherImpl = (InsufficientDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("InsufficientData"); + CodeHelpers.appendValue(helper, "_url", _url); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataKey.java new file mode 100644 index 0000000..a811b93 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/InsufficientDataKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class InsufficientDataKey + implements Identifier { + private static final long serialVersionUID = -1701498022369005341L; + private final String _url; + + + public InsufficientDataKey(String _url) { + + this._url = _url; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public InsufficientDataKey(InsufficientDataKey source) { + this._url = source._url; + } + + + public String getUrl() { + return _url; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_url); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof InsufficientDataKey)) { + return false; + } + final InsufficientDataKey other = (InsufficientDataKey) obj; + if (!Objects.equals(_url, other._url)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(InsufficientDataKey.class); + CodeHelpers.appendValue(helper, "_url", _url); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Ok.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Ok.java new file mode 100644 index 0000000..8c56875 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/Ok.java @@ -0,0 +1,58 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.Actions; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * list ok {
+ *   key url;
+ *   leaf url {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/alarm-properties/actions/ok + * + *

To create instances of this class use {@link OkBuilder}. + * @see OkBuilder + * @see OkKey + * + */ +public interface Ok + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ok"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions.Ok.class; + } + + /** + * @return java.lang.String url, or null if not present + */ + @Nullable String getUrl(); + + @Override + OkKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkBuilder.java new file mode 100644 index 0000000..78d35f4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkBuilder.java @@ -0,0 +1,248 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link OkBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     OkBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new OkBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of OkBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see OkBuilder + * @see Builder + * + */ +public class OkBuilder implements Builder { + + private String _url; + private OkKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public OkBuilder() { + } + + public OkBuilder(Ok base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._url = base.getUrl(); + } + + + public OkKey key() { + return key; + } + + public String getUrl() { + return _url; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public OkBuilder withKey(final OkKey key) { + this.key = key; + return this; + } + + public OkBuilder setUrl(final String value) { + this._url = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public OkBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public OkBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public OkBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private OkBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Ok build() { + return new OkImpl(this); + } + + private static final class OkImpl + extends AbstractAugmentable + implements Ok { + + private final String _url; + private final OkKey key; + + OkImpl(OkBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new OkKey(base.getUrl()); + } + this._url = key.getUrl(); + } + + @Override + public OkKey key() { + return key; + } + + @Override + public String getUrl() { + return _url; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_url); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Ok.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Ok other = (Ok)obj; + if (!Objects.equals(_url, other.getUrl())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + OkImpl otherImpl = (OkImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Ok"); + CodeHelpers.appendValue(helper, "_url", _url); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkKey.java new file mode 100644 index 0000000..90949c3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/alarm/properties/actions/OkKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.alarm.properties.actions; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class OkKey + implements Identifier { + private static final long serialVersionUID = -3239917283088943717L; + private final String _url; + + + public OkKey(String _url) { + + this._url = _url; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public OkKey(OkKey source) { + this._url = source._url; + } + + + public String getUrl() { + return _url; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_url); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof OkKey)) { + return false; + } + final OkKey other = (OkKey) obj; + if (!Objects.equals(_url, other._url)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(OkKey.class); + CodeHelpers.appendValue(helper, "_url", _url); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/ConfigMethod.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/ConfigMethod.java new file mode 100644 index 0000000..08e5973 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/ConfigMethod.java @@ -0,0 +1,104 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.ConfigurationMethod; +import org.opendaylight.yangtools.yang.binding.ChoiceIn; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Defines the configuration method for the VNF or VDU. + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * choice config-method {
+ *   case script {
+ *     container script {
+ *       leaf script-type {
+ *         type enumeration {
+ *           enum rift;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   case juju {
+ *     container juju {
+ *       leaf charm {
+ *         type string;
+ *       }
+ *       leaf proxy {
+ *         type boolean;
+ *         default true;
+ *       }
+ *       leaf cloud {
+ *         type enumeration {
+ *           enum lxd;
+ *           enum k8s;
+ *         }
+ *         default lxd;
+ *       }
+ *     }
+ *   }
+ *   case execution-environment-list {
+ *     list execution-environment-list {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       choice execution-environment-model {
+ *         case juju {
+ *           container juju {
+ *             leaf charm {
+ *               type string;
+ *             }
+ *             leaf proxy {
+ *               type boolean;
+ *               default true;
+ *             }
+ *             leaf cloud {
+ *               type enumeration {
+ *                 enum lxd;
+ *                 enum k8s;
+ *               }
+ *               default lxd;
+ *             }
+ *           }
+ *         }
+ *         case helm-chart {
+ *           leaf helm-chart {
+ *             type string;
+ *           }
+ *           leaf helm-version {
+ *             type enumeration {
+ *               enum v2;
+ *               enum v3;
+ *             }
+ *             default v3;
+ *           }
+ *         }
+ *       }
+ *       leaf metric-service {
+ *         type string;
+ *       }
+ *       leaf external-connection-point-ref {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/configuration-method/config-method + * + */ +public interface ConfigMethod + extends + ChoiceIn +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("config-method"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentList.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentList.java new file mode 100644 index 0000000..34cc210 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentList.java @@ -0,0 +1,100 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.ConfigMethod; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.execution.environment.list.ExecutionEnvironmentListKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * List of Execution Environments to configure or monitor VNF or VDU. + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * case execution-environment-list {
+ *   list execution-environment-list {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     choice execution-environment-model {
+ *       case juju {
+ *         container juju {
+ *           leaf charm {
+ *             type string;
+ *           }
+ *           leaf proxy {
+ *             type boolean;
+ *             default true;
+ *           }
+ *           leaf cloud {
+ *             type enumeration {
+ *               enum lxd;
+ *               enum k8s;
+ *             }
+ *             default lxd;
+ *           }
+ *         }
+ *       }
+ *       case helm-chart {
+ *         leaf helm-chart {
+ *           type string;
+ *         }
+ *         leaf helm-version {
+ *           type enumeration {
+ *             enum v2;
+ *             enum v3;
+ *           }
+ *           default v3;
+ *         }
+ *       }
+ *     }
+ *     leaf metric-service {
+ *       type string;
+ *     }
+ *     leaf external-connection-point-ref {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/configuration-method/config-method/execution-environment-list + * + */ +public interface ExecutionEnvironmentList + extends + DataObject, + Augmentable, + ConfigMethod +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("execution-environment-list"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.ExecutionEnvironmentList.class; + } + + /** + * @return java.util.Map executionEnvironmentList, or null if not present + */ + @Nullable Map getExecutionEnvironmentList(); + + /** + * @return java.util.Map executionEnvironmentList, or an empty list if it is not present + */ + default @NonNull Map nonnullExecutionEnvironmentList() { + return CodeHelpers.nonnull(getExecutionEnvironmentList()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentListBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentListBuilder.java new file mode 100644 index 0000000..bfc9294 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/ExecutionEnvironmentListBuilder.java @@ -0,0 +1,246 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.execution.environment.list.ExecutionEnvironmentListKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ExecutionEnvironmentListBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ExecutionEnvironmentListBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ExecutionEnvironmentListBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ExecutionEnvironmentListBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ExecutionEnvironmentListBuilder + * @see Builder + * + */ +public class ExecutionEnvironmentListBuilder implements Builder { + + private Map _executionEnvironmentList; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ExecutionEnvironmentListBuilder() { + } + + public ExecutionEnvironmentListBuilder(ExecutionEnvironmentList base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._executionEnvironmentList = base.getExecutionEnvironmentList(); + } + + + public Map getExecutionEnvironmentList() { + return _executionEnvironmentList; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ExecutionEnvironmentListBuilder setExecutionEnvironmentList(final Map values) { + this._executionEnvironmentList = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExecutionEnvironmentList(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ExecutionEnvironmentListBuilder setExecutionEnvironmentList(final List values) { + return setExecutionEnvironmentList(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ExecutionEnvironmentListBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ExecutionEnvironmentListBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ExecutionEnvironmentListBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ExecutionEnvironmentListBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ExecutionEnvironmentList build() { + return new ExecutionEnvironmentListImpl(this); + } + + private static final class ExecutionEnvironmentListImpl + extends AbstractAugmentable + implements ExecutionEnvironmentList { + + private final Map _executionEnvironmentList; + + ExecutionEnvironmentListImpl(ExecutionEnvironmentListBuilder base) { + super(base.augmentation); + this._executionEnvironmentList = CodeHelpers.emptyToNull(base.getExecutionEnvironmentList()); + } + + @Override + public Map getExecutionEnvironmentList() { + return _executionEnvironmentList; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_executionEnvironmentList); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ExecutionEnvironmentList.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ExecutionEnvironmentList other = (ExecutionEnvironmentList)obj; + if (!Objects.equals(_executionEnvironmentList, other.getExecutionEnvironmentList())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ExecutionEnvironmentListImpl otherImpl = (ExecutionEnvironmentListImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ExecutionEnvironmentList"); + CodeHelpers.appendValue(helper, "_executionEnvironmentList", _executionEnvironmentList); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Juju.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Juju.java new file mode 100644 index 0000000..0bb9e12 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Juju.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.ConfigMethod; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Configure the VNF or VDU through Juju. + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * case juju {
+ *   container juju {
+ *     leaf charm {
+ *       type string;
+ *     }
+ *     leaf proxy {
+ *       type boolean;
+ *       default true;
+ *     }
+ *     leaf cloud {
+ *       type enumeration {
+ *         enum lxd;
+ *         enum k8s;
+ *       }
+ *       default lxd;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/configuration-method/config-method/juju + * + */ +public interface Juju + extends + DataObject, + Augmentable, + ConfigMethod +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("juju"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.Juju.class; + } + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.juju.Juju juju, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.juju.@Nullable Juju getJuju(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/JujuBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/JujuBuilder.java new file mode 100644 index 0000000..834cac2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/JujuBuilder.java @@ -0,0 +1,227 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link JujuBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     JujuBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new JujuBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of JujuBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see JujuBuilder + * @see Builder + * + */ +public class JujuBuilder implements Builder { + + private org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.juju.Juju _juju; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public JujuBuilder() { + } + + public JujuBuilder(Juju base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._juju = base.getJuju(); + } + + + public org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.juju.Juju getJuju() { + return _juju; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public JujuBuilder setJuju(final org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.juju.Juju value) { + this._juju = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public JujuBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public JujuBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public JujuBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private JujuBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Juju build() { + return new JujuImpl(this); + } + + private static final class JujuImpl + extends AbstractAugmentable + implements Juju { + + private final org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.juju.Juju _juju; + + JujuImpl(JujuBuilder base) { + super(base.augmentation); + this._juju = base.getJuju(); + } + + @Override + public org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method.juju.Juju getJuju() { + return _juju; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_juju); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Juju.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Juju other = (Juju)obj; + if (!Objects.equals(_juju, other.getJuju())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + JujuImpl otherImpl = (JujuImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Juju"); + CodeHelpers.appendValue(helper, "_juju", _juju); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Script.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Script.java new file mode 100644 index 0000000..6182735 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/norev/configuration/method/config/method/Script.java @@ -0,0 +1,54 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.config.method; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.norev.configuration.method.ConfigMethod; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Use custom script for configuring the VNF or VDU. This script is executed in + * context of Orchestrator (The same system and environment as the Launchpad). + * + *

+ * This class represents the following YANG schema fragment defined in module common-augments + *

+ * case script {
+ *   container script {
+ *     leaf script-type {
+ *       type enumeration {
+ *         enum rift;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * common-augments/configuration-method/config-method/script + * + */ +public interface Script + extends + DataObject, + Augmentable