cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [25/50] git commit: updated refs/heads/master to 3c429ee
Date Tue, 17 Mar 2015 10:26:27 GMT
Adding nre method to NetworkDao
  - listVpcNetworks() to be used for the router check task


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0a133c06
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0a133c06
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0a133c06

Branch: refs/heads/master
Commit: 0a133c06f831067e8792e0f2068dbe960e8dce84
Parents: 6194b2c
Author: wilderrodrigues <wrodrigues@schubergphilis.com>
Authored: Thu Feb 5 15:54:39 2015 +0100
Committer: wilderrodrigues <wrodrigues@schubergphilis.com>
Committed: Mon Mar 16 11:40:01 2015 +0100

----------------------------------------------------------------------
 .../src/com/cloud/network/dao/NetworkDao.java   |   2 +
 .../com/cloud/network/dao/NetworkDaoImpl.java   | 234 ++++++++++---------
 .../com/cloud/vm/dao/DomainRouterDaoImpl.java   | 162 ++++++-------
 .../VirtualNetworkApplianceManagerImpl.java     |  36 ++-
 .../com/cloud/vpc/dao/MockNetworkDaoImpl.java   |  78 ++++---
 5 files changed, 273 insertions(+), 239 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a133c06/engine/schema/src/com/cloud/network/dao/NetworkDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkDao.java b/engine/schema/src/com/cloud/network/dao/NetworkDao.java
index 6d49b0a..037f776 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDao.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDao.java
@@ -112,6 +112,8 @@ public interface NetworkDao extends GenericDao<NetworkVO, Long>, StateDao<State,
 
     List<NetworkVO> listRedundantNetworks();
 
+    List<NetworkVO> listVpcNetworks();
+
     List<NetworkVO> listByAclId(long aclId);
 
     int getNonSystemNetworkCountByVpcId(long vpcId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a133c06/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java b/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
index 0c556c8..433eded 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
@@ -25,9 +25,8 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.persistence.TableGenerator;
 
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.springframework.stereotype.Component;
 
 import com.cloud.network.Network;
 import com.cloud.network.Network.Event;
@@ -116,7 +115,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         AllFieldsSearch.and("broadcastUri", AllFieldsSearch.entity().getBroadcastUri(), Op.EQ);
         AllFieldsSearch.and("vpcId", AllFieldsSearch.entity().getVpcId(), Op.EQ);
         AllFieldsSearch.and("aclId", AllFieldsSearch.entity().getNetworkACLId(), Op.EQ);
-        SearchBuilder<NetworkOfferingVO> join1 = _ntwkOffDao.createSearchBuilder();
+        final SearchBuilder<NetworkOfferingVO> join1 = _ntwkOffDao.createSearchBuilder();
         join1.and("isSystem", join1.entity().isSystemOnly(), Op.EQ);
         join1.and("isRedundant", join1.entity().getRedundantRouter(), Op.EQ);
         AllFieldsSearch.join("offerings", join1, AllFieldsSearch.entity().getNetworkOfferingId(), join1.entity().getId(), JoinBuilder.JoinType.INNER);
@@ -124,7 +123,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
 
         AccountSearch = createSearchBuilder();
         AccountSearch.and("offering", AccountSearch.entity().getNetworkOfferingId(), Op.EQ);
-        SearchBuilder<NetworkAccountVO> join = _accountsDao.createSearchBuilder();
+        final SearchBuilder<NetworkAccountVO> join = _accountsDao.createSearchBuilder();
         join.and("account", join.entity().getAccountId(), Op.EQ);
         AccountSearch.join("accounts", join, AccountSearch.entity().getId(), join.entity().getNetworkId(), JoinBuilder.JoinType.INNER);
         AccountSearch.and("datacenter", AccountSearch.entity().getDataCenterId(), Op.EQ);
@@ -135,14 +134,14 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         RelatedConfigSearch = createSearchBuilder();
         RelatedConfigSearch.and("offering", RelatedConfigSearch.entity().getNetworkOfferingId(), Op.EQ);
         RelatedConfigSearch.and("datacenter", RelatedConfigSearch.entity().getDataCenterId(), Op.EQ);
-        SearchBuilder<NetworkAccountVO> join2 = _accountsDao.createSearchBuilder();
+        final SearchBuilder<NetworkAccountVO> join2 = _accountsDao.createSearchBuilder();
         join2.and("account", join2.entity().getAccountId(), Op.EQ);
         RelatedConfigSearch.join("account", join2, join2.entity().getNetworkId(), RelatedConfigSearch.entity().getId(), JoinType.INNER);
         RelatedConfigSearch.done();
 
         AccountNetworkSearch = createSearchBuilder();
         AccountNetworkSearch.and("networkId", AccountNetworkSearch.entity().getId(), Op.EQ);
-        SearchBuilder<NetworkAccountVO> mapJoin = _accountsDao.createSearchBuilder();
+        final SearchBuilder<NetworkAccountVO> mapJoin = _accountsDao.createSearchBuilder();
         mapJoin.and("accountId", mapJoin.entity().getAccountId(), Op.EQ);
         AccountNetworkSearch.join("networkSearch", mapJoin, AccountNetworkSearch.entity().getId(), mapJoin.entity().getNetworkId(), JoinBuilder.JoinType.INNER);
         AccountNetworkSearch.done();
@@ -163,7 +162,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
 
         ZoneSecurityGroupSearch = createSearchBuilder();
         ZoneSecurityGroupSearch.and("dataCenterId", ZoneSecurityGroupSearch.entity().getDataCenterId(), Op.EQ);
-        SearchBuilder<NetworkServiceMapVO> offJoin = _ntwkSvcMap.createSearchBuilder();
+        final SearchBuilder<NetworkServiceMapVO> offJoin = _ntwkSvcMap.createSearchBuilder();
         offJoin.and("service", offJoin.entity().getService(), Op.EQ);
         ZoneSecurityGroupSearch.join("services", offJoin, ZoneSecurityGroupSearch.entity().getId(), offJoin.entity().getNetworkId(), JoinBuilder.JoinType.INNER);
         ZoneSecurityGroupSearch.done();
@@ -173,7 +172,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         CountBy.and("offeringId", CountBy.entity().getNetworkOfferingId(), Op.EQ);
         CountBy.and("vpcId", CountBy.entity().getVpcId(), Op.EQ);
         CountBy.and("removed", CountBy.entity().getRemoved(), Op.NULL);
-        SearchBuilder<NetworkOfferingVO> ntwkOffJoin = _ntwkOffDao.createSearchBuilder();
+        final SearchBuilder<NetworkOfferingVO> ntwkOffJoin = _ntwkOffDao.createSearchBuilder();
         ntwkOffJoin.and("isSystem", ntwkOffJoin.entity().isSystemOnly(), Op.EQ);
         CountBy.join("offerings", ntwkOffJoin, CountBy.entity().getNetworkOfferingId(), ntwkOffJoin.entity().getId(), JoinBuilder.JoinType.INNER);
         CountBy.done();
@@ -183,7 +182,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         PhysicalNetworkSearch.done();
 
         SecurityGroupSearch = createSearchBuilder();
-        SearchBuilder<NetworkServiceMapVO> join3 = _ntwkSvcMap.createSearchBuilder();
+        final SearchBuilder<NetworkServiceMapVO> join3 = _ntwkSvcMap.createSearchBuilder();
         join3.and("service", join3.entity().getService(), Op.EQ);
         SecurityGroupSearch.join("services", join3, SecurityGroupSearch.entity().getId(), join3.entity().getNetworkId(), JoinBuilder.JoinType.INNER);
         SecurityGroupSearch.done();
@@ -197,15 +196,15 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         NetworksRegularUserCanCreateSearch.and("aclType", NetworksRegularUserCanCreateSearch.entity().getAclType(), Op.EQ);
         NetworksRegularUserCanCreateSearch.and("displayNetwork", NetworksRegularUserCanCreateSearch.entity().getDisplayNetwork(), Op.EQ);
         NetworksRegularUserCanCreateSearch.select(null, Func.COUNT, NetworksRegularUserCanCreateSearch.entity().getId());
-        SearchBuilder<NetworkAccountVO> join4 = _accountsDao.createSearchBuilder();
+        final SearchBuilder<NetworkAccountVO> join4 = _accountsDao.createSearchBuilder();
         join4.and("account", join4.entity().getAccountId(), Op.EQ);
         join4.and("isOwner", join4.entity().isOwner(), Op.EQ);
         NetworksRegularUserCanCreateSearch.join("accounts", join4, NetworksRegularUserCanCreateSearch.entity().getId(), join4.entity().getNetworkId(),
-            JoinBuilder.JoinType.INNER);
-        SearchBuilder<NetworkOfferingVO> join5 = _ntwkOffDao.createSearchBuilder();
+                JoinBuilder.JoinType.INNER);
+        final SearchBuilder<NetworkOfferingVO> join5 = _ntwkOffDao.createSearchBuilder();
         join5.and("specifyVlan", join5.entity().getSpecifyVlan(), Op.EQ);
         NetworksRegularUserCanCreateSearch.join("ntwkOff", join5, NetworksRegularUserCanCreateSearch.entity().getNetworkOfferingId(), join5.entity().getId(),
-            JoinBuilder.JoinType.INNER);
+                JoinBuilder.JoinType.INNER);
         NetworksRegularUserCanCreateSearch.done();
 
         _tgMacAddress = _tgs.get("macAddress");
