use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.
the class AdvancedNetworkVisitor method visit.
@Override
public boolean visit(final AdvancedVpnRules vpnRules) throws ResourceUnavailableException {
final VirtualRouter router = vpnRules.getRouter();
final List<? extends VpnUser> users = vpnRules.getUsers();
final Commands cmds = new Commands(Command.OnError.Continue);
_commandSetupHelper.createApplyVpnUsersCommand(users, router, cmds);
// results accordingly
return _networkGeneralHelper.sendCommandsToRouter(router, cmds);
}
use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.
the class AdvancedNetworkVisitor method visit.
@Override
public boolean visit(final DhcpPvlanRules dhcp) throws ResourceUnavailableException {
final VirtualRouter router = dhcp.getRouter();
final PvlanSetupCommand setupCommand = dhcp.getSetupCommand();
// In fact we send command to the host of router, we're not programming
// router but the host
final Commands cmds = new Commands(Command.OnError.Stop);
cmds.addCommand(setupCommand);
try {
return _networkGeneralHelper.sendCommandsToRouter(router, cmds);
} catch (final ResourceUnavailableException e) {
s_logger.warn("Timed Out", e);
return false;
}
}
use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.
the class AdvancedNetworkVisitor method visit.
@Override
public boolean visit(final VpcIpAssociationRules vpcip) throws ResourceUnavailableException {
final VirtualRouter router = vpcip.getRouter();
final Commands cmds = new Commands(Command.OnError.Continue);
final Map<String, String> vlanMacAddress = vpcip.getVlanMacAddress();
final List<PublicIpAddress> ipsToSend = vpcip.getIpsToSend();
if (!ipsToSend.isEmpty()) {
_commandSetupHelper.createVpcAssociatePublicIPCommands(router, ipsToSend, cmds, vlanMacAddress);
return _networkGeneralHelper.sendCommandsToRouter(router, cmds);
} else {
return true;
}
}
use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.
the class AdvancedNetworkVisitor method visit.
@Override
public boolean visit(final NicPlugInOutRules nicPlugInOutRules) throws ResourceUnavailableException {
final VirtualRouter router = nicPlugInOutRules.getRouter();
final Commands commands = nicPlugInOutRules.getNetUsageCommands();
if (commands.size() > 0) {
return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
return true;
}
use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.
the class AdvancedNetworkVisitor method visit.
@Override
public boolean visit(final DhcpEntryRules dhcp) throws ResourceUnavailableException {
final VirtualRouter router = dhcp.getRouter();
final Commands commands = new Commands(Command.OnError.Stop);
final NicVO nicVo = dhcp.getNicVo();
final UserVmVO userVM = dhcp.getUserVM();
final boolean remove = dhcp.isRemove();
_commandSetupHelper.createDhcpEntryCommand(router, userVM, nicVo, remove, commands);
return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Aggregations