@Override
public void setAgentControl(final IAgentControl agentControl) {
}
private Answer executeRequest(final CreateLogicalSwitchCommand cmd, int numRetries) {
LogicalSwitch logicalSwitch = new LogicalSwitch();
logicalSwitch.setDisplayName(truncate("lswitch-" + cmd.getName(), NAME_MAX_LEN));
logicalSwitch.setPortIsolationEnabled(false);
// Set transport binding
List<TransportZoneBinding> ltzb = new ArrayList<TransportZoneBinding>();
ltzb.add(new TransportZoneBinding(cmd.getTransportUuid(), cmd.getTransportType()));
logicalSwitch.setTransportZones(ltzb);
// Tags set to scope cs_account and account name
List<NiciraNvpTag> tags = new ArrayList<NiciraNvpTag>();
tags.add(new NiciraNvpTag("cs_account", cmd.getOwnerName()));
logicalSwitch.setTags(tags);
try {
logicalSwitch = niciraNvpApi.createLogicalSwitch(logicalSwitch);
return new CreateLogicalSwitchAnswer(cmd, true, "Logicalswitch " + logicalSwitch.getUuid() + " created", logicalSwitch.getUuid());
} catch (NiciraNvpApiException e) {
if (numRetries > 0) {
return retry(cmd, --numRetries);
} else {
return new CreateLogicalSwitchAnswer(cmd, e);