@@ -214,7 +213,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         SourceNATSearch.and("account", SourceNATSearch.entity().getAccountId(), Op.EQ);
         SourceNATSearch.and("datacenter", SourceNATSearch.entity().getDataCenterId(), Op.EQ);
         SourceNATSearch.and("guestType", SourceNATSearch.entity().getGuestType(), Op.EQ);
-        SearchBuilder<NetworkServiceMapVO> join6 = _ntwkSvcMap.createSearchBuilder();
+        final SearchBuilder<NetworkServiceMapVO> join6 = _ntwkSvcMap.createSearchBuilder();
         join6.and("service", join6.entity().getService(), Op.EQ);
         SourceNATSearch.join("services", join6, SourceNATSearch.entity().getId(), join6.entity().getNetworkId(), JoinBuilder.JoinType.INNER);
         SourceNATSearch.done();
@@ -222,33 +221,33 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         VpcNetworksCount = createSearchBuilder(Long.class);
         VpcNetworksCount.and("vpcId", VpcNetworksCount.entity().getVpcId(), Op.EQ);
         VpcNetworksCount.select(null, Func.COUNT, VpcNetworksCount.entity().getId());
-        SearchBuilder<NetworkOfferingVO> join9 = _ntwkOffDao.createSearchBuilder();
+        final SearchBuilder<NetworkOfferingVO> join9 = _ntwkOffDao.createSearchBuilder();
         join9.and("isSystem", join9.entity().isSystemOnly(), Op.EQ);
         VpcNetworksCount.join("offerings", join9, VpcNetworksCount.entity().getNetworkOfferingId(), join9.entity().getId(), JoinBuilder.JoinType.INNER);
         VpcNetworksCount.done();
 
         OfferingAccountNetworkSearch = createSearchBuilder();
         OfferingAccountNetworkSearch.select(null, Func.DISTINCT, OfferingAccountNetworkSearch.entity().getId());
-        SearchBuilder<NetworkOfferingVO> ntwkOfferingJoin = _ntwkOffDao.createSearchBuilder();
+        final SearchBuilder<NetworkOfferingVO> ntwkOfferingJoin = _ntwkOffDao.createSearchBuilder();
         ntwkOfferingJoin.and("isSystem", ntwkOfferingJoin.entity().isSystemOnly(), Op.EQ);
         OfferingAccountNetworkSearch.join("ntwkOfferingSearch", ntwkOfferingJoin, OfferingAccountNetworkSearch.entity().getNetworkOfferingId(), ntwkOfferingJoin.entity()
-            .getId(), JoinBuilder.JoinType.LEFT);
-        SearchBuilder<NetworkAccountVO> ntwkAccountJoin = _accountsDao.createSearchBuilder();
+                .getId(), JoinBuilder.JoinType.LEFT);
+        final SearchBuilder<NetworkAccountVO> ntwkAccountJoin = _accountsDao.createSearchBuilder();
         ntwkAccountJoin.and("accountId", ntwkAccountJoin.entity().getAccountId(), Op.EQ);
         OfferingAccountNetworkSearch.join("ntwkAccountSearch", ntwkAccountJoin, OfferingAccountNetworkSearch.entity().getId(), ntwkAccountJoin.entity().getNetworkId(),
-            JoinBuilder.JoinType.INNER);
+                JoinBuilder.JoinType.INNER);
         OfferingAccountNetworkSearch.and("zoneId", OfferingAccountNetworkSearch.entity().getDataCenterId(), Op.EQ);
         OfferingAccountNetworkSearch.and("type", OfferingAccountNetworkSearch.entity().getGuestType(), Op.EQ);
         OfferingAccountNetworkSearch.done();
 
         GarbageCollectedSearch = createSearchBuilder(Long.class);
         GarbageCollectedSearch.selectFields(GarbageCollectedSearch.entity().getId());
-        SearchBuilder<NetworkOpVO> join7 = _ntwkOpDao.createSearchBuilder();
+        final SearchBuilder<NetworkOpVO> join7 = _ntwkOpDao.createSearchBuilder();
         join7.and("activenics", join7.entity().getActiveNicsCount(), Op.EQ);
         join7.and("gc", join7.entity().isGarbageCollected(), Op.EQ);
         join7.and("check", join7.entity().isCheckForGc(), Op.EQ);
         GarbageCollectedSearch.join("ntwkOpGC", join7, GarbageCollectedSearch.entity().getId(), join7.entity().getId(), JoinBuilder.JoinType.INNER);
-        SearchBuilder<NetworkOfferingVO> join8 = _ntwkOffDao.createSearchBuilder();
+        final SearchBuilder<NetworkOfferingVO> join8 = _ntwkOffDao.createSearchBuilder();
         join8.and("isPersistent", join8.entity().getIsPersistent(), Op.EQ);
         GarbageCollectedSearch.join("ntwkOffGC", join8, GarbageCollectedSearch.entity().getNetworkOfferingId(), join8.entity().getId(), JoinBuilder.JoinType.INNER);
         GarbageCollectedSearch.done();
@@ -256,8 +255,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listByZoneAndGuestType(long accountId, long dataCenterId, Network.GuestType type, Boolean isSystem) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> listByZoneAndGuestType(final long accountId, final long dataCenterId, final Network.GuestType type, final Boolean isSystem) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("datacenter", dataCenterId);
         sc.setParameters("account", accountId);
         if (type != null) {
@@ -271,8 +270,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         return listBy(sc, null);
     }
 
-    public List<NetworkVO> findBy(TrafficType trafficType, Mode mode, BroadcastDomainType broadcastType, long networkOfferingId, long dataCenterId) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> findBy(final TrafficType trafficType, final Mode mode, final BroadcastDomainType broadcastType, final long networkOfferingId, final long dataCenterId) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("trafficType", trafficType);
         sc.setParameters("broadcastType", broadcastType);
         sc.setParameters("offering", networkOfferingId);
