Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E0DFA11A5E for ; Tue, 22 Apr 2014 22:04:14 +0000 (UTC) Received: (qmail 19579 invoked by uid 500); 22 Apr 2014 22:04:14 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 19550 invoked by uid 500); 22 Apr 2014 22:04:14 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 19543 invoked by uid 99); 22 Apr 2014 22:04:14 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2014 22:04:14 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DE1E3944027; Tue, 22 Apr 2014 22:04:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alena1108@apache.org To: commits@cloudstack.apache.org Message-Id: <6ceca48de7c445a09234a1fb5790a142@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 316f23e Date: Tue, 22 Apr 2014 22:04:13 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/master e24bf73a9 -> 316f23ed5 Return isolation methods as a part of listPhysicalNetworks call Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/316f23ed Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/316f23ed Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/316f23ed Branch: refs/heads/master Commit: 316f23ed5fe7ae77e1054add368b2c05dfeef331 Parents: e24bf73 Author: Alena Prokharchyk Authored: Tue Apr 22 14:41:45 2014 -0700 Committer: Alena Prokharchyk Committed: Tue Apr 22 14:57:04 2014 -0700 ---------------------------------------------------------------------- .../dao/PhysicalNetworkIsolationMethodDao.java | 39 ++++++++++++++++++++ .../PhysicalNetworkIsolationMethodDaoImpl.java | 7 ++-- server/src/com/cloud/api/ApiDBUtils.java | 10 +++++ server/src/com/cloud/api/ApiResponseHelper.java | 2 +- 4 files changed, 54 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/316f23ed/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDao.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDao.java b/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDao.java new file mode 100644 index 0000000..a4e1bd5 --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDao.java @@ -0,0 +1,39 @@ +// Copyright 2012 Citrix Systems, Inc. Licensed under the +// Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. Citrix Systems, Inc. +// reserves all rights not expressly granted by 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. +// +// Automatically generated by addcopyright.py at 04/03/2012 +package com.cloud.network.dao; + +import java.util.List; + +import com.cloud.utils.db.GenericDao; + +public interface PhysicalNetworkIsolationMethodDao extends GenericDao{ + + /** + * @param physicalNetworkId + * @return + */ + List getAllIsolationMethod(long physicalNetworkId); + + /** + * @param physicalNetworkId + * @return + */ + String getIsolationMethod(long physicalNetworkId); + + /** + * @param physicalNetworkId + * @return + */ + int clearIsolationMethods(long physicalNetworkId); + +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/316f23ed/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDaoImpl.java b/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDaoImpl.java index 11b4399..a22548a 100644 --- a/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDaoImpl.java +++ b/engine/schema/src/com/cloud/network/dao/PhysicalNetworkIsolationMethodDaoImpl.java @@ -20,7 +20,6 @@ import java.util.List; import org.springframework.stereotype.Component; -import com.cloud.utils.db.GenericDao; import com.cloud.utils.db.GenericDaoBase; import com.cloud.utils.db.GenericSearchBuilder; import com.cloud.utils.db.SearchBuilder; @@ -28,8 +27,7 @@ import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.db.SearchCriteria.Op; @Component -public class PhysicalNetworkIsolationMethodDaoImpl extends GenericDaoBase implements - GenericDao { +public class PhysicalNetworkIsolationMethodDaoImpl extends GenericDaoBase implements PhysicalNetworkIsolationMethodDao { private final GenericSearchBuilder IsolationMethodSearch; private final SearchBuilder AllFieldsSearch; @@ -47,6 +45,7 @@ public class PhysicalNetworkIsolationMethodDaoImpl extends GenericDaoBase getAllIsolationMethod(long physicalNetworkId) { SearchCriteria sc = IsolationMethodSearch.create(); sc.setParameters("physicalNetworkId", physicalNetworkId); @@ -54,6 +53,7 @@ public class PhysicalNetworkIsolationMethodDaoImpl extends GenericDaoBase sc = IsolationMethodSearch.create(); sc.setParameters("physicalNetworkId", physicalNetworkId); @@ -61,6 +61,7 @@ public class PhysicalNetworkIsolationMethodDaoImpl extends GenericDaoBase sc = AllFieldsSearch.create(); sc.setParameters("physicalNetworkId", physicalNetworkId); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/316f23ed/server/src/com/cloud/api/ApiDBUtils.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index 67e47f7..65f41c6 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -181,6 +181,7 @@ import com.cloud.network.dao.NetworkRuleConfigDao; import com.cloud.network.dao.NetworkRuleConfigVO; import com.cloud.network.dao.NetworkVO; import com.cloud.network.dao.PhysicalNetworkDao; +import com.cloud.network.dao.PhysicalNetworkIsolationMethodDao; import com.cloud.network.dao.PhysicalNetworkServiceProviderDao; import com.cloud.network.dao.PhysicalNetworkServiceProviderVO; import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao; @@ -409,6 +410,7 @@ public class ApiDBUtils { static ResourceMetaDataService s_resourceDetailsService; static HostGpuGroupsDao s_hostGpuGroupsDao; static VGPUTypesDao s_vgpuTypesDao; + static PhysicalNetworkIsolationMethodDao s_pNtwkIsolatinoMethodsDao; @Inject private ManagementServer ms; @@ -631,6 +633,8 @@ public class ApiDBUtils { private HostGpuGroupsDao hostGpuGroupsDao; @Inject private VGPUTypesDao vgpuTypesDao; + @Inject + private PhysicalNetworkIsolationMethodDao pNtwkIsolatinoMethodsDao; @PostConstruct void init() { @@ -745,6 +749,7 @@ public class ApiDBUtils { s_resourceDetailsService = resourceDetailsService; s_hostGpuGroupsDao = hostGpuGroupsDao; s_vgpuTypesDao = vgpuTypesDao; + s_pNtwkIsolatinoMethodsDao = pNtwkIsolatinoMethodsDao; } // /////////////////////////////////////////////////////////// @@ -1835,4 +1840,9 @@ public class ApiDBUtils { public static List listResourceTagViewByResourceUUID(String resourceUUID, ResourceObjectType resourceType) { return s_tagJoinDao.listBy(resourceUUID, resourceType); } + + public static List getIsolationMethodsForPhysicalNtwk(long pNtwkId) { + return s_pNtwkIsolatinoMethodsDao.getAllIsolationMethod(pNtwkId); + } + } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/316f23ed/server/src/com/cloud/api/ApiResponseHelper.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index ba1e91f..263110a 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -2197,7 +2197,7 @@ public class ApiResponseHelper implements ResponseGenerator { if (result.getBroadcastDomainRange() != null) { response.setBroadcastDomainRange(result.getBroadcastDomainRange().toString()); } - response.setIsolationMethods(result.getIsolationMethods()); + response.setIsolationMethods(ApiDBUtils.getIsolationMethodsForPhysicalNtwk(result.getId())); response.setTags(result.getTags()); if (result.getState() != null) { response.setState(result.getState().toString());