Added account ID to IpAddressTO and NetworkElementCommand.

This commit is contained in:
keshav 2011-07-21 16:44:13 -07:00
parent d6112b1632
commit 4ce137ef2e
3 changed files with 14 additions and 4 deletions

View File

@ -24,6 +24,8 @@ import com.cloud.agent.api.Command;
public abstract class NetworkElementCommand extends Command {
HashMap<String, String> accessDetails = new HashMap<String, String>(0);
public static final String ACCOUNT_ID = "account.id";
public static final String GUEST_NETWORK_CIDR = "guest.network.cidr";
public static final String ROUTER_NAME = "router.name";
public static final String ROUTER_IP = "router.ip";
public static final String ROUTER_GUEST_IP = "router.guest.ip";

View File

@ -25,6 +25,7 @@ import com.cloud.network.Networks.TrafficType;
public class IpAddressTO {
private long accountId;
private String publicIp;
private boolean sourceNat;
private boolean add;
@ -39,8 +40,9 @@ public class IpAddressTO {
private TrafficType trafficType;
private String[] networkTags;
public IpAddressTO(String ipAddress, boolean add, boolean firstIP, boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String vifMacAddress, String guestIp, Integer networkRate) {
this.publicIp = ipAddress;
public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstIP, boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String vifMacAddress, String guestIp, Integer networkRate) {
this.accountId = accountId;
this.publicIp = ipAddress;
this.add = add;
this.firstIP = firstIP;
this.sourceNat = sourceNat;
@ -54,6 +56,10 @@ public class IpAddressTO {
protected IpAddressTO() {
}
public long getAccountId() {
return accountId;
}
public String getGuestIp(){
return guestIp;

View File

@ -1646,8 +1646,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
removeUsers.add(user);
}
}
VpnUsersCfgCommand cmd = new VpnUsersCfgCommand(addUsers, removeUsers);
cmd.setAccessDetail(NetworkElementCommand.ACCOUNT_ID, String.valueOf(router.getAccountId()));
cmd.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_CIDR, network.getCidr());
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, router.getPrivateIpAddress());
cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, router.getGuestIpAddress());
cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
@ -1780,7 +1782,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
String vmGuestAddress = null;
IpAddressTO ip = new IpAddressTO(ipAddr.getAddress().addr(), add, firstIP, sourceNat, vlanId, vlanGateway, vlanNetmask, vifMacAddress, vmGuestAddress, networkRate);
IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, firstIP, sourceNat, vlanId, vlanGateway, vlanNetmask, vifMacAddress, vmGuestAddress, networkRate);
ip.setTrafficType(network.getTrafficType());
ip.setNetworkTags(network.getTags());
ipsToSend[i++] = ip;