import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev170315.dhcp.attributes.relays.RelayBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev170315.dhcp.attributes.relays.RelayKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev170315.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private IpAddress gatewayIpAddress;
private List<Server> serverIpAddresses;
private Class<? extends AddressFamily> addressType;
+ private NodeId vppNodeId;
private DhcpRelayCommand(DhcpRelayBuilder builder) {
operation = builder.getOperation();
gatewayIpAddress = builder.getGatewayIpAddress();
serverIpAddresses = builder.getServerIpAddresses();
addressType = builder.getAddressType();
+ vppNodeId = builder.getVppNodeId();
}
public static DhcpRelayBuilder builder() {
return VppIidFactory.getDhcpRelayIid(getDhcpBuilder().getKey());
}
+ public NodeId getVppNodeId() {
+ return vppNodeId;
+ }
+
void put(ReadWriteTransaction rwTx) {
rwTx.put(LogicalDatastoreType.CONFIGURATION, getIid(), getDhcpBuilder().build(), true);
}
+ ", operations=" + operation + "]";
}
+ /**
+ * Compares two DhcpRelayCommands without checking operation status.
+ * @param compareTo DhcpRelayCommand to compare with.
+ * @return true if commands match, false otherwise.
+ */
+ @Override public boolean equals(Object compareTo) {
+ if (compareTo == null || !compareTo.getClass().equals(this.getClass())) {
+ return false;
+ }
+
+ DhcpRelayCommand command = (DhcpRelayCommand) compareTo;
+
+ if (!this.getVppNodeId().equals(command.getVppNodeId())) {
+ return false;
+ } else if (!this.getAddressType().equals(command.getAddressType())) {
+ return false;
+ } else if (!this.getGatewayIpAddress().equals(command.getGatewayIpAddress())) {
+ return false;
+ } else if (!this.getIid().equals(command.getIid())) {
+ return false;
+ } else if (!this.getRxVrfId().equals(command.getRxVrfId())) {
+ return false;
+ } else if (this.getServerIpAddresses() != null && !this.getServerIpAddresses()
+ .containsAll(command.getServerIpAddresses())) {
+ return false;
+ } else if (command.getServerIpAddresses() != null && !command.getServerIpAddresses()
+ .containsAll(this.getServerIpAddresses())) {
+ return false;
+ }
+
+ return true;
+ }
+
public RelayBuilder getDhcpBuilder() {
return new RelayBuilder()
.setAddressType(addressType)
private IpAddress gatewayIpAddress;
private List<Server> serverIpAddress;
private Class<? extends AddressFamily> addressType;
+ private NodeId VppNodeId;
public General.Operations getOperation() {
return operation;
return this;
}
+ public NodeId getVppNodeId() {
+ return VppNodeId;
+ }
+
+ public DhcpRelayBuilder setVppNodeId(NodeId vppNodeId) {
+ VppNodeId = vppNodeId;
+ return this;
+ }
+
/**
* RoutingCommand build method.
*