Rework IOVisor model and validate IovisorModuleInstance on Endpoint created events
[groupbasedpolicy.git] / renderers / iovisor / src / main / java / org / opendaylight / groupbasedpolicy / renderer / iovisor / utils / IovisorIidFactory.java
1 /*
2  * Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor.utils;
10
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.IovisorModuleInstances;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.module.instances.IovisorModuleInstance;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.module.instances.IovisorModuleInstanceKey;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15
16
17 public class IovisorIidFactory {
18
19     private IovisorIidFactory() {
20     }
21
22     private static final InstanceIdentifier<IovisorModuleInstances> IOVISOR_MODULE_INSTANCES_IID = InstanceIdentifier.builder(IovisorModuleInstances.class).build();
23
24     /**
25      * @return The {@link InstanceIdentifier} of the {@link IovisorModuleInstances}
26      */
27     public static InstanceIdentifier<IovisorModuleInstances> iovisorModuleInstancesIid() {
28         return IOVISOR_MODULE_INSTANCES_IID;
29     }
30
31     /**
32      * Return the InstanceIdentifier for a specific IovisorModuleInstance.
33      * @param iovisorModuleInstanceKey The key of the {@link IovisorModuleInstance} we want to retrieve.
34      * @return The {@link InstanceIdentifier} of the {@link IovisorModuleInstance}
35      */
36     public static InstanceIdentifier<IovisorModuleInstance> iovisorModuleInstanceIid(IovisorModuleInstanceKey iovisorModuleInstanceKey) {
37         return IOVISOR_MODULE_INSTANCES_IID.child(IovisorModuleInstance.class, iovisorModuleInstanceKey);
38     }
39 }