import static org.opendaylight.groupbasedpolicy.renderer.vpp.util.VppIidFactory.getVppRendererConfig;
+import com.google.common.base.Optional;
+import com.google.common.collect.SetMultimap;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Optional;
-import com.google.common.collect.SetMultimap;
-
public class DhcpRelayHandler {
private static final Logger LOG = LoggerFactory.getLogger(DhcpRelayHandler.class);
public boolean submitDhcpRelay(DhcpRelayCommand dhcpRelayCommand) {
LOG.trace("Submitting DhcpRelay command: {}, nodeId: {}", dhcpRelayCommand, dhcpRelayCommand.getVppNodeId());
+ if (dhcpRelayCommand.getServerIpAddresses().isEmpty() || dhcpRelayCommand.getGatewayIpAddress() == null
+ || dhcpRelayCommand.getVppNodeId() == null) {
+ LOG.warn("Cannot submit DHCP Relay. dhcpRelayCommand: {}, nodeId: {}.", dhcpRelayCommand,
+ dhcpRelayCommand.getVppNodeId());
+ return false;
+ }
switch (dhcpRelayCommand.getOperation()){
case PUT:
return GbpNetconfTransaction.netconfSyncedWrite(