@@ -282,8 +281,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listBy(long accountId, long offeringId, long dataCenterId) {
-        SearchCriteria<NetworkVO> sc = AccountSearch.create();
+    public List<NetworkVO> listBy(final long accountId, final long offeringId, final long dataCenterId) {
+        final SearchCriteria<NetworkVO> sc = AccountSearch.create();
         sc.setParameters("offering", offeringId);
         sc.setJoinParameters("accounts", "account", accountId);
         sc.setParameters("datacenter", dataCenterId);
@@ -292,8 +291,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listBy(long accountId, long dataCenterId, String cidr, boolean skipVpc) {
-        SearchCriteria<NetworkVO> sc = AccountSearch.create();
+    public List<NetworkVO> listBy(final long accountId, final long dataCenterId, final String cidr, final boolean skipVpc) {
+        final SearchCriteria<NetworkVO> sc = AccountSearch.create();
         sc.setJoinParameters("accounts", "account", accountId);
         sc.setParameters("datacenter", dataCenterId);
         sc.setParameters("cidr", cidr);
@@ -306,16 +305,16 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
 
     @Override
     @DB
-    public NetworkVO persist(NetworkVO network, boolean gc, Map<String, String> serviceProviderMap) {
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
+    public NetworkVO persist(final NetworkVO network, final boolean gc, final Map<String, String> serviceProviderMap) {
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
 
         // 1) create network
-        NetworkVO newNetwork = super.persist(network);
+        final NetworkVO newNetwork = super.persist(network);
         // 2) add account to the network
         addAccountToNetwork(network.getId(), network.getAccountId(), true);
         // 3) add network to gc monitor table
-        NetworkOpVO op = new NetworkOpVO(network.getId(), gc);
+        final NetworkOpVO op = new NetworkOpVO(network.getId(), gc);
         _opDao.persist(op);
         // 4) add services/providers for the network
         persistNetworkServiceProviders(newNetwork.getId(), serviceProviderMap);
@@ -326,8 +325,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
 
     @Override
     @DB
-    public boolean update(Long networkId, NetworkVO network, Map<String, String> serviceProviderMap) {
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
+    public boolean update(final Long networkId, final NetworkVO network, final Map<String, String> serviceProviderMap) {
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
 
         super.update(networkId, network);
@@ -342,18 +341,18 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
 
     @Override
     @DB
-    public void persistNetworkServiceProviders(long networkId, Map<String, String> serviceProviderMap) {
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
+    public void persistNetworkServiceProviders(final long networkId, final Map<String, String> serviceProviderMap) {
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
-        for (String service : serviceProviderMap.keySet()) {
-            NetworkServiceMapVO serviceMap = new NetworkServiceMapVO(networkId, Service.getService(service), Provider.getProvider(serviceProviderMap.get(service)));
+        for (final String service : serviceProviderMap.keySet()) {
+            final NetworkServiceMapVO serviceMap = new NetworkServiceMapVO(networkId, Service.getService(service), Provider.getProvider(serviceProviderMap.get(service)));
             _ntwkSvcMap.persist(serviceMap);
         }
         txn.commit();
     }
 
-    protected void addAccountToNetwork(long networkId, long accountId, boolean isOwner) {
-        NetworkAccountVO account = new NetworkAccountVO(networkId, accountId, isOwner);
+    protected void addAccountToNetwork(final long networkId, final long accountId, final boolean isOwner) {
+        final NetworkAccountVO account = new NetworkAccountVO(networkId, accountId, isOwner);
         _accountsDao.persist(account);
     }
 
@@ -363,8 +362,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> getNetworksForOffering(long offeringId, long dataCenterId, long accountId) {
-        SearchCriteria<NetworkVO> sc = RelatedConfigSearch.create();
+    public List<NetworkVO> getNetworksForOffering(final long offeringId, final long dataCenterId, final long accountId) {
+        final SearchCriteria<NetworkVO> sc = RelatedConfigSearch.create();
         sc.setParameters("offering", offeringId);
         sc.setParameters("dc", dataCenterId);
         sc.setJoinParameters("account", "account", accountId);
@@ -372,26 +371,26 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public String getNextAvailableMacAddress(long networkConfigId) {
-        SequenceFetcher fetch = SequenceFetcher.getInstance();
+    public String getNextAvailableMacAddress(final long networkConfigId) {
+        final SequenceFetcher fetch = SequenceFetcher.getInstance();
 
         long seq = fetch.getNextSequence(Long.class, _tgMacAddress, networkConfigId);
-        seq = seq | _prefix << 40 | ((_rand.nextInt(Short.MAX_VALUE) << 16) & 0x00000000ffff0000l);
+        seq = seq | _prefix << 40 | _rand.nextInt(Short.MAX_VALUE) << 16 & 0x00000000ffff0000l;
         return NetUtils.long2Mac(seq);
     }
 
     @Override
-    public List<NetworkVO> listBy(long accountId, long networkId) {
-        SearchCriteria<NetworkVO> sc = AccountNetworkSearch.create();
+    public List<NetworkVO> listBy(final long accountId, final long networkId) {
+        final SearchCriteria<NetworkVO> sc = AccountNetworkSearch.create();
         sc.setParameters("networkId", networkId);
         sc.setJoinParameters("networkSearch", "accountId", accountId);
         return listBy(sc);
     }
 
     @Override
-    public long countByZoneAndUri(long zoneId, String broadcastUri) {
+    public long countByZoneAndUri(final long zoneId, final String broadcastUri) {
 
-        SearchCriteria<Long> sc = CountByZoneAndURI.create();
+        final SearchCriteria<Long> sc = CountByZoneAndURI.create();
         sc.setParameters("dataCenterId", zoneId);
         sc.setParameters("broadcastUri", broadcastUri);
 
@@ -399,15 +398,15 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listByZone(long zoneId) {
-        SearchCriteria<NetworkVO> sc = ZoneBroadcastUriSearch.create();
+    public List<NetworkVO> listByZone(final long zoneId) {
+        final SearchCriteria<NetworkVO> sc = ZoneBroadcastUriSearch.create();
         sc.setParameters("dataCenterId", zoneId);
         return search(sc, null);
     }
 
     @Override
-    public long countByZoneUriAndGuestType(long zoneId, String broadcastUri, GuestType guestType) {
-        SearchCriteria<Long> sc = CountByZoneAndURI.create();
+    public long countByZoneUriAndGuestType(final long zoneId, final String broadcastUri, final GuestType guestType) {
+        final SearchCriteria<Long> sc = CountByZoneAndURI.create();
         sc.setParameters("dataCenterId", zoneId);
         sc.setParameters("broadcastUri", broadcastUri);
         sc.setParameters("guestType", guestType);
@@ -415,8 +414,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listByZoneSecurityGroup(Long zoneId) {
-        SearchCriteria<NetworkVO> sc = ZoneSecurityGroupSearch.create();
+    public List<NetworkVO> listByZoneSecurityGroup(final Long zoneId) {
+        final SearchCriteria<NetworkVO> sc = ZoneSecurityGroupSearch.create();
         if (zoneId != null) {
             sc.setParameters("dataCenterId", zoneId);
         }
@@ -425,18 +424,18 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public void changeActiveNicsBy(long networkId, int count) {
+    public void changeActiveNicsBy(final long networkId, final int count) {
         _opDao.changeActiveNicsBy(networkId, count);
     }
 
     @Override
-    public int getActiveNicsIn(long networkId) {
+    public int getActiveNicsIn(final long networkId) {
         return _opDao.getActiveNics(networkId);
     }
 
     @Override
     public List<Long> findNetworksToGarbageCollect() {
-        SearchCriteria<Long> sc = GarbageCollectedSearch.create();
+        final SearchCriteria<Long> sc = GarbageCollectedSearch.create();
         sc.setJoinParameters("ntwkOffGC", "isPersistent", false);
         sc.setJoinParameters("ntwkOpGC", "activenics", 0);
         sc.setJoinParameters("ntwkOpGC", "gc", true);
@@ -445,73 +444,73 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public void clearCheckForGc(long networkId) {
+    public void clearCheckForGc(final long networkId) {
         _opDao.clearCheckForGc(networkId);
     }
 
     @Override
-    public void setCheckForGc(long networkId) {
+    public void setCheckForGc(final long networkId) {
         _opDao.setCheckForGc(networkId);
     }
 
     @Override
-    public List<NetworkVO> listByOwner(long ownerId) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> listByOwner(final long ownerId) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("account", ownerId);
         return listBy(sc);
     }
 
     @Override
-    public void addDomainToNetwork(long networkId, long domainId, Boolean subdomainAccess) {
+    public void addDomainToNetwork(final long networkId, final long domainId, final Boolean subdomainAccess) {
         addDomainToNetworknetwork(networkId, domainId, subdomainAccess);
     }
 
-    protected void addDomainToNetworknetwork(long networkId, long domainId, Boolean subdomainAccess) {
-        NetworkDomainVO domain = new NetworkDomainVO(networkId, domainId, subdomainAccess);
+    protected void addDomainToNetworknetwork(final long networkId, final long domainId, final Boolean subdomainAccess) {
+        final NetworkDomainVO domain = new NetworkDomainVO(networkId, domainId, subdomainAccess);
         _domainsDao.persist(domain);
     }
 
     @Override
-    public int getNetworkCountByVpcId(long vpcId) {
-        SearchCriteria<Integer> sc = CountBy.create();
+    public int getNetworkCountByVpcId(final long vpcId) {
+        final SearchCriteria<Integer> sc = CountBy.create();
         sc.setParameters("vpcId", vpcId);
-        List<Integer> results = customSearch(sc, null);
+        final List<Integer> results = customSearch(sc, null);
         return results.get(0);
     }
 
     @Override
     public List<NetworkVO> listSecurityGroupEnabledNetworks() {
-        SearchCriteria<NetworkVO> sc = SecurityGroupSearch.create();
+        final SearchCriteria<NetworkVO> sc = SecurityGroupSearch.create();
         sc.setJoinParameters("services", "service", Service.SecurityGroup.getName());
         return listBy(sc);
     }
 
     @Override
-    public List<NetworkVO> listByPhysicalNetwork(long physicalNetworkId) {
-        SearchCriteria<NetworkVO> sc = PhysicalNetworkSearch.create();
+    public List<NetworkVO> listByPhysicalNetwork(final long physicalNetworkId) {
+        final SearchCriteria<NetworkVO> sc = PhysicalNetworkSearch.create();
         sc.setParameters("physicalNetworkId", physicalNetworkId);
         return listBy(sc);
     }
 
     @Override
-    public List<NetworkVO> listByPhysicalNetworkTrafficType(long physicalNetworkId, TrafficType trafficType) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> listByPhysicalNetworkTrafficType(final long physicalNetworkId, final TrafficType trafficType) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("trafficType", trafficType);
         sc.setParameters("physicalNetworkId", physicalNetworkId);
         return listBy(sc);
     }
 
     @Override
-    public List<NetworkVO> listByPhysicalNetworkAndProvider(long physicalNetworkId, String providerName) {
-        SearchBuilder<NetworkServiceMapVO> svcProviderMapSearch = _ntwkSvcMap.createSearchBuilder();
-        NetworkServiceMapVO svcProviderEntry = svcProviderMapSearch.entity();
+    public List<NetworkVO> listByPhysicalNetworkAndProvider(final long physicalNetworkId, final String providerName) {
+        final SearchBuilder<NetworkServiceMapVO> svcProviderMapSearch = _ntwkSvcMap.createSearchBuilder();
+        final NetworkServiceMapVO svcProviderEntry = svcProviderMapSearch.entity();
         svcProviderMapSearch.and("Provider", svcProviderMapSearch.entity().getProvider(), SearchCriteria.Op.EQ);
 
-        SearchBuilder<NetworkVO> networksSearch = createSearchBuilder();
+        final SearchBuilder<NetworkVO> networksSearch = createSearchBuilder();
         networksSearch.and("physicalNetworkId", networksSearch.entity().getPhysicalNetworkId(), Op.EQ);
         networksSearch.join("svcProviderMapSearch", svcProviderMapSearch, networksSearch.entity().getId(), svcProviderEntry.getNetworkId(), JoinBuilder.JoinType.INNER);
 
-        SearchCriteria<NetworkVO> sc = networksSearch.create();
+        final SearchCriteria<NetworkVO> sc = networksSearch.create();
         sc.setJoinParameters("svcProviderMapSearch", "Provider", providerName);
         sc.setParameters("physicalNetworkId", physicalNetworkId);
 
@@ -519,8 +518,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listBy(long accountId, long dataCenterId, Network.GuestType type, TrafficType trafficType) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> listBy(final long accountId, final long dataCenterId, final Network.GuestType type, final TrafficType trafficType) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("datacenter", dataCenterId);
         sc.setParameters("account", accountId);
         sc.setParameters("guestType", type);
@@ -530,8 +529,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listByZoneAndTrafficType(long zoneId, TrafficType trafficType) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> listByZoneAndTrafficType(final long zoneId, final TrafficType trafficType) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("datacenter", zoneId);
         sc.setParameters("trafficType", trafficType);
 
@@ -539,16 +538,16 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public int getNetworkCountByNetworkOffId(long networkOfferingId) {
-        SearchCriteria<Integer> sc = NetworksCount.create();
+    public int getNetworkCountByNetworkOffId(final long networkOfferingId) {
+        final SearchCriteria<Integer> sc = NetworksCount.create();
         sc.setParameters("networkOfferingId", networkOfferingId);
-        List<Integer> count = customSearch(sc, null);
+        final List<Integer> count = customSearch(sc, null);
         return count.get(0);
     }
 
     @Override
-    public long countNetworksUserCanCreate(long ownerId) {
-        SearchCriteria<Long> sc = NetworksRegularUserCanCreateSearch.create();
+    public long countNetworksUserCanCreate(final long ownerId) {
+        final SearchCriteria<Long> sc = NetworksRegularUserCanCreateSearch.create();
         sc.setParameters("aclType", ACLType.Account);
         sc.setParameters("displayNetwork", 1);
         sc.setJoinParameters("accounts", "account", ownerId);
@@ -557,8 +556,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listSourceNATEnabledNetworks(long accountId, long dataCenterId, Network.GuestType type) {
-        SearchCriteria<NetworkVO> sc = SourceNATSearch.create();
+    public List<NetworkVO> listSourceNATEnabledNetworks(final long accountId, final long dataCenterId, final Network.GuestType type) {
+        final SearchCriteria<NetworkVO> sc = SourceNATSearch.create();
         sc.setParameters("datacenter", dataCenterId);
         sc.setParameters("account", accountId);
         sc.setParameters("guestType", type);
@@ -567,19 +566,19 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listByVpc(long vpcId) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> listByVpc(final long vpcId) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("vpcId", vpcId);
 
         return listBy(sc, null);
     }
 
     @Override
-    public NetworkVO getPrivateNetwork(String broadcastUri, String cidr, long accountId, long zoneId, Long networkOfferingId) {
+    public NetworkVO getPrivateNetwork(final String broadcastUri, final String cidr, final long accountId, final long zoneId, Long networkOfferingId) {
         if (networkOfferingId == null) {
             networkOfferingId = _ntwkOffDao.findByUniqueName(NetworkOffering.SystemPrivateGatewayNetworkOffering).getId();
         }
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("datacenter", zoneId);
         sc.setParameters("broadcastUri", broadcastUri);
         sc.setParameters("cidr", cidr);
@@ -590,21 +589,21 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
 
     @Override
     @DB
-    public boolean remove(Long id) {
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
+    public boolean remove(final Long id) {
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
-        NetworkVO entry = findById(id);
+        final NetworkVO entry = findById(id);
         if (entry != null) {
             _tagsDao.removeByIdAndType(id, ResourceObjectType.Network);
         }
-        boolean result = super.remove(id);
+        final boolean result = super.remove(id);
         txn.commit();
         return result;
     }
 
     @Override
-    public long countVpcNetworks(long vpcId) {
-        SearchCriteria<Long> sc = VpcNetworksCount.create();
+    public long countVpcNetworks(final long vpcId) {
+        final SearchCriteria<Long> sc = VpcNetworksCount.create();
         sc.setParameters("vpcId", vpcId);
         //offering shouldn't be system (the one used by the private gateway)
         sc.setJoinParameters("offerings", "isSystem", false);
@@ -612,12 +611,12 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public boolean updateState(State currentState, Event event, State nextState, Network vo, Object data) {
+    public boolean updateState(final State currentState, final Event event, final State nextState, final Network vo, final Object data) {
         // TODO: ensure this update is correct
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
 
-        NetworkVO networkVo = (NetworkVO)vo;
+        final NetworkVO networkVo = (NetworkVO)vo;
         networkVo.setState(nextState);
         super.update(networkVo.getId(), networkVo);
 
@@ -626,38 +625,49 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
     }
 
     @Override
-    public List<NetworkVO> listNetworksByAccount(long accountId, long zoneId, Network.GuestType type, boolean isSystem) {
-        SearchCriteria<NetworkVO> sc = OfferingAccountNetworkSearch.create();
+    public List<NetworkVO> listNetworksByAccount(final long accountId, final long zoneId, final Network.GuestType type, final boolean isSystem) {
+        final SearchCriteria<NetworkVO> sc = OfferingAccountNetworkSearch.create();
         sc.setJoinParameters("ntwkOfferingSearch", "isSystem", isSystem);
         sc.setJoinParameters("ntwkAccountSearch", "accountId", accountId);
         sc.setParameters("zoneId", zoneId);
         sc.setParameters("type", type);
 
-        List<NetworkVO> networks = search(sc, null);
+        final List<NetworkVO> networks = search(sc, null);
         return networks;
     }
 
     @Override
     public List<NetworkVO> listRedundantNetworks() {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setJoinParameters("offerings", "isRedundant", true);
         return listBy(sc, null);
     }
 
     @Override
-    public List<NetworkVO> listByAclId(long aclId) {
-        SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
+    public List<NetworkVO> listVpcNetworks() {
+        final SearchBuilder<NetworkVO> sb = createSearchBuilder();
+        sb.and("vpcId", sb.entity().getVpcId(), Op.NNULL);
+        sb.done();
+
+        final SearchCriteria<NetworkVO> sc = sb.create();
+
+        return listBy(sc);
+    }
+
+    @Override
+    public List<NetworkVO> listByAclId(final long aclId) {
+        final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("aclId", aclId);
 
         return listBy(sc, null);
     }
 
     @Override
-    public int getNonSystemNetworkCountByVpcId(long vpcId) {
-        SearchCriteria<Integer> sc = CountBy.create();
+    public int getNonSystemNetworkCountByVpcId(final long vpcId) {
+        final SearchCriteria<Integer> sc = CountBy.create();
         sc.setParameters("vpcId", vpcId);
         sc.setJoinParameters("offerings", "isSystem", false);
-        List<Integer> results = customSearch(sc, null);
+        final List<Integer> results = customSearch(sc, null);
         return results.get(0);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a133c06/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
index fca1ff8..9f4d17a 100644
--- a/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
@@ -85,7 +85,7 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
         AllFieldsSearch.and("lastHost", AllFieldsSearch.entity().getLastHostId(), Op.EQ);
         AllFieldsSearch.and("state", AllFieldsSearch.entity().getState(), Op.EQ);
         AllFieldsSearch.and("states", AllFieldsSearch.entity().getState(), Op.IN);
-        SearchBuilder<RouterNetworkVO> joinRouterNetwork = _routerNetworkDao.createSearchBuilder();
+        final SearchBuilder<RouterNetworkVO> joinRouterNetwork = _routerNetworkDao.createSearchBuilder();
         joinRouterNetwork.and("networkId", joinRouterNetwork.entity().getNetworkId(), Op.EQ);
         AllFieldsSearch.join("networkRouter", joinRouterNetwork, joinRouterNetwork.entity().getRouterId(), AllFieldsSearch.entity().getId(), JoinType.INNER);
         AllFieldsSearch.and("podId", AllFieldsSearch.entity().getPodIdToDeployIn(), Op.EQ);
@@ -100,10 +100,10 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
 
         IdNetworkIdStatesSearch = createSearchBuilder();
         IdNetworkIdStatesSearch.and("id", IdNetworkIdStatesSearch.entity().getId(), Op.EQ);
-        SearchBuilder<RouterNetworkVO> joinRouterNetwork1 = _routerNetworkDao.createSearchBuilder();
+        final SearchBuilder<RouterNetworkVO> joinRouterNetwork1 = _routerNetworkDao.createSearchBuilder();
         joinRouterNetwork1.and("networkId", joinRouterNetwork1.entity().getNetworkId(), Op.EQ);
         IdNetworkIdStatesSearch.join("networkRouter", joinRouterNetwork1, joinRouterNetwork1.entity().getRouterId(), IdNetworkIdStatesSearch.entity().getId(),
-            JoinType.INNER);
+                JoinType.INNER);
         IdNetworkIdStatesSearch.and("states", IdNetworkIdStatesSearch.entity().getState(), Op.IN);
         IdNetworkIdStatesSearch.done();
 
@@ -111,7 +111,7 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
         HostUpSearch.select(null, Func.DISTINCT, HostUpSearch.entity().getId());
         HostUpSearch.and("host", HostUpSearch.entity().getHostId(), Op.EQ);
         HostUpSearch.and("states", HostUpSearch.entity().getState(), Op.NIN);
-        SearchBuilder<RouterNetworkVO> joinRouterNetwork3 = _routerNetworkDao.createSearchBuilder();
+        final SearchBuilder<RouterNetworkVO> joinRouterNetwork3 = _routerNetworkDao.createSearchBuilder();
         joinRouterNetwork3.and("networkId", joinRouterNetwork3.entity().getNetworkId(), Op.EQ);
         joinRouterNetwork3.and("type", joinRouterNetwork3.entity().getGuestType(), Op.EQ);
         HostUpSearch.join("networkRouter", joinRouterNetwork3, joinRouterNetwork3.entity().getRouterId(), HostUpSearch.entity().getId(), JoinType.INNER);
@@ -120,13 +120,13 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
         StateNetworkTypeSearch = createSearchBuilder();
         StateNetworkTypeSearch.select(null, Func.DISTINCT, StateNetworkTypeSearch.entity().getId());
         StateNetworkTypeSearch.and("state", StateNetworkTypeSearch.entity().getState(), Op.EQ);
-        SearchBuilder<RouterNetworkVO> joinRouterNetwork4 = _routerNetworkDao.createSearchBuilder();
+        final SearchBuilder<RouterNetworkVO> joinRouterNetwork4 = _routerNetworkDao.createSearchBuilder();
         joinRouterNetwork4.and("networkId", joinRouterNetwork4.entity().getNetworkId(), Op.EQ);
         joinRouterNetwork4.and("type", joinRouterNetwork4.entity().getGuestType(), Op.EQ);
         StateNetworkTypeSearch.join("networkRouter", joinRouterNetwork4, joinRouterNetwork4.entity().getRouterId(), StateNetworkTypeSearch.entity().getId(),
-            JoinType.INNER);
+                JoinType.INNER);
 
-        SearchBuilder<HostVO> joinHost = _hostsDao.createSearchBuilder();
+        final SearchBuilder<HostVO> joinHost = _hostsDao.createSearchBuilder();
         joinHost.and("mgmtServerId", joinHost.entity().getManagementServerId(), Op.EQ);
         StateNetworkTypeSearch.join("host", joinHost, joinHost.entity().getId(), StateNetworkTypeSearch.entity().getHostId(), JoinType.INNER);
         StateNetworkTypeSearch.done();
@@ -134,13 +134,13 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
         SearchByStateAndManagementServerId = createSearchBuilder();
         SearchByStateAndManagementServerId.and("state", SearchByStateAndManagementServerId.entity().getState(), Op.EQ);
 
-        SearchBuilder<HostVO> joinHost2 = _hostsDao.createSearchBuilder();
+        final SearchBuilder<HostVO> joinHost2 = _hostsDao.createSearchBuilder();
         joinHost2.and("mgmtServerId", joinHost2.entity().getManagementServerId(), Op.EQ);
         SearchByStateAndManagementServerId.join("host", joinHost2, joinHost2.entity().getId(), SearchByStateAndManagementServerId.entity().getHostId(), JoinType.INNER);
         SearchByStateAndManagementServerId.done();
 
         OutsidePodSearch = createSearchBuilder();
-        SearchBuilder<RouterNetworkVO> joinRouterNetwork2 = _routerNetworkDao.createSearchBuilder();
+        final SearchBuilder<RouterNetworkVO> joinRouterNetwork2 = _routerNetworkDao.createSearchBuilder();
         joinRouterNetwork2.and("networkId", joinRouterNetwork2.entity().getNetworkId(), Op.EQ);
         OutsidePodSearch.join("networkRouter", joinRouterNetwork2, joinRouterNetwork2.entity().getRouterId(), OutsidePodSearch.entity().getId(), JoinType.INNER);
         OutsidePodSearch.and("podId", OutsidePodSearch.entity().getPodIdToDeployIn(), Op.NEQ);
@@ -150,7 +150,7 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
 
         clusterSearch = createSearchBuilder();
         clusterSearch.and("state", clusterSearch.entity().getState(), Op.EQ);
-        SearchBuilder<HostVO> clusterHost = _hostsDao.createSearchBuilder();
+        final SearchBuilder<HostVO> clusterHost = _hostsDao.createSearchBuilder();
         clusterHost.and("clusterId", clusterHost.entity().getClusterId(), Op.EQ);
         clusterSearch.join("host", clusterHost, clusterSearch.entity().getHostId(), clusterHost.entity().getId(), JoinType.INNER);
         clusterSearch.done();
@@ -165,30 +165,30 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
     }
 
     @Override
-    public boolean remove(Long id) {
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
+    public boolean remove(final Long id) {
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
-        DomainRouterVO router = createForUpdate();
+        final DomainRouterVO router = createForUpdate();
         router.setPublicIpAddress(null);
-        UpdateBuilder ub = getUpdateBuilder(router);
+        final UpdateBuilder ub = getUpdateBuilder(router);
         ub.set(router, "state", State.Destroyed);
         update(id, ub, router);
 
-        boolean result = super.remove(id);
+        final boolean result = super.remove(id);
         txn.commit();
         return result;
     }
 
     @Override
-    public List<DomainRouterVO> listByDataCenter(long dcId) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listByDataCenter(final long dcId) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("dc", dcId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> findBy(long accountId, long dcId) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> findBy(final long accountId, final long dcId) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("account", accountId);
         sc.setParameters("dc", dcId);
         sc.setParameters("role", Role.VIRTUAL_ROUTER);
@@ -196,8 +196,8 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
     }
 
     @Override
-    public List<DomainRouterVO> findBy(long accountId, long dcId, Role role) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> findBy(final long accountId, final long dcId, final Role role) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("account", accountId);
         sc.setParameters("dc", dcId);
         sc.setParameters("role", role);
@@ -205,106 +205,106 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
     }
 
     @Override
-    public List<DomainRouterVO> listBy(long accountId) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listBy(final long accountId) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("account", accountId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listByHostId(Long hostId) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listByHostId(final Long hostId) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("host", hostId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listRunningByPodId(Long podId) {
-        SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
+    public List<DomainRouterVO> listRunningByPodId(final Long podId) {
+        final SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
         sc.setParameters("state", State.Running);
         sc.setParameters("podId", podId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listRunningByClusterId(Long clusterId) {
-        SearchCriteria<DomainRouterVO> sc = clusterSearch.create();
+    public List<DomainRouterVO> listRunningByClusterId(final Long clusterId) {
+        final SearchCriteria<DomainRouterVO> sc = clusterSearch.create();
         sc.setParameters("state", State.Running);
         sc.setJoinParameters("host", "clusterId", clusterId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listByPodIdAndStates(Long podId, State... states) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listByPodIdAndStates(final Long podId, final State... states) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("podId", podId);
         sc.setParameters("states", (Object[])states);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listIsolatedByHostId(Long hostId) {
-        SearchCriteria<DomainRouterVO> sc = HostUpSearch.create();
+    public List<DomainRouterVO> listIsolatedByHostId(final Long hostId) {
+        final SearchCriteria<DomainRouterVO> sc = HostUpSearch.create();
         if (hostId != null) {
             sc.setParameters("host", hostId);
         }
         sc.setJoinParameters("networkRouter", "type", Network.GuestType.Isolated);
-        List<DomainRouterVO> routerIds = listBy(sc);
-        List<DomainRouterVO> routers = new ArrayList<DomainRouterVO>();
-        for (DomainRouterVO router : routerIds) {
+        final List<DomainRouterVO> routerIds = listBy(sc);
+        final List<DomainRouterVO> routers = new ArrayList<DomainRouterVO>();
+        for (final DomainRouterVO router : routerIds) {
             routers.add(findById(router.getId()));
         }
         return routers;
     }
 
     @Override
-    public List<DomainRouterVO> listRunningByDomain(Long domainId) {
-        SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
+    public List<DomainRouterVO> listRunningByDomain(final Long domainId) {
+        final SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
         sc.setParameters("state", State.Running);
         sc.setParameters("domainId", domainId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> findByNetwork(long networkId) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> findByNetwork(final long networkId) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setJoinParameters("networkRouter", "networkId", networkId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listByLastHostId(Long hostId) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listByLastHostId(final Long hostId) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("lastHost", hostId);
         sc.setParameters("state", State.Stopped);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listActive(long networkId) {
-        SearchCriteria<DomainRouterVO> sc = IdNetworkIdStatesSearch.create();
+    public List<DomainRouterVO> listActive(final long networkId) {
+        final SearchCriteria<DomainRouterVO> sc = IdNetworkIdStatesSearch.create();
         sc.setJoinParameters("networkRouter", "networkId", networkId);
         sc.setParameters("states", State.Running, State.Migrating, State.Stopping, State.Starting);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listByStateAndNetworkType(State state, Network.GuestType type, long mgmtSrvrId) {
-        SearchCriteria<DomainRouterVO> sc = StateNetworkTypeSearch.create();
+    public List<DomainRouterVO> listByStateAndNetworkType(final State state, final Network.GuestType type, final long mgmtSrvrId) {
+        final SearchCriteria<DomainRouterVO> sc = StateNetworkTypeSearch.create();
         sc.setParameters("state", state);
         sc.setJoinParameters("networkRouter", "type", type);
         sc.setJoinParameters("host", "mgmtServerId", mgmtSrvrId);
-        List<DomainRouterVO> routerIds = listBy(sc);
-        List<DomainRouterVO> routers = new ArrayList<DomainRouterVO>();
-        for (DomainRouterVO router : routerIds) {
+        final List<DomainRouterVO> routerIds = listBy(sc);
+        final List<DomainRouterVO> routers = new ArrayList<DomainRouterVO>();
+        for (final DomainRouterVO router : routerIds) {
             routers.add(findById(router.getId()));
         }
         return routers;
     }
 
     @Override
-    public List<DomainRouterVO> listByStateAndManagementServer(State state, long mgmtSrvrId) {
-        SearchCriteria<DomainRouterVO> sc = SearchByStateAndManagementServerId.create();
+    public List<DomainRouterVO> listByStateAndManagementServer(final State state, final long mgmtSrvrId) {
+        final SearchCriteria<DomainRouterVO> sc = SearchByStateAndManagementServerId.create();
         sc.setParameters("state", state);
         sc.setJoinParameters("host", "mgmtServerId", mgmtSrvrId);
 
@@ -312,8 +312,8 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
     }
 
     @Override
-    public List<DomainRouterVO> findByNetworkOutsideThePod(long networkId, long podId, State state, Role role) {
-        SearchCriteria<DomainRouterVO> sc = OutsidePodSearch.create();
+    public List<DomainRouterVO> findByNetworkOutsideThePod(final long networkId, final long podId, final State state, final Role role) {
+        final SearchCriteria<DomainRouterVO> sc = OutsidePodSearch.create();
         sc.setJoinParameters("networkRouter", "networkId", networkId);
         sc.setParameters("podId", podId);
         sc.setParameters("state", state);
@@ -322,8 +322,8 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
     }
 
     @Override
-    public List<DomainRouterVO> listByNetworkAndPodAndRole(long networkId, long podId, Role role) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listByNetworkAndPodAndRole(final long networkId, final long podId, final Role role) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setJoinParameters("networkRouter", "networkId", networkId);
         sc.setParameters("podId", podId);
         sc.setParameters("role", role);
@@ -331,32 +331,32 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
     }
 
     @Override
-    public List<DomainRouterVO> listByNetworkAndRole(long networkId, Role role) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listByNetworkAndRole(final long networkId, final Role role) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setJoinParameters("networkRouter", "networkId", networkId);
         sc.setParameters("role", role);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listByElementId(long elementId) {
-        SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
+    public List<DomainRouterVO> listByElementId(final long elementId) {
+        final SearchCriteria<DomainRouterVO> sc = AllFieldsSearch.create();
         sc.setParameters("elementId", elementId);
         return listBy(sc);
     }
 
     @Override
     @DB
-    public DomainRouterVO persist(DomainRouterVO router, List<Network> guestNetworks) {
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
+    public DomainRouterVO persist(final DomainRouterVO router, final List<Network> guestNetworks) {
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
 
         // 1) create network
-        DomainRouterVO newRouter = super.persist(router);
+        final DomainRouterVO newRouter = super.persist(router);
 
         if (guestNetworks != null && !guestNetworks.isEmpty()) {
             // 2) add router to the network
-            for (Network guestNetwork : guestNetworks) {
+            for (final Network guestNetwork : guestNetworks) {
                 addRouterToGuestNetwork(router, guestNetwork);
             }
         }
@@ -367,21 +367,21 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
 
     @Override
     @DB
-    public void addRouterToGuestNetwork(VirtualRouter router, Network guestNetwork) {
+    public void addRouterToGuestNetwork(final VirtualRouter router, final Network guestNetwork) {
         if (_routerNetworkDao.findByRouterAndNetwork(router.getId(), guestNetwork.getId()) == null) {
-            NetworkOffering off = _offDao.findById(guestNetwork.getNetworkOfferingId());
-            if (!(off.getName().equalsIgnoreCase(NetworkOffering.SystemPrivateGatewayNetworkOffering))) {
-                TransactionLegacy txn = TransactionLegacy.currentTxn();
+            final NetworkOffering off = _offDao.findById(guestNetwork.getNetworkOfferingId());
+            if (!off.getName().equalsIgnoreCase(NetworkOffering.SystemPrivateGatewayNetworkOffering)) {
+                final TransactionLegacy txn = TransactionLegacy.currentTxn();
                 txn.start();
                 //1) add router to network
-                RouterNetworkVO routerNtwkMap = new RouterNetworkVO(router.getId(), guestNetwork.getId(), guestNetwork.getGuestType());
+                final RouterNetworkVO routerNtwkMap = new RouterNetworkVO(router.getId(), guestNetwork.getId(), guestNetwork.getGuestType());
                 _routerNetworkDao.persist(routerNtwkMap);
                 //2) create user stats entry for the network
                 UserStatisticsVO stats =
-                    _userStatsDao.findBy(router.getAccountId(), router.getDataCenterId(), guestNetwork.getId(), null, router.getId(), router.getType().toString());
+                        _userStatsDao.findBy(router.getAccountId(), router.getDataCenterId(), guestNetwork.getId(), null, router.getId(), router.getType().toString());
                 if (stats == null) {
                     stats =
-                        new UserStatisticsVO(router.getAccountId(), router.getDataCenterId(), null, router.getId(), router.getType().toString(), guestNetwork.getId());
+                            new UserStatisticsVO(router.getAccountId(), router.getDataCenterId(), null, router.getId(), router.getType().toString(), guestNetwork.getId());
                     _userStatsDao.persist(stats);
                 }
                 txn.commit();
@@ -390,45 +390,45 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
     }
 
     @Override
-    public void removeRouterFromGuestNetwork(long routerId, long guestNetworkId) {
-        RouterNetworkVO routerNtwkMap = _routerNetworkDao.findByRouterAndNetwork(routerId, guestNetworkId);
+    public void removeRouterFromGuestNetwork(final long routerId, final long guestNetworkId) {
+        final RouterNetworkVO routerNtwkMap = _routerNetworkDao.findByRouterAndNetwork(routerId, guestNetworkId);
         if (routerNtwkMap != null) {
             _routerNetworkDao.remove(routerNtwkMap.getId());
         }
     }
 
     @Override
-    public List<Long> getRouterNetworks(long routerId) {
+    public List<Long> getRouterNetworks(final long routerId) {
         return _routerNetworkDao.getRouterNetworks(routerId);
     }
 
     @Override
-    public List<DomainRouterVO> listByVpcId(long vpcId) {
-        SearchCriteria<DomainRouterVO> sc = VpcSearch.create();
+    public List<DomainRouterVO> listByVpcId(final long vpcId) {
+        final SearchCriteria<DomainRouterVO> sc = VpcSearch.create();
         sc.setParameters("vpcId", vpcId);
         sc.setParameters("role", Role.VIRTUAL_ROUTER);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listRunningByAccountId(long accountId) {
-        SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
+    public List<DomainRouterVO> listRunningByAccountId(final long accountId) {
+        final SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
         sc.setParameters("state", State.Running);
         sc.setParameters("account", accountId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listRunningByDataCenter(long dcId) {
-        SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
+    public List<DomainRouterVO> listRunningByDataCenter(final long dcId) {
+        final SearchCriteria<DomainRouterVO> sc = RunningSearch.create();
         sc.setParameters("state", State.Running);
         sc.setParameters("dc", dcId);
         return listBy(sc);
     }
 
     @Override
-    public List<DomainRouterVO> listStopped(long networkId) {
-        SearchCriteria<DomainRouterVO> sc = IdNetworkIdStatesSearch.create();
+    public List<DomainRouterVO> listStopped(final long networkId) {
+        final SearchCriteria<DomainRouterVO> sc = IdNetworkIdStatesSearch.create();
         sc.setJoinParameters("networkRouter", "networkId", networkId);
         sc.setParameters("states", State.Stopped);
         return listBy(sc);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a133c06/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 61fa918..1ad7a9f 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1137,9 +1137,17 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
         protected void runInContext() {
             while (true) {
                 try {
-                    final Long networkId = _vrUpdateQueue.take();
-                    // This is a blocking call so this thread won't run all the time if no work item in queue.
-                    final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(networkId, Role.VIRTUAL_ROUTER);
+                    final Long networkId = _vrUpdateQueue.take(); // This is a blocking call so this thread won't run all the time if no work item in queue.
+
+                    final NetworkVO network = _networkDao.findById(networkId);
+                    final Long vpcId = network.getVpcId();
+
+                    final List<DomainRouterVO> routers;
+                    if (vpcId != null) {
+                        routers = _routerDao.listByVpcId(vpcId);
+                    } else {
+                        routers = _routerDao.listByNetworkAndRole(networkId, Role.VIRTUAL_ROUTER);
+                    }
 
                     if (routers.size() != 2) {
                         continue;
@@ -1189,18 +1197,26 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
 
                 updateSite2SiteVpnConnectionState(routers);
 
-                final List<NetworkVO> networks = _networkDao.listRedundantNetworks();
+                List<NetworkVO> networks = _networkDao.listVpcNetworks();
+                s_logger.debug("Found " + networks.size() + " VPC networks to update Redundant State. ");
+                pushToUpdateQueue(networks);
+
+                networks = _networkDao.listRedundantNetworks();
                 s_logger.debug("Found " + networks.size() + " networks to update RvR status. ");
-                for (final NetworkVO network : networks) {
-                    if (!_vrUpdateQueue.offer(network.getId(), 500, TimeUnit.MILLISECONDS)) {
-                        s_logger.warn("Cannot insert into virtual router update queue! Adjustment of router.check.interval and router.check.poolsize maybe needed.");
-                        break;
-                    }
-                }
+                pushToUpdateQueue(networks);
             } catch (final Exception ex) {
                 s_logger.error("Fail to complete the CheckRouterTask! ", ex);
             }
         }
+
+        protected void pushToUpdateQueue(final List<NetworkVO> networks) throws InterruptedException {
+            for (final NetworkVO network : networks) {
+                if (!_vrUpdateQueue.offer(network.getId(), 500, TimeUnit.MILLISECONDS)) {
+                    s_logger.warn("Cannot insert into virtual router update queue! Adjustment of router.check.interval and router.check.poolsize maybe needed.");
+                    break;
+                }
+            }
+        }
     }
 
     protected class CheckRouterAlertsTask extends ManagedContextRunnable {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a133c06/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java
index 0b22db4..cf4fc35 100644
--- a/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java
+++ b/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java
@@ -40,7 +40,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByOwner(long)
      */
     @Override
-    public List<NetworkVO> listByOwner(long ownerId) {
+    public List<NetworkVO> listByOwner(final long ownerId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -49,7 +49,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listBy(long, long, long)
      */
     @Override
-    public List<NetworkVO> listBy(long accountId, long offeringId, long dataCenterId) {
+    public List<NetworkVO> listBy(final long accountId, final long offeringId, final long dataCenterId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -58,7 +58,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listBy(long, long, java.lang.String, boolean)
      */
     @Override
-    public List<NetworkVO> listBy(long accountId, long dataCenterId, String cidr, boolean skipVpc) {
+    public List<NetworkVO> listBy(final long accountId, final long dataCenterId, final String cidr, final boolean skipVpc) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -67,7 +67,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByZoneAndGuestType(long, long, com.cloud.network.Network.GuestType, java.lang.Boolean)
      */
     @Override
-    public List<NetworkVO> listByZoneAndGuestType(long accountId, long dataCenterId, GuestType type, Boolean isSystem) {
+    public List<NetworkVO> listByZoneAndGuestType(final long accountId, final long dataCenterId, final GuestType type, final Boolean isSystem) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -76,7 +76,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#persist(com.cloud.network.NetworkVO, boolean, java.util.Map)
      */
     @Override
-    public NetworkVO persist(NetworkVO network, boolean gc, Map<String, String> serviceProviderMap) {
+    public NetworkVO persist(final NetworkVO network, final boolean gc, final Map<String, String> serviceProviderMap) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -94,7 +94,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#getNetworksForOffering(long, long, long)
      */
     @Override
-    public List<NetworkVO> getNetworksForOffering(long offeringId, long dataCenterId, long accountId) {
+    public List<NetworkVO> getNetworksForOffering(final long offeringId, final long dataCenterId, final long accountId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -103,7 +103,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#getNextAvailableMacAddress(long)
      */
     @Override
-    public String getNextAvailableMacAddress(long networkConfigId) {
+    public String getNextAvailableMacAddress(final long networkConfigId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -112,7 +112,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listBy(long, long)
      */
     @Override
-    public List<NetworkVO> listBy(long accountId, long networkId) {
+    public List<NetworkVO> listBy(final long accountId, final long networkId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -121,7 +121,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#countByZoneAndUri(long, java.lang.String)
      */
     @Override
-    public long countByZoneAndUri(long zoneId, String broadcastUri) {
+    public long countByZoneAndUri(final long zoneId, final String broadcastUri) {
         // TODO Auto-generated method stub
         return 0;
     }
@@ -130,7 +130,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#countByZoneUriAndGuestType(long, java.lang.String, com.cloud.network.Network.GuestType)
      */
     @Override
-    public long countByZoneUriAndGuestType(long zoneId, String broadcastUri, GuestType guestType) {
+    public long countByZoneUriAndGuestType(final long zoneId, final String broadcastUri, final GuestType guestType) {
         // TODO Auto-generated method stub
         return 0;
     }
@@ -139,7 +139,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByZone(long)
      */
     @Override
-    public List<NetworkVO> listByZone(long zoneId) {
+    public List<NetworkVO> listByZone(final long zoneId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -148,7 +148,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#changeActiveNicsBy(long, int)
      */
     @Override
-    public void changeActiveNicsBy(long networkId, int nicsCount) {
+    public void changeActiveNicsBy(final long networkId, final int nicsCount) {
         // TODO Auto-generated method stub
 
     }
@@ -157,7 +157,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#getActiveNicsIn(long)
      */
     @Override
-    public int getActiveNicsIn(long networkId) {
+    public int getActiveNicsIn(final long networkId) {
         // TODO Auto-generated method stub
         return 0;
     }
@@ -175,7 +175,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#clearCheckForGc(long)
      */
     @Override
-    public void clearCheckForGc(long networkId) {
+    public void clearCheckForGc(final long networkId) {
         // TODO Auto-generated method stub
 
     }
@@ -184,7 +184,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByZoneSecurityGroup(java.lang.Long)
      */
     @Override
-    public List<NetworkVO> listByZoneSecurityGroup(Long zoneId) {
+    public List<NetworkVO> listByZoneSecurityGroup(final Long zoneId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -193,7 +193,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#addDomainToNetwork(long, long, java.lang.Boolean)
      */
     @Override
-    public void addDomainToNetwork(long networkId, long domainId, Boolean subdomainAccess) {
+    public void addDomainToNetwork(final long networkId, final long domainId, final Boolean subdomainAccess) {
         // TODO Auto-generated method stub
 
     }
@@ -202,7 +202,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByPhysicalNetwork(long)
      */
     @Override
-    public List<NetworkVO> listByPhysicalNetwork(long physicalNetworkId) {
+    public List<NetworkVO> listByPhysicalNetwork(final long physicalNetworkId) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -220,7 +220,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByPhysicalNetworkTrafficType(long, com.cloud.network.Networks.TrafficType)
      */
     @Override
-    public List<NetworkVO> listByPhysicalNetworkTrafficType(long physicalNetworkId, TrafficType trafficType) {
+    public List<NetworkVO> listByPhysicalNetworkTrafficType(final long physicalNetworkId, final TrafficType trafficType) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -229,7 +229,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listBy(long, long, com.cloud.network.Network.GuestType, com.cloud.network.Networks.TrafficType)
      */
     @Override
-    public List<NetworkVO> listBy(long accountId, long dataCenterId, GuestType type, TrafficType trafficType) {
+    public List<NetworkVO> listBy(final long accountId, final long dataCenterId, final GuestType type, final TrafficType trafficType) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -238,7 +238,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByPhysicalNetworkAndProvider(long, java.lang.String)
      */
     @Override
-    public List<NetworkVO> listByPhysicalNetworkAndProvider(long physicalNetworkId, String providerName) {
+    public List<NetworkVO> listByPhysicalNetworkAndProvider(final long physicalNetworkId, final String providerName) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -247,7 +247,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#persistNetworkServiceProviders(long, java.util.Map)
      */
     @Override
-    public void persistNetworkServiceProviders(long networkId, Map<String, String> serviceProviderMap) {
+    public void persistNetworkServiceProviders(final long networkId, final Map<String, String> serviceProviderMap) {
         // TODO Auto-generated method stub
 
     }
@@ -256,7 +256,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#update(java.lang.Long, com.cloud.network.NetworkVO, java.util.Map)
      */
     @Override
-    public boolean update(Long networkId, NetworkVO network, Map<String, String> serviceProviderMap) {
+    public boolean update(final Long networkId, final NetworkVO network, final Map<String, String> serviceProviderMap) {
         // TODO Auto-generated method stub
         return false;
     }
@@ -265,7 +265,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByZoneAndTrafficType(long, com.cloud.network.Networks.TrafficType)
      */
     @Override
-    public List<NetworkVO> listByZoneAndTrafficType(long zoneId, TrafficType trafficType) {
+    public List<NetworkVO> listByZoneAndTrafficType(final long zoneId, final TrafficType trafficType) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -274,7 +274,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#setCheckForGc(long)
      */
     @Override
-    public void setCheckForGc(long networkId) {
+    public void setCheckForGc(final long networkId) {
         // TODO Auto-generated method stub
 
     }
@@ -283,7 +283,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#getNetworkCountByNetworkOffId(long)
      */
     @Override
-    public int getNetworkCountByNetworkOffId(long networkOfferingId) {
+    public int getNetworkCountByNetworkOffId(final long networkOfferingId) {
         // TODO Auto-generated method stub
         return 0;
     }
@@ -292,7 +292,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#countNetworksUserCanCreate(long)
      */
     @Override
-    public long countNetworksUserCanCreate(long ownerId) {
+    public long countNetworksUserCanCreate(final long ownerId) {
         // TODO Auto-generated method stub
         return 0;
     }
@@ -301,7 +301,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listSourceNATEnabledNetworks(long, long, com.cloud.network.Network.GuestType)
      */
     @Override
-    public List<NetworkVO> listSourceNATEnabledNetworks(long accountId, long dataCenterId, GuestType type) {
+    public List<NetworkVO> listSourceNATEnabledNetworks(final long accountId, final long dataCenterId, final GuestType type) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -310,7 +310,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#getNetworkCountByVpcId(long)
      */
     @Override
-    public int getNetworkCountByVpcId(long vpcId) {
+    public int getNetworkCountByVpcId(final long vpcId) {
         // TODO Auto-generated method stub
         return 0;
     }
@@ -319,8 +319,8 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listByVpc(long)
      */
     @Override
-    public List<NetworkVO> listByVpc(long vpcId) {
-        List<NetworkVO> networks = new ArrayList<NetworkVO>();
+    public List<NetworkVO> listByVpc(final long vpcId) {
+        final List<NetworkVO> networks = new ArrayList<NetworkVO>();
         networks.add(new NetworkVO());
         return networks;
     }
@@ -329,7 +329,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#getPrivateNetwork(java.lang.String, java.lang.String, long, long)
      */
     @Override
-    public NetworkVO getPrivateNetwork(String broadcastUri, String cidr, long accountId, long zoneId, Long netofferid) {
+    public NetworkVO getPrivateNetwork(final String broadcastUri, final String cidr, final long accountId, final long zoneId, final Long netofferid) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -338,13 +338,13 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#countVpcNetworks(long)
      */
     @Override
-    public long countVpcNetworks(long vpcId) {
+    public long countVpcNetworks(final long vpcId) {
         // TODO Auto-generated method stub
         return 0;
     }
 
     @Override
-    public boolean updateState(Network.State currentState, Network.Event event, Network.State nextState, Network vo, Object data) {
+    public boolean updateState(final Network.State currentState, final Network.Event event, final Network.State nextState, final Network vo, final Object data) {
         return true;
     }
 
@@ -352,7 +352,7 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
      * @see com.cloud.network.dao.NetworkDao#listNetworksByAccount(long, long, com.cloud.network.Network.GuestType, boolean)
      */
     @Override
-    public List<NetworkVO> listNetworksByAccount(long accountId, long zoneId, GuestType type, boolean isSystem) {
+    public List<NetworkVO> listNetworksByAccount(final long accountId, final long zoneId, final GuestType type, final boolean isSystem) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -364,12 +364,18 @@ public class MockNetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implemen
     }
 
     @Override
-    public List<NetworkVO> listByAclId(long aclId) {
+    public List<NetworkVO> listVpcNetworks() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public List<NetworkVO> listByAclId(final long aclId) {
         return null;
     }
 
     @Override
-    public int getNonSystemNetworkCountByVpcId(long vpcId) {
+    public int getNonSystemNetworkCountByVpcId(final long vpcId) {
         return 0;
     }
 }


Mime
View raw message