private BoundServicesImpl(BoundServicesBuilder base) { if (base.getKey() == null) { this._key = new BoundServicesKey( base.getServicePriority() ); this._servicePriority = base.getServicePriority(); } else { this._key = base.getKey(); this._servicePriority = _key.getServicePriority(); } this._serviceName = base.getServiceName(); this._serviceType = base.getServiceType(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public BoundServicesBuilder(BoundServices base) { if (base.getKey() == null) { this._key = new BoundServicesKey( base.getServicePriority() ); this._servicePriority = base.getServicePriority(); } else { this._key = base.getKey(); this._servicePriority = _key.getServicePriority(); } this._serviceName = base.getServiceName(); this._serviceType = base.getServiceType(); if (base instanceof BoundServicesImpl) { BoundServicesImpl impl = (BoundServicesImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private InstanceIdentifier buildServiceId(String interfaceName, short priority) { return InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, new ServicesInfoKey(interfaceName, ServiceModeIngress.class)) .child(BoundServices.class, new BoundServicesKey(priority)).build(); }
public static InstanceIdentifier<BoundServices> buildServiceId(String vpnInterfaceName, short serviceIndex) { return InstanceIdentifier.builder(ServiceBindings.class) .child(ServicesInfo.class, new ServicesInfoKey(vpnInterfaceName, ServiceModeIngress.class)) .child(BoundServices.class, new BoundServicesKey(serviceIndex)).build(); }
/** * Builds the service id. * * @param interfaceName the interface name * @param serviceIndex the service index * @param serviceMode the service mode * @return the instance identifier */ public static InstanceIdentifier<BoundServices> buildServiceId(String interfaceName, short serviceIndex, Class<? extends ServiceModeBase> serviceMode) { return InstanceIdentifier.builder(ServiceBindings.class) .child(ServicesInfo.class, new ServicesInfoKey(interfaceName, serviceMode)) .child(BoundServices.class, new BoundServicesKey(serviceIndex)).build(); }
public static InstanceIdentifier<BoundServices> buildServiceId(String vpnInterfaceName, short serviceIndex) { return InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, new ServicesInfoKey(vpnInterfaceName, ServiceModeIngress.class)) .child(BoundServices.class, new BoundServicesKey(serviceIndex)).build(); }
public static BoundServices getBoundServices(String serviceName, short servicePriority, int flowPriority, BigInteger cookie, List<Instruction> instructions) { StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority).setInstruction(instructions); return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)) .setServiceName(serviceName).setServicePriority(servicePriority) .setServiceType(ServiceTypeFlowBased.class).addAugmentation(StypeOpenflow.class, augBuilder.build()).build(); }
public static BoundServices getBoundServices(String serviceName, short servicePriority, int flowPriority, BigInteger cookie, List<Instruction> instructions) { StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority).setInstruction(instructions); return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)) .setServiceName(serviceName).setServicePriority(servicePriority) .setServiceType(ServiceTypeFlowBased.class).addAugmentation(StypeOpenflow.class, augBuilder.build()).build(); }
public BoundServices getBoundServices(String serviceName, short servicePriority, int flowPriority, BigInteger cookie, List<Instruction> instructions) { StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie) .setFlowPriority(flowPriority).setInstruction(instructions); return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)) .setServiceName(serviceName).setServicePriority(servicePriority) .setServiceType(ServiceTypeFlowBased.class) .addAugmentation(StypeOpenflow.class, augBuilder.build()).build(); }
public static BoundServices getBoundServices(String serviceName, short servicePriority, int flowPriority, BigInteger cookie, List<Instruction> instructions) { StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority) .setInstruction(instructions); return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName) .setServicePriority(servicePriority).setServiceType(ServiceTypeFlowBased.class) .addAugmentation(StypeOpenflow.class, augBuilder.build()).build(); }
/** * Gets the bound services. * * @param serviceName the service name * @param servicePriority the service priority * @param flowPriority the flow priority * @param cookie the cookie * @param instructions the instructions * @return the bound services */ public static BoundServices getBoundServices(String serviceName, short servicePriority, int flowPriority, BigInteger cookie, List<Instruction> instructions) { StypeOpenflowBuilder augBuilder = new StypeOpenflowBuilder().setFlowCookie(cookie).setFlowPriority(flowPriority) .setInstruction(instructions); return new BoundServicesBuilder().setKey(new BoundServicesKey(servicePriority)).setServiceName(serviceName) .setServicePriority(servicePriority).setServiceType(ServiceTypeFlowBased.class) .addAugmentation(StypeOpenflow.class, augBuilder.build()).build(); }