You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/01/22 02:02:21 UTC

[5/7] add unit test back, primary storage life cycle is tested

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/NetworkRuleConfigVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkRuleConfigVO.java b/server/src/com/cloud/network/NetworkRuleConfigVO.java
deleted file mode 100644
index bbfae43..0000000
--- a/server/src/com/cloud/network/NetworkRuleConfigVO.java
+++ /dev/null
@@ -1,93 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.async.AsyncInstanceCreateStatus;
-import com.google.gson.annotations.Expose;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name=("network_rule_config"))
-public class NetworkRuleConfigVO implements InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private Long id;
-
-    @Column(name="security_group_id")
-    private long securityGroupId;
-
-    @Column(name="public_port")
-    private String publicPort;
-
-    @Column(name="private_port")
-    private String privatePort;
-
-    @Column(name="protocol")
-    private String protocol;
-    
-    @Expose
-    @Column(name="create_status", updatable = true, nullable=false)
-    @Enumerated(value=EnumType.STRING)
-    private AsyncInstanceCreateStatus createStatus;
-
-    public NetworkRuleConfigVO() {}
-
-    public NetworkRuleConfigVO(long securityGroupId, String publicPort, String privatePort, String protocol) {
-        this.securityGroupId = securityGroupId;
-        this.publicPort = publicPort;
-        this.privatePort = privatePort;
-        this.protocol = protocol;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getSecurityGroupId() {
-        return securityGroupId;
-    }
-
-    public String getPublicPort() {
-        return publicPort;
-    }
-
-    public String getPrivatePort() {
-        return privatePort;
-    }
-
-    public String getProtocol() {
-        return protocol;
-    }
-    
-    public AsyncInstanceCreateStatus getCreateStatus() {
-    	return createStatus;
-    }
-    
-    public void setCreateStatus(AsyncInstanceCreateStatus createStatus) {
-    	this.createStatus = createStatus;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index 9b0b006..fa552f4 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -81,14 +81,18 @@ import com.cloud.network.VirtualRouterProvider.VirtualRouterProviderType;
 import com.cloud.network.addr.PublicIp;
 import com.cloud.network.dao.FirewallRulesDao;
 import com.cloud.network.dao.IPAddressDao;
+import com.cloud.network.dao.IPAddressVO;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.NetworkDomainDao;
+import com.cloud.network.dao.NetworkDomainVO;
 import com.cloud.network.dao.NetworkServiceMapDao;
+import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO;
+import com.cloud.network.dao.PhysicalNetworkVO;
 import com.cloud.network.element.NetworkElement;
 import com.cloud.network.element.VirtualRouterElement;
 import com.cloud.network.element.VpcVirtualRouterElement;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/NetworkServiceMapVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceMapVO.java b/server/src/com/cloud/network/NetworkServiceMapVO.java
deleted file mode 100644
index 592522d..0000000
--- a/server/src/com/cloud/network/NetworkServiceMapVO.java
+++ /dev/null
@@ -1,91 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import java.util.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.network.Network.Provider;
-import com.cloud.network.Network.Service;
-import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name="ntwk_service_map")
-public class NetworkServiceMapVO implements InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    long id;
-    
-    @Column(name="network_id")
-    long networkId;
-    
-    @Column(name="service")
-    String service;
-    
-    @Column(name="provider")
-    String provider;
-    
-    @Column(name=GenericDao.CREATED_COLUMN)
-    Date created;
-
-    public long getId() {
-        return id;
-    }
-
-    public long getNetworkId() {
-        return networkId;
-    }
-
-    public String getService() {
-        return service;
-    }
-
-    public String getProvider() {
-        return provider;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-    
-    public NetworkServiceMapVO() {
-    }
-    
-    public NetworkServiceMapVO(long networkId, Service service, Provider provider) {
-        this.networkId = networkId;
-        this.service = service.getName();
-        this.provider = provider.getName();
-    }
-    
-    public String toString() {
-        StringBuilder buf = new StringBuilder("[Network Service[");
-        return buf.append(networkId).append("-").append(service).append("-").append(provider).append("]").toString();
-    }
-}
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/NetworkUsageManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkUsageManager.java b/server/src/com/cloud/network/NetworkUsageManager.java
index 3d4577b..1f0638b 100644
--- a/server/src/com/cloud/network/NetworkUsageManager.java
+++ b/server/src/com/cloud/network/NetworkUsageManager.java
@@ -23,6 +23,8 @@ import com.cloud.api.commands.DeleteTrafficMonitorCmd;
 import com.cloud.api.commands.ListTrafficMonitorsCmd;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
+import com.cloud.network.dao.IPAddressVO;
+
 import org.apache.cloudstack.api.response.TrafficMonitorResponse;
 import com.cloud.utils.component.Manager;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/NetworkUsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkUsageManagerImpl.java b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
index f129b68..a3584ac 100755
--- a/server/src/com/cloud/network/NetworkUsageManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
@@ -63,7 +63,9 @@ import com.cloud.host.Status;
 import com.cloud.host.dao.HostDao;
 import com.cloud.host.dao.HostDetailsDao;
 import com.cloud.network.dao.IPAddressDao;
+import com.cloud.network.dao.IPAddressVO;
 import com.cloud.network.dao.NetworkDao;
+import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.resource.TrafficSentinelResource;
 import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceStateAdapter;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/NetworkVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkVO.java b/server/src/com/cloud/network/NetworkVO.java
deleted file mode 100644
index 14b643b..0000000
--- a/server/src/com/cloud/network/NetworkVO.java
+++ /dev/null
@@ -1,494 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-import javax.persistence.Transient;
-
-import org.apache.cloudstack.acl.ControlledEntity;
-import com.cloud.network.Networks.BroadcastDomainType;
-import com.cloud.network.Networks.Mode;
-import com.cloud.network.Networks.TrafficType;
-import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.net.NetUtils;
-
-/**
- * NetworkConfigurationVO contains information about a specific network.
- *
- */
-@Entity
-@Table(name="networks")
-public class NetworkVO implements Network {
-    @Id
-    @TableGenerator(name="networks_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="networks_seq", allocationSize=1)
-    @Column(name="id")
-    long id;
-
-    @Column(name="mode")
-    @Enumerated(value=EnumType.STRING)
-    Mode mode;
-
-    @Column(name="broadcast_domain_type")
-    @Enumerated(value=EnumType.STRING)
-    BroadcastDomainType broadcastDomainType;
-
-    @Column(name="traffic_type")
-    @Enumerated(value=EnumType.STRING)
-    TrafficType trafficType;
-
-    @Column(name="name")
-    String name;
-
-    @Column(name="display_text")
-    String displayText;;
-
-    @Column(name="broadcast_uri")
-    URI broadcastUri;
-
-    @Column(name="gateway")
-    String gateway;
-
-    @Column(name="cidr")
-    String cidr;
-
-    @Column(name="network_offering_id")
-    long networkOfferingId;
-
-    @Column(name="vpc_id")
-    Long vpcId;
-
-    @Column(name="physical_network_id")
-    Long physicalNetworkId;
-
-    @Column(name="data_center_id")
-    long dataCenterId;
-
-    @Column(name="related")
-    long related;
-
-    @Column(name="guru_name")
-    String guruName;
-
-    @Column(name="state")
-    @Enumerated(value=EnumType.STRING)
-    State state;
-
-    @Column(name="dns1")
-    String dns1;
-
-    @Column(name="domain_id")
-    long domainId;
-
-    @Column(name="account_id")
-    long accountId;
-
-    @Column(name="set_fields")
-    long setFields;
-
-    @TableGenerator(name="mac_address_seq", table="op_networks", pkColumnName="id", valueColumnName="mac_address_seq", allocationSize=1)
-    @Transient
-    long macAddress = 1;
-
-    @Column(name="guru_data", length=1024)
-    String guruData;
-
-    @Column(name="dns2")
-    String dns2;
-
-    @Column(name="network_domain")
-    String networkDomain;
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    Date removed;
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    Date created;
-
-    @Column(name="reservation_id")
-    String reservationId;
-
-    @Column(name="uuid")
-    String uuid;
-
-    @Column(name="guest_type")
-    @Enumerated(value=EnumType.STRING)
-    Network.GuestType guestType;
-
-    @Column(name="acl_type")
-    @Enumerated(value=EnumType.STRING)
-    ControlledEntity.ACLType aclType;
-
-    @Column(name="restart_required")
-    boolean restartRequired = false;
-
-    @Column(name="specify_ip_ranges")
-    boolean specifyIpRanges = false;
-
-    public NetworkVO() {
-    	this.uuid = UUID.randomUUID().toString();
-    }
-
-    /**
-     * Constructor to be used for the adapters because it only initializes what's needed.
-     * @param trafficType
-     * @param mode
-     * @param broadcastDomainType
-     * @param networkOfferingId
-     * @param state TODO
-     * @param dataCenterId
-     * @param physicalNetworkId TODO
-     */
-    public NetworkVO(TrafficType trafficType, Mode mode, BroadcastDomainType broadcastDomainType, long networkOfferingId,
-            State state, long dataCenterId, Long physicalNetworkId) {
-        this.trafficType = trafficType;
-        this.mode = mode;
-        this.broadcastDomainType = broadcastDomainType;
-        this.networkOfferingId = networkOfferingId;
-        this.dataCenterId = dataCenterId;
-        this.physicalNetworkId = physicalNetworkId;
-        if (state == null) {
-            state = State.Allocated;
-        } else {
-            this.state = state;
-        }
-        this.id = -1;
-    	this.uuid = UUID.randomUUID().toString();
-    }
-
-    public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId,
-            long related, String name, String displayText, String networkDomain, GuestType guestType, long dcId,
-            Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) {
-        this(id, that.getTrafficType(), that.getMode(), that.getBroadcastDomainType(), offeringId, domainId, accountId,
-                related, name, displayText, networkDomain, guestType, dcId, physicalNetworkId, aclType, specifyIpRanges, vpcId);
-        this.gateway = that.getGateway();
-        this.cidr = that.getCidr();
-        this.broadcastUri = that.getBroadcastUri();
-        this.broadcastDomainType = that.getBroadcastDomainType();
-        this.guruName = guruName;
-        this.state = that.getState();
-        if (state == null) {
-            state = State.Allocated;
-        }
-    	this.uuid = UUID.randomUUID().toString();
-    }
-
-    /**
-     * Constructor for the actual DAO object.
-     * @param trafficType
-     * @param mode
-     * @param broadcastDomainType
-     * @param networkOfferingId
-     * @param domainId
-     * @param accountId
-     * @param name
-     * @param displayText
-     * @param networkDomain
-     * @param guestType TODO
-     * @param aclType TODO
-     * @param specifyIpRanges TODO
-     * @param vpcId TODO
-     * @param dataCenterId
-     */
-    public NetworkVO(long id, TrafficType trafficType, Mode mode, BroadcastDomainType broadcastDomainType,
-            long networkOfferingId, long domainId, long accountId, long related, String name, String displayText,
-            String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) {
-        this(trafficType, mode, broadcastDomainType, networkOfferingId, State.Allocated, dcId, physicalNetworkId);
-        this.domainId = domainId;
-        this.accountId = accountId;
-        this.related = related;
-        this.id = id;
-        this.name = name;
-        this.displayText = displayText;
-        this.aclType = aclType;
-        this.networkDomain = networkDomain;
-    	this.uuid = UUID.randomUUID().toString();
-        this.guestType = guestType;
-        this.specifyIpRanges = specifyIpRanges;
-        this.vpcId = vpcId;
-    }
-
-    @Override
-    public String getReservationId() {
-        return reservationId;
-    }
-
-    public void setReservationId(String reservationId) {
-        this.reservationId = reservationId;
-    }
-
-    @Override
-    public State getState() {
-        return state;
-    }
-
-    public void setState(State state) {
-        this.state = state;
-    }
-
-    @Override
-    public long getRelated() {
-        return related;
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public Mode getMode() {
-        return mode;
-    }
-
-    @Override
-    public long getAccountId() {
-        return accountId;
-    }
-
-    @Override
-    public long getDomainId() {
-        return domainId;
-    }
-
-    @Override
-    public long getNetworkOfferingId() {
-        return networkOfferingId;
-    }
-
-    public void setNetworkOfferingId(long networkOfferingId) {
-        this.networkOfferingId = networkOfferingId;
-    }
-
-    public void setMode(Mode mode) {
-        this.mode = mode;
-    }
-
-    @Override
-    public BroadcastDomainType getBroadcastDomainType() {
-        return broadcastDomainType;
-    }
-
-    public String getGuruData() {
-        return guruData;
-    }
-
-    public void setGuruData(String guruData) {
-        this.guruData = guruData;
-    }
-
-    public String getGuruName() {
-        return guruName;
-    }
-
-    public void setGuruName(String guruName) {
-        this.guruName = guruName;
-    }
-
-    public void setBroadcastDomainType(BroadcastDomainType broadcastDomainType) {
-        this.broadcastDomainType = broadcastDomainType;
-    }
-
-    @Override
-    public String getNetworkDomain() {
-        return networkDomain;
-    }
-
-    public void setNetworkDomain(String networkDomain) {
-        this.networkDomain = networkDomain;
-    }
-
-    @Override
-    public TrafficType getTrafficType() {
-        return trafficType;
-    }
-
-    public void setTrafficType(TrafficType trafficType) {
-        this.trafficType = trafficType;
-    }
-
-    @Override
-    public String getGateway() {
-        return gateway;
-    }
-
-    public void setGateway(String gateway) {
-        this.gateway = gateway;
-    }
-
-    @Override
-    public String getCidr() {
-        return cidr;
-    }
-
-    public void setCidr(String cidr) {
-        this.cidr = cidr;
-    }
-
-    @Override
-    public URI getBroadcastUri() {
-        return broadcastUri;
-    }
-
-    public void setBroadcastUri(URI broadcastUri) {
-        this.broadcastUri = broadcastUri;
-    }
-
-    @Override
-    public int hashCode() {
-        return NumbersUtil.hash(id);
-    }
-
-    @Override
-    public Long getPhysicalNetworkId() {
-        return physicalNetworkId;
-    }
-
-    @Override
-    public void setPhysicalNetworkId(Long physicalNetworkId) {
-        this.physicalNetworkId = physicalNetworkId;
-    }
-
-    @Override
-    public long getDataCenterId() {
-        return dataCenterId;
-    }
-
-    public String getDns1() {
-        return dns1;
-    }
-
-    public void setDns1(String dns) {
-        this.dns1 = dns;
-    }
-
-    public String getDns2() {
-        return dns2;
-    }
-
-    public void setDns2(String dns) {
-        this.dns2 = dns;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public void setDisplayText(String displayText) {
-        this.displayText = displayText;
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public void setRemoved(Date removed) {
-        this.removed = removed;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public void setCreated(Date created) {
-        this.created = created;
-    }
-
-    @Override
-    public Network.GuestType getGuestType() {
-        return guestType;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof NetworkVO)) {
-            return false;
-        }
-        NetworkVO that = (NetworkVO)obj;
-        if (this.trafficType != that.trafficType) {
-            return false;
-        }
-
-        if ((this.cidr == null && that.cidr != null) || (this.cidr != null && that.cidr == null)) {
-            return false;
-        }
-
-        if (this.cidr == null && that.cidr == null) {
-            return true;
-        }
-
-        return NetUtils.isNetworkAWithinNetworkB(this.cidr, that.cidr);
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder buf = new StringBuilder("Ntwk[");
-        buf.append(id).append("|").append(trafficType).append("|").append(networkOfferingId).append("]");
-        return buf.toString();
-    }
-
-    public String getUuid() {
-    	return this.uuid;
-    }
-
-    public void setUuid(String uuid) {
-    	this.uuid = uuid;
-    }
-
-	public ControlledEntity.ACLType getAclType() {
-		return aclType;
-	}
-
-	public void setRestartRequired(boolean restartRequired) {
-		this.restartRequired = restartRequired;
-	}
-
-	@Override
-	public boolean isRestartRequired() {
-		return restartRequired;
-	}
-
-    @Override
-    public boolean getSpecifyIpRanges() {
-    	return specifyIpRanges;
-    }
-
-    @Override
-    public Long getVpcId() {
-        return vpcId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/PhysicalNetworkVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/PhysicalNetworkVO.java b/server/src/com/cloud/network/PhysicalNetworkVO.java
deleted file mode 100644
index 9bf8601..0000000
--- a/server/src/com/cloud/network/PhysicalNetworkVO.java
+++ /dev/null
@@ -1,231 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-
-import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
-
-/**
- * NetworkConfigurationVO contains information about a specific physical network.
- *
- */
-@Entity
-@Table(name="physical_network")
-public class PhysicalNetworkVO implements PhysicalNetwork {
-    @Id
-    @TableGenerator(name="physical_networks_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="physical_networks_seq", allocationSize=1)
-    @Column(name="id")
-    long id;
-    
-    @Column(name="uuid")
-    private String uuid;
-    
-	@Column(name="name")
-	private String name;
-
-    @Column(name="data_center_id")
-    long dataCenterId;
-
-    @Column(name="vnet")
-    private String vnet = null;
-    
-    @Column(name="speed")
-    private String speed = null;
-    
-    @Column(name="domain_id")
-    Long domainId = null;
-
-    @Column(name="broadcast_domain_range")
-    @Enumerated(value=EnumType.STRING)
-    BroadcastDomainRange broadcastDomainRange;
-
-    @Column(name="state")
-    @Enumerated(value=EnumType.STRING)
-    State state;
-    
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    Date removed;
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    Date created;
-
-    @ElementCollection(targetClass = String.class, fetch=FetchType.EAGER)
-    @Column(name="tag")
-    @CollectionTable(name="physical_network_tags", joinColumns=@JoinColumn(name="physical_network_id"))
-    List<String> tags;
-    
-    @ElementCollection(targetClass = String.class, fetch=FetchType.EAGER)
-    @Column(name="isolation_method")
-    @CollectionTable(name="physical_network_isolation_methods", joinColumns=@JoinColumn(name="physical_network_id"))
-    List<String> isolationMethods;
-
-    public PhysicalNetworkVO(){
-        
-    }
-    
-    public PhysicalNetworkVO(long id, long dataCenterId, String vnet, String speed, Long domainId, BroadcastDomainRange broadcastDomainRange, String name) {
-        this.dataCenterId = dataCenterId;
-        this.setVnet(vnet);
-        this.setSpeed(speed);
-        this.domainId = domainId;
-        if(broadcastDomainRange != null){
-            this.broadcastDomainRange = broadcastDomainRange;
-        }else{
-            this.broadcastDomainRange = BroadcastDomainRange.POD;
-        }
-        this.state = State.Disabled;
-        this.uuid = UUID.randomUUID().toString();
-        this.name = name;
-        this.id = id;
-    }
-
-    @Override
-    public State getState() {
-        return state;
-    }
-
-    public void setState(State state) {
-        this.state = state;
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public List<String> getTags() {
-        return tags != null ? tags : new ArrayList<String>();
-    }
-
-    public void addTag(String tag) {
-        if (tags == null) {
-            tags = new ArrayList<String>();
-        }
-        tags.add(tag);
-    }
-
-    public void setTags(List<String> tags) {
-        this.tags = tags;
-    }
-
-    @Override
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    @Override
-    public BroadcastDomainRange getBroadcastDomainRange() {
-        return broadcastDomainRange;
-    }
-
-    public void setBroadcastDomainRange(BroadcastDomainRange broadcastDomainRange) {
-        this.broadcastDomainRange = broadcastDomainRange;
-    }
-
-    @Override
-    public int hashCode() {
-        return NumbersUtil.hash(id);
-    }
-
-    @Override
-    public long getDataCenterId() {
-        return dataCenterId;
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public void setRemoved(Date removed) {
-        this.removed = removed;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public void setCreated(Date created) {
-        this.created = created;
-    }
-
-    @Override
-    public List<String> getIsolationMethods() {
-        return isolationMethods != null ? isolationMethods : new ArrayList<String>();
-    }
-    
-    public void addIsolationMethod(String isolationMethod) {
-        if (isolationMethods == null) {
-            isolationMethods = new ArrayList<String>();
-        }
-        isolationMethods.add(isolationMethod);
-    }
-
-    public void setIsolationMethods(List<String> isolationMethods) {
-        this.isolationMethods = isolationMethods;
-    }
-
-    public void setVnet(String vnet) {
-        this.vnet = vnet;
-    }
-
-    @Override
-    public String getVnet() {
-        return vnet;
-    }
-
-    public void setSpeed(String speed) {
-        this.speed = speed;
-    }
-
-    @Override
-    public String getSpeed() {
-        return speed;
-    }
-    
-    @Override
-    public String getUuid() {
-        return this.uuid;
-    }
-    
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    @Override
-	public String getName() {
-		return name;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/PortProfileManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/PortProfileManagerImpl.java b/server/src/com/cloud/network/PortProfileManagerImpl.java
index 3d83d3f..f17ee6f 100644
--- a/server/src/com/cloud/network/PortProfileManagerImpl.java
+++ b/server/src/com/cloud/network/PortProfileManagerImpl.java
@@ -22,9 +22,10 @@ import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
-import com.cloud.network.PortProfileVO.BindingType;
-import com.cloud.network.PortProfileVO.PortType;
 import com.cloud.network.dao.PortProfileDaoImpl;
+import com.cloud.network.dao.PortProfileVO;
+import com.cloud.network.dao.PortProfileVO.BindingType;
+import com.cloud.network.dao.PortProfileVO.PortType;
 
 public class PortProfileManagerImpl {
 	    

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/PortProfileVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/PortProfileVO.java b/server/src/com/cloud/network/PortProfileVO.java
deleted file mode 100644
index 8a7b9d8..0000000
--- a/server/src/com/cloud/network/PortProfileVO.java
+++ /dev/null
@@ -1,204 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-
-package com.cloud.network;
-
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import com.cloud.exception.InvalidParameterValueException;
-import org.apache.cloudstack.api.InternalIdentity;
-
-/**
- * PortProfileVO contains information on portprofiles that are created on a Cisco Nexus 1000v VSM associated
- * with a VMWare cluster. 
- */
-
-@Entity
-@Table(name="port_profile")
-public class PortProfileVO implements InternalIdentity {
-	
-	// We need to know what properties a VSM has. Put them here.
-	
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-
-    @Column(name="uuid")
-    private String uuid;
-
-    @Column(name = "port_profile_name")
-    private String portProfileName;
-
-    @Column(name = "port_mode")
-    private PortMode portMode;
-    
-    @Column(name = "vsm_id")
-    private long vsmId;
-
-    @Column(name = "trunk_low_vlan_id")
-    private int lowVlanId;
-    
-    @Column(name = "trunk_high_vlan_id")
-    private int highVlanId;
-    
-    @Column(name = "access_vlan_id")
-    private int accessVlanId;
-    
-    @Column(name = "port_type")
-    private PortType portType;
-    
-    @Column(name = "port_binding")
-    private BindingType portBinding;
-
-    public enum BindingType {
-    	Static,
-    	Ephemeral
-    }
-    
-    public enum PortType {
-    	Ethernet,
-    	vEthernet
-    }
-    
-    // This tells us whether the port trunks multiple VLANs
-    // or carries traffic of a single VLAN.
-    public enum PortMode {
-    	Access,
-    	Trunk
-    }
-
-    // Accessor methods
-    public long getId() {
-        return id;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public String getPortProfileName() {
-    	return portProfileName;
-    }
-    
-    public PortMode getPortMode() {
-    	return portMode;
-    }
-    
-    public long getVsmId() {
-    	return vsmId;
-    }
-    
-    public int getLowVlanId() {
-    	return lowVlanId;
-    }
-    
-    public int getHighVlanId() {
-    	return highVlanId;
-    }
-    
-    public int getAccessVlanId() {
-    	return accessVlanId;
-    }
-    
-    public PortType getPortType() {
-    	return portType;
-    }
-    
-    public BindingType getPortBinding() {
-    	return portBinding;
-    }
-    
-    // Setter methods
-
-    public void setPortProfileName(String name) {
-    	portProfileName = name;
-    }
-    
-    public void setPortMode(PortMode mode) {
-    	portMode = mode;
-    }
-    
-    public void setVsmId(long id) {
-    	vsmId = id;
-    }
-    
-    public void setLowVlanId(int vlanId) {
-    	lowVlanId = vlanId;
-    }
-    
-    public void setHighVlanId(int vlanId) {
-    	highVlanId = vlanId;
-    }
-    
-    public void setAccessVlanId(int vlanId) {
-    	accessVlanId = vlanId;
-    }
-    
-    public void setPortType(PortType type) {
-    	portType = type;
-    }
-    
-    public void setPortBinding(BindingType bindingType) {
-    	portBinding = bindingType;
-    }
-
-    // Constructor methods.
-    
-    public PortProfileVO(String portProfName, long vsmId, int vlanId, PortType pType, BindingType bType) {
-    	// Set the relevant portprofile properties here.
-    	// When supplied with a single vlanId, we set this portprofile as an access port profile.
-    	
-    	this.setPortMode(PortMode.Access);
-    	
-        this.uuid = UUID.randomUUID().toString();
-        this.setPortProfileName(portProfName);
-        this.setVsmId(vsmId);
-        this.setAccessVlanId(vlanId);
-        this.setPortType(pType);
-        this.setPortBinding(bType);
-    }
-    
-    public PortProfileVO(String portProfName, long vsmId, int lowVlanId, int highVlanId, PortType pType, BindingType bType) {
-    	// Set the relevant portprofile properties here.
-    	// When supplied with a vlan range, we set this portprofile as a trunk port profile.
-    	
-    	if (lowVlanId >= highVlanId) {
-    		throw new InvalidParameterValueException("Low Vlan Id cannot be greater than or equal to high Vlan Id");
-    	}
-    	this.setPortMode(PortMode.Trunk);
-    	
-        this.uuid = UUID.randomUUID().toString();
-        this.setPortProfileName(portProfName);
-        this.setVsmId(vsmId);
-        this.setLowVlanId(lowVlanId);
-        this.setHighVlanId(highVlanId);
-        this.setPortType(pType);
-        this.setPortBinding(bType);
-    }    
-    
-    public PortProfileVO() {
-        this.uuid = UUID.randomUUID().toString();
-    }    
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/RemoteAccessVpnVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/RemoteAccessVpnVO.java b/server/src/com/cloud/network/RemoteAccessVpnVO.java
deleted file mode 100644
index 7c3aab1..0000000
--- a/server/src/com/cloud/network/RemoteAccessVpnVO.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name=("remote_access_vpn"))
-public class RemoteAccessVpnVO implements RemoteAccessVpn {
-    @Column(name="account_id")
-    private long accountId;
-
-    @Column(name="network_id")
-    private long networkId;
-    
-    @Column(name="domain_id")
-    private long domainId;
-
-    @Id
-    @Column(name="vpn_server_addr_id")
-    private long serverAddressId;
-    
-    @Column(name="local_ip")
-    private String localIp;
-
-    @Column(name="ip_range")
-    private String ipRange;
-
-    @Column(name="ipsec_psk")
-    private String ipsecPresharedKey;
-    
-    @Column(name="state")
-    private State state;
-
-    public RemoteAccessVpnVO() { }
-
-    public RemoteAccessVpnVO(long accountId, long domainId, long networkId, long publicIpId, String localIp, String ipRange,  String presharedKey) {
-        this.accountId = accountId;
-        this.serverAddressId = publicIpId;
-        this.ipRange = ipRange;
-        this.ipsecPresharedKey = presharedKey;
-        this.localIp = localIp;
-        this.domainId = domainId;
-        this.networkId = networkId;
-        this.state = State.Added;
-    }
-    
-    @Override
-    public State getState() {
-        return state;
-    }
-    
-    public void setState(State state) {
-        this.state = state;
-    }
-
-    @Override
-    public long getAccountId() {
-        return accountId;
-    }
-    
-    @Override
-	public long getServerAddressId() {
-        return serverAddressId;
-    }
-
-    @Override
-    public String getIpRange() {
-		return ipRange;
-	}
-
-    public void setIpRange(String ipRange) {
-		this.ipRange = ipRange;
-	}
-
-	@Override
-    public String getIpsecPresharedKey() {
-		return ipsecPresharedKey;
-	}
-
-    public void setIpsecPresharedKey(String ipsecPresharedKey) {
-		this.ipsecPresharedKey = ipsecPresharedKey;
-	}
-
-	@Override
-    public String getLocalIp() {
-		return localIp;
-	}
-
-	@Override
-    public long getDomainId() {
-		return domainId;
-	}
-	
-	@Override
-    public long getNetworkId() {
-	    return networkId;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/RouterNetworkVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/RouterNetworkVO.java b/server/src/com/cloud/network/RouterNetworkVO.java
deleted file mode 100644
index ee58521..0000000
--- a/server/src/com/cloud/network/RouterNetworkVO.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.network.Network.GuestType;
-import org.apache.cloudstack.api.InternalIdentity;
-
-
-@Entity
-@Table(name="router_network_ref")
-public class RouterNetworkVO implements InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    long id;
-    
-    @Column(name="router_id")
-    long routerId;
-    
-    @Column(name="network_id")
-    long networkId;
-    
-    @Column(name="guest_type")
-    @Enumerated(value=EnumType.STRING)
-    Network.GuestType guestType;
-
-    protected RouterNetworkVO() {
-    }
-    
-    public RouterNetworkVO(long routerId, long networkId, GuestType guestType) {
-        this.networkId = networkId;
-        this.routerId = routerId;
-        this.guestType = guestType;
-    }
-    
-    
-    public long getRouterId() {
-        return routerId;
-    }
-    
-    public long getNetworkId() {
-        return networkId;
-    }
-
-    public Network.GuestType getGuestType() {
-        return guestType;
-    }
-
-    public long getId() {
-        return id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java b/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java
deleted file mode 100644
index c327b1e..0000000
--- a/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java
+++ /dev/null
@@ -1,205 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name=("s2s_customer_gateway"))
-public class Site2SiteCustomerGatewayVO implements Site2SiteCustomerGateway {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-
-    @Column(name="uuid")
-    private String uuid;
-
-    @Column(name="name")
-    private String name;
-
-    @Column(name="gateway_ip")
-    private String gatewayIp;
-
-    @Column(name="guest_cidr_list")
-    private String guestCidrList;
-
-    @Column(name="ipsec_psk")
-    private String ipsecPsk;
-
-    @Column(name="ike_policy")
-    private String ikePolicy;
-
-    @Column(name="esp_policy")
-    private String espPolicy;
-
-    @Column(name="ike_lifetime")
-    private long ikeLifetime;
-
-    @Column(name="esp_lifetime")
-    private long espLifetime;
-
-    @Column(name="dpd")
-    private boolean dpd;
-
-    @Column(name="domain_id")
-    private Long domainId;
-    
-    @Column(name="account_id")
-    private Long accountId;
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-
-    public Site2SiteCustomerGatewayVO() { }
-
-    public Site2SiteCustomerGatewayVO(String name, long accountId, long domainId, String gatewayIp, String guestCidrList, String ipsecPsk, String ikePolicy, String espPolicy,
-            long ikeLifetime, long espLifetime, boolean dpd) {
-        this.name = name;
-        this.gatewayIp = gatewayIp;
-        this.guestCidrList = guestCidrList;
-        this.ipsecPsk = ipsecPsk;
-        this.ikePolicy = ikePolicy;
-        this.espPolicy = espPolicy;
-        this.ikeLifetime = ikeLifetime;
-        this.espLifetime = espLifetime;
-        this.dpd = dpd;
-        this.uuid = UUID.randomUUID().toString();
-        this.accountId = accountId;
-        this.domainId = domainId;
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public String getGatewayIp() {
-        return gatewayIp;
-    }
-
-    public void setGatewayIp(String gatewayIp) {
-        this.gatewayIp = gatewayIp;
-    }
-
-    @Override
-    public String getGuestCidrList() {
-        return guestCidrList;
-    }
-
-    public void setGuestCidrList(String guestCidrList) {
-        this.guestCidrList = guestCidrList;
-    }
-
-    @Override
-    public String getIpsecPsk() {
-        return ipsecPsk;
-    }
-
-    public void setIpsecPsk(String ipsecPsk) {
-        this.ipsecPsk = ipsecPsk;
-    }
-
-    @Override
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public void setRemoved(Date removed) {
-        this.removed = removed;
-    }
-
-    @Override
-    public Long getIkeLifetime() {
-        return ikeLifetime;
-    }
-
-    public void setIkeLifetime(long ikeLifetime) {
-        this.ikeLifetime = ikeLifetime;
-    }
-
-    @Override
-    public Long getEspLifetime() {
-        return espLifetime;
-    }
-
-    public void setEspLifetime(long espLifetime) {
-        this.espLifetime = espLifetime;
-    }
-
-    @Override
-    public String getIkePolicy() {
-        return ikePolicy;
-    }
-
-    public void setIkePolicy(String ikePolicy) {
-        this.ikePolicy = ikePolicy;
-    }
-
-    @Override
-    public String getEspPolicy() {
-        return espPolicy;
-    }
-
-    public void setEspPolicy(String espPolicy) {
-        this.espPolicy = espPolicy;
-    }
-
-    @Override
-    public Boolean getDpd() {
-        return dpd;
-    }
-
-    public void setDpd(boolean dpd) {
-        this.dpd = dpd;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-    
-    @Override
-    public long getDomainId() {
-        return domainId;
-    }
-
-    @Override
-    public long getAccountId() {
-        return accountId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/Site2SiteVpnConnectionVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/Site2SiteVpnConnectionVO.java b/server/src/com/cloud/network/Site2SiteVpnConnectionVO.java
deleted file mode 100644
index 99f807f..0000000
--- a/server/src/com/cloud/network/Site2SiteVpnConnectionVO.java
+++ /dev/null
@@ -1,141 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name=("s2s_vpn_connection"))
-public class Site2SiteVpnConnectionVO implements Site2SiteVpnConnection, InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-    
-	@Column(name="uuid")
-	private String uuid;    
-    
-    @Column(name="vpn_gateway_id")
-    private long vpnGatewayId;
-    
-    @Column(name="customer_gateway_id")
-    private long customerGatewayId;
-
-    @Column(name="state")
-    @Enumerated(value=EnumType.STRING)
-    private State state;
-    
-    @Column(name="domain_id")
-    private Long domainId;
-    
-    @Column(name="account_id")
-    private Long accountId;
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    private Date created;
-    
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-    
-    public Site2SiteVpnConnectionVO() { }
-
-    public Site2SiteVpnConnectionVO(long accountId, long domainId, long vpnGatewayId, long customerGatewayId) {
-        this.uuid = UUID.randomUUID().toString();
-        this.setVpnGatewayId(vpnGatewayId);
-        this.setCustomerGatewayId(customerGatewayId);
-        this.setState(State.Pending);
-        this.accountId = accountId;
-        this.domainId = domainId;
-    }
-    
-    @Override
-    public long getId() {
-        return id;
-    }
-    
-    @Override
-    public State getState() {
-        return state;
-    }
-
-    public void setState(State state) {
-        this.state = state;
-    }
-
-    @Override
-    public long getVpnGatewayId() {
-        return vpnGatewayId;
-    }
-
-    public void setVpnGatewayId(long vpnGatewayId) {
-        this.vpnGatewayId = vpnGatewayId;
-    }
-
-    @Override
-    public long getCustomerGatewayId() {
-        return customerGatewayId;
-    }
-
-    public void setCustomerGatewayId(long customerGatewayId) {
-        this.customerGatewayId = customerGatewayId;
-    }
-
-    @Override
-    public Date getCreated() {
-        return created;
-    }
-
-    public void setCreated(Date created) {
-        this.created = created;
-    }
-
-    @Override
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public void setRemoved(Date removed) {
-        this.removed = removed;
-    }
-    
-    public String getUuid() {
-        return uuid;
-    }
-    
-    @Override
-    public long getDomainId() {
-        return domainId;
-    }
-
-    @Override
-    public long getAccountId() {
-        return accountId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/Site2SiteVpnGatewayVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/Site2SiteVpnGatewayVO.java b/server/src/com/cloud/network/Site2SiteVpnGatewayVO.java
deleted file mode 100644
index ada50c4..0000000
--- a/server/src/com/cloud/network/Site2SiteVpnGatewayVO.java
+++ /dev/null
@@ -1,113 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name=("s2s_vpn_gateway"))
-public class Site2SiteVpnGatewayVO implements Site2SiteVpnGateway {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-    
-	@Column(name="uuid")
-	private String uuid;    
-    
-    @Column(name="addr_id")
-    private long addrId;
-
-    @Column(name="vpc_id")
-    private long vpcId;
-
-    @Column(name="domain_id")
-    private Long domainId;
-    
-    @Column(name="account_id")
-    private Long accountId;
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-    
-    public Site2SiteVpnGatewayVO() { }
-
-    public Site2SiteVpnGatewayVO(long accountId, long domainId, long addrId, long vpcId) {
-        this.uuid = UUID.randomUUID().toString();
-        this.setAddrId(addrId);
-        this.setVpcId(vpcId);
-        this.accountId = accountId;
-        this.domainId = domainId;
-    }
-    
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public long getVpcId() {
-        return vpcId;
-    }
-    
-    public void setVpcId(long vpcId) {
-        this.vpcId = vpcId;
-    }
-
-    @Override
-    public long getAddrId() {
-        return addrId;
-    }
-
-    public void setAddrId(long addrId) {
-        this.addrId = addrId;
-    }
-
-    @Override
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public void setRemoved(Date removed) {
-        this.removed = removed;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-    
-    @Override
-    public long getDomainId() {
-        return domainId;
-    }
-
-    @Override
-    public long getAccountId() {
-        return accountId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/StorageNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/StorageNetworkManagerImpl.java b/server/src/com/cloud/network/StorageNetworkManagerImpl.java
index b3dd357..52ee73d 100755
--- a/server/src/com/cloud/network/StorageNetworkManagerImpl.java
+++ b/server/src/com/cloud/network/StorageNetworkManagerImpl.java
@@ -43,6 +43,7 @@ import com.cloud.dc.dao.StorageNetworkIpRangeDao;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.dao.NetworkDao;
+import com.cloud.network.dao.NetworkVO;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.db.SearchCriteria2;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/addr/PublicIp.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/addr/PublicIp.java b/server/src/com/cloud/network/addr/PublicIp.java
index 8ad716f..b5a19aa 100644
--- a/server/src/com/cloud/network/addr/PublicIp.java
+++ b/server/src/com/cloud/network/addr/PublicIp.java
@@ -19,8 +19,8 @@ package com.cloud.network.addr;
 import java.util.Date;
 
 import com.cloud.dc.VlanVO;
-import com.cloud.network.IPAddressVO;
 import com.cloud.network.PublicIpAddress;
+import com.cloud.network.dao.IPAddressVO;
 import com.cloud.utils.net.Ip;
 import com.cloud.utils.net.NetUtils;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
index 7c8a6f5..734ea3d 100644
--- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
+++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
@@ -58,7 +58,6 @@ import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.ResourceInUseException;
 import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.LoadBalancerVO;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.as.AutoScaleCounter.AutoScaleCounterParam;
 import com.cloud.network.as.dao.AutoScalePolicyConditionMapDao;
@@ -71,6 +70,7 @@ import com.cloud.network.as.dao.CounterDao;
 import com.cloud.network.dao.IPAddressDao;
 import com.cloud.network.dao.LoadBalancerDao;
 import com.cloud.network.dao.LoadBalancerVMMapDao;
+import com.cloud.network.dao.LoadBalancerVO;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.lb.LoadBalancingRulesManager;
 import com.cloud.offering.ServiceOffering;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/ExternalFirewallDeviceDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/ExternalFirewallDeviceDao.java b/server/src/com/cloud/network/dao/ExternalFirewallDeviceDao.java
index 2d2da6c..bb3ebef 100644
--- a/server/src/com/cloud/network/dao/ExternalFirewallDeviceDao.java
+++ b/server/src/com/cloud/network/dao/ExternalFirewallDeviceDao.java
@@ -18,9 +18,8 @@ package com.cloud.network.dao;
 
 import java.util.List;
 
-import com.cloud.network.ExternalFirewallDeviceVO;
-import com.cloud.network.ExternalFirewallDeviceVO.FirewallDeviceAllocationState;
-import com.cloud.network.ExternalFirewallDeviceVO.FirewallDeviceState;
+import com.cloud.network.dao.ExternalFirewallDeviceVO.FirewallDeviceAllocationState;
+import com.cloud.network.dao.ExternalFirewallDeviceVO.FirewallDeviceState;
 import com.cloud.utils.db.GenericDao;
 
 public interface ExternalFirewallDeviceDao extends GenericDao<ExternalFirewallDeviceVO, Long> {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/ExternalFirewallDeviceDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/ExternalFirewallDeviceDaoImpl.java b/server/src/com/cloud/network/dao/ExternalFirewallDeviceDaoImpl.java
index ee26df9..01f8861 100644
--- a/server/src/com/cloud/network/dao/ExternalFirewallDeviceDaoImpl.java
+++ b/server/src/com/cloud/network/dao/ExternalFirewallDeviceDaoImpl.java
@@ -21,9 +21,8 @@ import javax.ejb.Local;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.network.ExternalFirewallDeviceVO;
-import com.cloud.network.ExternalFirewallDeviceVO.FirewallDeviceAllocationState;
-import com.cloud.network.ExternalFirewallDeviceVO.FirewallDeviceState;
+import com.cloud.network.dao.ExternalFirewallDeviceVO.FirewallDeviceAllocationState;
+import com.cloud.network.dao.ExternalFirewallDeviceVO.FirewallDeviceState;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/ExternalFirewallDeviceVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/ExternalFirewallDeviceVO.java b/server/src/com/cloud/network/dao/ExternalFirewallDeviceVO.java
new file mode 100644
index 0000000..31750b4
--- /dev/null
+++ b/server/src/com/cloud/network/dao/ExternalFirewallDeviceVO.java
@@ -0,0 +1,161 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.dao;
+
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+import java.util.UUID;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * ExternalFirewallDeviceVO contains information of a external firewall device (Juniper SRX) added into a deployment
+  */
+
+@Entity
+@Table(name="external_firewall_devices")
+public class ExternalFirewallDeviceVO implements InternalIdentity, Identity {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private long id;
+
+    @Column(name="uuid")
+    private String uuid;
+
+    @Column(name = "host_id")
+    private long hostId;
+
+    @Column(name = "physical_network_id")
+    private long physicalNetworkId;
+
+    @Column(name = "provider_name")
+    private String providerName;
+
+    @Column(name = "device_name")
+    private String deviceName;
+
+    @Column(name="device_state")
+    @Enumerated(value=EnumType.STRING)
+    FirewallDeviceState deviceState;
+
+    @Column(name="is_dedicated")
+    private boolean isDedicatedDevice;
+
+    @Column(name = "capacity")
+    private long capacity;
+
+    @Column(name = "allocation_state")
+    @Enumerated(value=EnumType.STRING)
+    private FirewallDeviceAllocationState allocationState;
+
+    //keeping it enum for future possible states Maintenance, Shutdown
+    public enum FirewallDeviceState {
+        Enabled,
+        Disabled
+    }
+
+    public enum FirewallDeviceAllocationState {
+        Free,
+        Allocated
+    }
+
+    public ExternalFirewallDeviceVO(long hostId, long physicalNetworkId, String provider_name, String device_name, long capacity, boolean dedicated) {
+        this.physicalNetworkId = physicalNetworkId;
+        this.providerName = provider_name;
+        this.deviceName = device_name;
+        this.hostId = hostId;
+        this.deviceState = FirewallDeviceState.Disabled;
+        this.allocationState = FirewallDeviceAllocationState.Free;
+        this.capacity = capacity;
+        this.isDedicatedDevice = dedicated;
+        this.deviceState = FirewallDeviceState.Enabled;
+        this.uuid = UUID.randomUUID().toString();
+    }
+
+    public ExternalFirewallDeviceVO() {
+        this.uuid = UUID.randomUUID().toString();
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public String getProviderName() {
+        return providerName;
+    }
+
+    public String getDeviceName() {
+        return deviceName;
+    }
+
+    public long getHostId() {
+        return hostId;
+    }
+
+    public long getCapacity() {
+        return capacity;
+    }
+
+    public void setCapacity(long capacity) {
+        this.capacity = capacity;
+    }
+
+    public FirewallDeviceState getDeviceState() {
+        return deviceState;
+    }
+
+    public void setDeviceState(FirewallDeviceState state) {
+        this.deviceState = state;
+    }
+
+    public FirewallDeviceAllocationState getAllocationState() {
+        return allocationState;
+    }
+
+    public void setAllocationState(FirewallDeviceAllocationState allocationState) {
+        this.allocationState = allocationState;
+    }
+
+    public boolean getIsDedicatedDevice() {
+        return isDedicatedDevice;
+    }
+
+    public void setIsDedicatedDevice(boolean isDedicated) {
+        isDedicatedDevice = isDedicated;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDao.java b/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDao.java
index 6a44b2e..1bd2107 100644
--- a/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDao.java
+++ b/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDao.java
@@ -17,9 +17,9 @@
 package com.cloud.network.dao;
 
 import java.util.List;
-import com.cloud.network.ExternalLoadBalancerDeviceVO;
-import com.cloud.network.ExternalLoadBalancerDeviceVO.LBDeviceAllocationState;
-import com.cloud.network.ExternalLoadBalancerDeviceVO.LBDeviceState;
+
+import com.cloud.network.dao.ExternalLoadBalancerDeviceVO.LBDeviceAllocationState;
+import com.cloud.network.dao.ExternalLoadBalancerDeviceVO.LBDeviceState;
 import com.cloud.utils.db.GenericDao;
 
 public interface ExternalLoadBalancerDeviceDao extends GenericDao<ExternalLoadBalancerDeviceVO, Long> {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDaoImpl.java b/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDaoImpl.java
index 6fddfa7..e559fad 100644
--- a/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDaoImpl.java
+++ b/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceDaoImpl.java
@@ -21,9 +21,8 @@ import javax.ejb.Local;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.network.ExternalLoadBalancerDeviceVO;
-import com.cloud.network.ExternalLoadBalancerDeviceVO.LBDeviceAllocationState;
-import com.cloud.network.ExternalLoadBalancerDeviceVO.LBDeviceState;
+import com.cloud.network.dao.ExternalLoadBalancerDeviceVO.LBDeviceAllocationState;
+import com.cloud.network.dao.ExternalLoadBalancerDeviceVO.LBDeviceState;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceVO.java b/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceVO.java
new file mode 100644
index 0000000..cd9dffd
--- /dev/null
+++ b/server/src/com/cloud/network/dao/ExternalLoadBalancerDeviceVO.java
@@ -0,0 +1,200 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.dao;
+
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
+
+import java.util.UUID;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * ExternalLoadBalancerDeviceVO contains information on external load balancer devices (F5/Netscaler VPX,MPX,SDX) added into a deployment
+  */
+
+@Entity
+@Table(name="external_load_balancer_devices")
+public class ExternalLoadBalancerDeviceVO implements InternalIdentity, Identity {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private long id;
+
+    @Column(name="uuid")
+    private String uuid;
+
+    @Column(name = "host_id")
+    private long hostId;
+
+    @Column(name = "physical_network_id")
+    private long physicalNetworkId;
+    
+    @Column(name = "provider_name")
+    private String providerName;
+
+    @Column(name = "device_name")
+    private String deviceName;
+
+    @Column(name="device_state")
+    @Enumerated(value=EnumType.STRING)
+    private LBDeviceState state;
+
+    @Column(name = "allocation_state")
+    @Enumerated(value=EnumType.STRING)
+    private LBDeviceAllocationState allocationState;
+
+    @Column(name="is_managed")
+    private boolean isManagedDevice;
+
+    @Column(name="is_dedicated")
+    private boolean isDedicatedDevice;
+
+    @Column(name = "parent_host_id")
+    private long parentHostId;
+
+    @Column(name = "capacity")
+    private long capacity;
+
+    //keeping it enum for future possible states Maintenance, Shutdown
+    public enum LBDeviceState {
+        Enabled,
+        Disabled
+    }
+
+    public enum LBDeviceAllocationState {
+        Free,      // In this state no networks are using this device for load balancing
+        Shared,    // In this state one or more networks will be using this device for load balancing
+        Dedicated, // In this state this device is dedicated for a single network
+        Provider   // This state is set only for device that can dynamically provision LB appliances
+    }
+
+    public ExternalLoadBalancerDeviceVO(long hostId, long physicalNetworkId, String provider_name, String device_name,
+            long capacity, boolean dedicated) {
+        this.physicalNetworkId = physicalNetworkId;
+        this.providerName = provider_name;
+        this.deviceName = device_name;
+        this.hostId = hostId;
+        this.state = LBDeviceState.Disabled;
+        this.allocationState = LBDeviceAllocationState.Free;
+        this.capacity = capacity;
+        this.isDedicatedDevice = dedicated;
+        this.isManagedDevice = false;
+        this.state = LBDeviceState.Enabled;
+        this.uuid = UUID.randomUUID().toString();
+
+        if (device_name.equalsIgnoreCase(ExternalNetworkDeviceManager.NetworkDevice.NetscalerSDXLoadBalancer.getName())) {
+            this.allocationState = LBDeviceAllocationState.Provider;
+        }
+    }
+
+    public ExternalLoadBalancerDeviceVO(long hostId, long physicalNetworkId, String provider_name, String device_name,
+            long capacity, boolean dedicated, boolean managed, long parentHostId) {
+        this(hostId, physicalNetworkId, provider_name, device_name, capacity, dedicated);
+        this.isManagedDevice = managed;
+        this.parentHostId = parentHostId;
+    }
+
+    public ExternalLoadBalancerDeviceVO() {
+        this.uuid = UUID.randomUUID().toString();
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public String getProviderName() {
+        return providerName;
+    }
+
+    public String getDeviceName() {
+        return deviceName;
+    }
+
+    public long getHostId() {
+        return hostId;
+    }
+
+    public long getParentHostId() {
+        return parentHostId;
+    }
+
+    public void setParentHostId(long parentHostId) {
+        this.parentHostId = parentHostId;
+    }
+
+    public long getCapacity() {
+        return capacity;
+    }
+
+    public void setCapacity(long capacity) {
+        this.capacity = capacity;
+    }
+
+    public LBDeviceState getState() {
+        return state;
+    }
+
+    public void setState(LBDeviceState state) {
+        this.state = state;
+    }    
+
+    public LBDeviceAllocationState getAllocationState() {
+        return allocationState;
+    }
+
+    public void setAllocationState(LBDeviceAllocationState allocationState) {
+        this.allocationState = allocationState;
+    }
+    
+    public boolean getIsManagedDevice() {
+        return isManagedDevice;
+    }
+
+    public void setIsManagedDevice(boolean managed) {
+        this.isManagedDevice = managed;
+    }
+
+    public boolean getIsDedicatedDevice() {
+        return isDedicatedDevice;
+    }
+
+    public void setIsDedicatedDevice(boolean isDedicated) {
+        isDedicatedDevice = isDedicated;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/FirewallRulesCidrsDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/FirewallRulesCidrsDao.java b/server/src/com/cloud/network/dao/FirewallRulesCidrsDao.java
index c50a128..d020ea7 100644
--- a/server/src/com/cloud/network/dao/FirewallRulesCidrsDao.java
+++ b/server/src/com/cloud/network/dao/FirewallRulesCidrsDao.java
@@ -18,7 +18,6 @@ package com.cloud.network.dao;
 
 import java.util.List;
 
-import com.cloud.network.FirewallRulesCidrsVO;
 import com.cloud.utils.db.GenericDao;
 
 public interface FirewallRulesCidrsDao extends GenericDao<FirewallRulesCidrsVO, Long> {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java b/server/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
index 85f3d8e..b007e19 100644
--- a/server/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
+++ b/server/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
@@ -24,7 +24,6 @@ import javax.ejb.Local;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
-import com.cloud.network.FirewallRulesCidrsVO;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/FirewallRulesCidrsVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/FirewallRulesCidrsVO.java b/server/src/com/cloud/network/dao/FirewallRulesCidrsVO.java
new file mode 100644
index 0000000..75b8919
--- /dev/null
+++ b/server/src/com/cloud/network/dao/FirewallRulesCidrsVO.java
@@ -0,0 +1,65 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.dao;
+
+import org.apache.cloudstack.api.InternalIdentity;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name=("firewall_rules_cidrs"))
+public class FirewallRulesCidrsVO implements InternalIdentity {
+    @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+    @Column(name="id")
+    private Long id;
+
+    @Column(name="firewall_rule_id")
+    private long firewallRuleId;
+
+    @Column(name="source_cidr")
+    private String sourceCidrList;
+
+    public FirewallRulesCidrsVO() { }
+
+    public FirewallRulesCidrsVO(long firewallRuleId, String sourceCidrList) {
+        this.firewallRuleId = firewallRuleId;
+        this.sourceCidrList = sourceCidrList;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public long getFirewallRuleId() {
+        return firewallRuleId;
+    }
+
+    public String getCidr() {
+        return sourceCidrList;
+    }
+
+    public String getSourceCidrList() {
+        return sourceCidrList;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/FirewallRulesDaoImpl.java b/server/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
index 0c79676..e671f6f 100644
--- a/server/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
+++ b/server/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
@@ -23,7 +23,6 @@ import javax.inject.Inject;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.network.IPAddressVO;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.FirewallRuleType;
 import com.cloud.network.rules.FirewallRule.Purpose;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/IPAddressDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/IPAddressDao.java b/server/src/com/cloud/network/dao/IPAddressDao.java
index ccf3f06..9cdb975 100755
--- a/server/src/com/cloud/network/dao/IPAddressDao.java
+++ b/server/src/com/cloud/network/dao/IPAddressDao.java
@@ -19,7 +19,6 @@ package com.cloud.network.dao;
 import java.util.List;
 
 import com.cloud.dc.Vlan.VlanType;
-import com.cloud.network.IPAddressVO;
 import com.cloud.utils.db.GenericDao;
 import com.cloud.utils.net.Ip;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/IPAddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/IPAddressDaoImpl.java b/server/src/com/cloud/network/dao/IPAddressDaoImpl.java
index 4d6bd08..e7067d9 100755
--- a/server/src/com/cloud/network/dao/IPAddressDaoImpl.java
+++ b/server/src/com/cloud/network/dao/IPAddressDaoImpl.java
@@ -31,7 +31,6 @@ import org.springframework.stereotype.Component;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.dc.VlanVO;
 import com.cloud.dc.dao.VlanDaoImpl;
-import com.cloud.network.IPAddressVO;
 import com.cloud.network.IpAddress.State;
 import com.cloud.server.ResourceTag.TaggedResourceType;
 import com.cloud.tags.dao.ResourceTagsDaoImpl;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fbecf15/server/src/com/cloud/network/dao/IPAddressVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/IPAddressVO.java b/server/src/com/cloud/network/dao/IPAddressVO.java
new file mode 100644
index 0000000..00da5eb
--- /dev/null
+++ b/server/src/com/cloud/network/dao/IPAddressVO.java
@@ -0,0 +1,295 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.dao;
+
+import java.util.Date;
+import java.util.UUID;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
+import org.apache.cloudstack.api.Identity;
+
+import com.cloud.network.IpAddress;
+import com.cloud.network.IpAddress.State;
+import com.cloud.utils.net.Ip;
+import org.apache.cloudstack.api.InternalIdentity;
+
+/**
+ * A bean representing a public IP Address
+ *
+ */
+@Entity
+@Table(name=("user_ip_address"))
+public class IPAddressVO implements IpAddress {
+    @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+    @Column(name="id")
+    long id;
+
+	@Column(name="account_id")
+	private Long allocatedToAccountId = null;
+
+    @Column(name="domain_id")
+    private Long allocatedInDomainId = null;
+
+	@Id
+	@Column(name="public_ip_address")
+	@Enumerated(value=EnumType.STRING)
+	private Ip address = null;
+
+	@Column(name="data_center_id", updatable=false)
+	private long dataCenterId;
+
+	@Column(name="source_nat")
+	private boolean sourceNat;
+
+	@Column(name="allocated")
+	@Temporal(value=TemporalType.TIMESTAMP)
+	private Date allocatedTime;
+
+	@Column(name="vlan_db_id")
+	private long vlanId;
+
+	@Column(name="one_to_one_nat")
+	private boolean oneToOneNat;
+
+	@Column(name="vm_id")
+    private Long associatedWithVmId;
+
+	@Column(name="state")
+	private State state;
+
+	@Column(name="mac_address")
+	private long macAddress;
+
+	@Column(name="source_network_id")
+    private Long sourceNetworkId;
+
+	@Column(name="network_id")
+	private Long associatedWithNetworkId;
+
+	@Column(name="uuid")
+	private String uuid;
+
+    @Column(name="physical_network_id")
+    private Long physicalNetworkId;
+
+    @Column(name="is_system")
+    private boolean system;
+
+	@Column(name="account_id")
+	@Transient
+	private Long accountId = null;
+
+	@Transient
+    @Column(name="domain_id")
+    private Long domainId = null;
+
+    @Column(name="vpc_id")
+    private Long vpcId;
+
+	protected IPAddressVO() {
+		this.uuid = UUID.randomUUID().toString();
+	}
+
+	@Override
+    public boolean readyToUse() {
+	    return state == State.Allocated;
+	}
+
+	public IPAddressVO(Ip address, long dataCenterId, long macAddress, long vlanDbId, boolean sourceNat) {
+		this.address = address;
+		this.dataCenterId = dataCenterId;
+		this.vlanId = vlanDbId;
+		this.sourceNat = sourceNat;
+		this.allocatedInDomainId = null;
+		this.allocatedToAccountId = null;
+		this.allocatedTime = null;
+		this.state = State.Free;
+		this.macAddress = macAddress;
+		this.uuid = UUID.randomUUID().toString();
+	}
+
+    public long getMacAddress() {
+	    return macAddress;
+	}
+
+	@Override
+    public long getDataCenterId() {
+	    return dataCenterId;
+	}
+
+	@Override
+    public Ip getAddress() {
+		return address;
+	}
+
+	@Override
+    public Long getAllocatedToAccountId() {
+		return allocatedToAccountId;
+	}
+
+    @Override
+    public Long getAllocatedInDomainId() {
+        return allocatedInDomainId;
+    }
+
+	@Override
+	public Long getAssociatedWithNetworkId() {
+	    return associatedWithNetworkId;
+	}
+
+	public void setAssociatedWithNetworkId(Long networkId) {
+	    this.associatedWithNetworkId = networkId;
+	}
+
+	@Override
+    public Long getAssociatedWithVmId() {
+        return associatedWithVmId;
+    }
+
+    public void setAssociatedWithVmId(Long associatedWithVmId) {
+        this.associatedWithVmId = associatedWithVmId;
+    }
+
+	@Override
+    public Date getAllocatedTime() {
+		return allocatedTime;
+	}
+
+    public void setAllocatedToAccountId(Long accountId) {
+		this.allocatedToAccountId = accountId;
+	}
+
+    public void setAllocatedInDomainId(Long domainId) {
+        this.allocatedInDomainId = domainId;
+    }
+
+    public void setSourceNat(boolean sourceNat) {
+		this.sourceNat = sourceNat;
+	}
+
+	@Override
+    public boolean isSourceNat() {
+		return sourceNat;
+	}
+
+    public void setAllocatedTime(Date allocated) {
+		this.allocatedTime = allocated;
+	}
+
+	@Override
+    public long getVlanId() {
+		return this.vlanId;
+	}
+
+    public void setVlanId(long vlanDbId) {
+		this.vlanId = vlanDbId;
+	}
+
+	@Override
+    public boolean isOneToOneNat() {
+		return oneToOneNat;
+	}
+
+    public void setOneToOneNat(boolean oneToOneNat) {
+		this.oneToOneNat = oneToOneNat;
+	}
+
+    @Override
+    public long getDomainId() {
+        return allocatedInDomainId == null ? -1 : allocatedInDomainId;
+    }
+
+    @Override
+    public long getAccountId() {
+        return allocatedToAccountId == null ? -1 : allocatedToAccountId;
+    }
+
+    @Override
+    public State getState() {
+        return state;
+    }
+
+    public void setState(State state) {
+        this.state = state;
+    }
+
+	@Override
+    public String toString() {
+	    return new StringBuilder("Ip[").append(address).append("-").append(dataCenterId).append("]").toString();
+	}
+
+	@Override
+    public long getId() {
+        return id;
+    }
+
+    public Long getSourceNetworkId() {
+        return sourceNetworkId;
+    }
+
+    public void setSourceNetworkId(Long sourceNetworkId) {
+        this.sourceNetworkId = sourceNetworkId;
+    }
+
+    @Override
+    public String getUuid() {
+    	return this.uuid;
+    }
+
+    public void setUuid(String uuid) {
+    	this.uuid = uuid;
+    }
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public void setPhysicalNetworkId(Long physicalNetworkId) {
+        this.physicalNetworkId = physicalNetworkId;
+    }
+
+    @Override
+	public boolean getSystem() {
+		return system;
+	}
+
+	public void setSystem(boolean isSystem) {
+		this.system = isSystem;
+	}
+
+	@Override
+    public Long getVpcId() {
+        return vpcId;
+    }
+
+	@Override
+    public void setVpcId(Long vpcId) {
+        this.vpcId = vpcId;
+    }
+}