2 * Copyright (c) 2017 Cisco Systems. All rights reserved.
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
8 package org.opendaylight.groupbasedpolicy.renderer.vpp.lisp.info.container.states;
10 import org.apache.commons.lang3.mutable.MutableLong;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
14 * Created by Shakib Ahmed on 7/17/17.
16 public class VrfState {
17 private SubnetHolder subnetHolder;
18 private String protocolName;
19 private MutableLong nextRouteId;
21 public VrfState(String routingProtocolName) {
22 this.subnetHolder = new SubnetHolder();
23 this.protocolName = routingProtocolName;
24 this.nextRouteId = new MutableLong(1L);
27 public SubnetHolder getSubnetHolder() {
31 public String getProtocolName() {
35 public long getNextRouteId() {
36 return nextRouteId.getValue();
39 public void addNewPortIpInVrf(String portSubnetUuid, Ipv4Address portIp) {
40 subnetHolder.getSubnetState(portSubnetUuid).addNewIp(portIp);
41 nextRouteId.increment();
44 public void removePortIpFromVrf(String portSubnetUuid, Ipv4Address portIp) {
45 subnetHolder.getSubnetState(portSubnetUuid).removeIp(portIp);