cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/4.3 to 888a599
Date Thu, 12 Dec 2013 22:03:47 GMT
Updated Branches:
  refs/heads/4.3 67785c2ad -> 888a599a4


Resource metadata support for customer gateway


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

Branch: refs/heads/4.3
Commit: 888a599a41aa3e510d420280f64b67499c012850
Parents: 67785c2
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Dec 12 09:49:18 2013 -0800
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Dec 12 13:56:38 2013 -0800

----------------------------------------------------------------------
 api/src/com/cloud/server/ResourceTag.java       |   3 +-
 .../spring-engine-schema-core-daos-context.xml  |   2 +-
 .../network/dao/Site2SiteCustomerGatewayVO.java |   1 -
 .../Site2SiteCustomerGatewayDetailVO.java       |  81 ++++++++++++
 .../dao/Site2SiteCustomerGatewayDetailsDao.java |  26 ++++
 .../Site2SiteCustomerGatewayDetailsDaoImpl.java |  33 +++++
 .../metadata/ResourceMetaDataManagerImpl.java   |   4 +
 .../cloud/tags/TaggedResourceManagerImpl.java   | 125 +++++++++----------
 8 files changed, 207 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/api/src/com/cloud/server/ResourceTag.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ResourceTag.java b/api/src/com/cloud/server/ResourceTag.java
index 0d35277..bd20691 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -48,7 +48,8 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
         Storage(false, true),
         PrivateGateway(false, true),
         NetworkACLList(false, true),
-        VpnGateway(false, true);
+        VpnGateway(false, true),
+        CustomerGateway(false, true);
 
         ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport)
{
             this.resourceTagsSupport = resourceTagsSupport;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
----------------------------------------------------------------------
diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
index 4be90de..0447b71 100644
--- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
+++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
@@ -329,7 +329,7 @@
   <bean id="NetworkACLListDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.NetworkACLListDetailsDaoImpl"
/>
   <bean id="NetworkACLItemDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDaoImpl"
/>
   <bean id="Site2SiteVpnGatewayDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDaoImpl"
/>
-
+  <bean id="Site2SiteCustomerGatewayDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.Site2SiteCustomerGatewayDetailsDaoImpl"
/>
   <bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker"
/>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
index fe0a403..c5227e2 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
@@ -29,7 +29,6 @@ import javax.persistence.Table;
 import com.cloud.network.Site2SiteCustomerGateway;
 import com.cloud.utils.db.Encrypt;
 import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
 
 @Entity
 @Table(name=("s2s_customer_gateway"))

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.java
b/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.java
new file mode 100644
index 0000000..1a2743c
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/Site2SiteCustomerGatewayDetailVO.java
@@ -0,0 +1,81 @@
+// 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 org.apache.cloudstack.resourcedetail;
+
+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 org.apache.cloudstack.api.ResourceDetail;
+
+@Entity
+@Table(name = "s2s_customer_gateway_details")
+public class Site2SiteCustomerGatewayDetailVO implements ResourceDetail {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private long id;
+
+    @Column(name = "s2s_customer_gateway_id")
+    private long resourceId;
+
+    @Column(name = "name")
+    private String name;
+
+    @Column(name = "value", length = 1024)
+    private String value;
+
+    @Column(name = "display")
+    private boolean display;
+
+    public Site2SiteCustomerGatewayDetailVO() {
+    }
+
+    public Site2SiteCustomerGatewayDetailVO(long id, String name, String value) {
+        this.resourceId = id;
+        this.name = name;
+        this.value = value;
+    }
+
+    @Override
+    public long getId() {
+        return id;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getValue() {
+        return value;
+    }
+
+    @Override
+    public long getResourceId() {
+        return resourceId;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.java
b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.java
new file mode 100644
index 0000000..0689b1c
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDao.java
@@ -0,0 +1,26 @@
+// 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 org.apache.cloudstack.resourcedetail.dao;
+
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDao;
+import org.apache.cloudstack.resourcedetail.Site2SiteCustomerGatewayDetailVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface Site2SiteCustomerGatewayDetailsDao extends GenericDao<Site2SiteCustomerGatewayDetailVO,
Long>, ResourceDetailsDao<Site2SiteCustomerGatewayDetailVO> {
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.java
b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.java
new file mode 100644
index 0000000..b07adcb
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/Site2SiteCustomerGatewayDetailsDaoImpl.java
@@ -0,0 +1,33 @@
+// 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 org.apache.cloudstack.resourcedetail.dao;
+
+import javax.ejb.Local;
+
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase;
+import org.apache.cloudstack.resourcedetail.Site2SiteCustomerGatewayDetailVO;
+import org.springframework.stereotype.Component;
+
+@Component
+@Local(value = {Site2SiteCustomerGatewayDetailsDao.class})
+public class Site2SiteCustomerGatewayDetailsDaoImpl extends ResourceDetailsDaoBase<Site2SiteCustomerGatewayDetailVO>
implements Site2SiteCustomerGatewayDetailsDao {
+
+    @Override
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new Site2SiteCustomerGatewayDetailVO(resourceId, key, value));
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
index 4ddf364..36da81a 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -30,6 +30,7 @@ import org.apache.cloudstack.resourcedetail.dao.FirewallRuleDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.NetworkACLItemDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.NetworkACLListDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.RemoteAccessVpnDetailsDao;
+import org.apache.cloudstack.resourcedetail.dao.Site2SiteCustomerGatewayDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao;
@@ -96,6 +97,8 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements
Resource
     NetworkACLItemDetailsDao _networkACLDetailsDao;
     @Inject
     Site2SiteVpnGatewayDetailsDao _vpnGatewayDetailsDao;
+    @Inject
+    Site2SiteCustomerGatewayDetailsDao _customerGatewayDetailsDao;
     
 
     private static Map<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>>
_daoMap =
@@ -121,6 +124,7 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements
Resource
         _daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDetailsDao);
         _daoMap.put(ResourceObjectType.NetworkACL, _networkACLDetailsDao);
         _daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDetailsDao);
+        _daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDetailsDao);
 
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/888a599a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
index dd59d35..c811b1d 100644
--- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
+++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
@@ -42,6 +42,7 @@ import com.cloud.network.dao.IPAddressDao;
 import com.cloud.network.dao.LoadBalancerDao;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.RemoteAccessVpnDao;
+import com.cloud.network.dao.Site2SiteCustomerGatewayDao;
 import com.cloud.network.dao.Site2SiteVpnGatewayDao;
 import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.security.dao.SecurityGroupDao;
@@ -78,15 +79,13 @@ import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.snapshot.dao.VMSnapshotDao;
 
-
 @Component
-@Local(value = { TaggedResourceService.class})
+@Local(value = {TaggedResourceService.class})
 public class TaggedResourceManagerImpl extends ManagerBase implements TaggedResourceService
{
     public static final Logger s_logger = Logger.getLogger(TaggedResourceManagerImpl.class);
-    
-    private static Map<ResourceObjectType, GenericDao<?, Long>> _daoMap= 
-            new HashMap<ResourceObjectType, GenericDao<?, Long>>();
-    
+
+    private static Map<ResourceObjectType, GenericDao<?, Long>> _daoMap = new
HashMap<ResourceObjectType, GenericDao<?, Long>>();
+
     @Inject
     AccountManager _accountMgr;
     @Inject
@@ -143,7 +142,8 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     NetworkACLDao _networkACLListDao;
     @Inject
     Site2SiteVpnGatewayDao _vpnGatewayDao;
-
+    @Inject
+    Site2SiteCustomerGatewayDao _customerGatewayDao;
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
@@ -171,6 +171,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
         _daoMap.put(ResourceObjectType.PrivateGateway, _vpcGatewayDao);
         _daoMap.put(ResourceObjectType.NetworkACLList, _networkACLListDao);
         _daoMap.put(ResourceObjectType.VpnGateway, _vpnGatewayDao);
+        _daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDao);
 
         return true;
     }
@@ -192,9 +193,9 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
             throw new CloudRuntimeException("Dao is not loaded for the resource type " +
resourceType);
         }
         Class<?> claz = DbUtil.getEntityBeanType(dao);
-        
+
         Long identityId = null;
-        
+
         while (claz != null && claz != Object.class) {
             try {
                 String tableName = DbUtil.getTableName(claz);
@@ -210,16 +211,15 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
             }
             claz = claz.getSuperclass();
         }
-       
+
         if (identityId == null) {
             throw new InvalidParameterValueException("Unable to find resource by id " + resourceId
+ " and type " + resourceType);
         }
         return identityId;
     }
-    
-    
+
     private Pair<Long, Long> getAccountDomain(long resourceId, ResourceObjectType resourceType)
{
-       
+
         Pair<Long, Long> pair = null;
         GenericDao<?, Long> dao = _daoMap.get(resourceType);
         Class<?> claz = DbUtil.getEntityBeanType(dao);
@@ -241,21 +241,21 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
 
         Long accountId = pair.first();
         Long domainId = pair.second();
-        
+
         if (accountId == null) {
             accountId = Account.ACCOUNT_ID_SYSTEM;
         }
-        
+
         if (domainId == null) {
             domainId = Domain.ROOT_DOMAIN;
         }
-        
+
         return new Pair<Long, Long>(accountId, domainId);
     }
 
     @Override
     public ResourceObjectType getResourceType(String resourceTypeStr) {
-        
+
         for (ResourceObjectType type : ResourceTag.ResourceObjectType.values()) {
             if (type.toString().equalsIgnoreCase(resourceTypeStr)) {
                 return type;
@@ -267,24 +267,23 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     @Override
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_TAGS_CREATE, eventDescription = "creating resource
tags")
-    public List<ResourceTag> createTags(final List<String> resourceIds, final
ResourceObjectType resourceType, 
-            final Map<String, String> tags, final String customer) {
+    public List<ResourceTag> createTags(final List<String> resourceIds, final
ResourceObjectType resourceType, final Map<String, String> tags, final String customer)
{
         final Account caller = CallContext.current().getCallingAccount();
-        
+
         final List<ResourceTag> resourceTags = new ArrayList<ResourceTag>(tags.size());
-        
+
         Transaction.execute(new TransactionCallbackNoReturn() {
             @Override
             public void doInTransactionWithoutResult(TransactionStatus status) {
                 for (String key : tags.keySet()) {
                     for (String resourceId : resourceIds) {
-                        if (!resourceType.resourceTagsSupport())  {
+                        if (!resourceType.resourceTagsSupport()) {
                             throw new InvalidParameterValueException("The resource type "
+ resourceType + " doesn't support resource tags");
                         }
-                        
+
                         long id = getResourceId(resourceId, resourceType);
                         String resourceUuid = getUuid(resourceId, resourceType);
-                        
+
                         Pair<Long, Long> accountDomainPair = getAccountDomain(id, resourceType);
                         Long domainId = accountDomainPair.second();
                         Long accountId = accountDomainPair.first();
@@ -294,19 +293,16 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
                             //check permissions;
                             _accountMgr.checkAccess(caller, _domainMgr.getDomain(domainId));
                         } else {
-                            throw new PermissionDeniedException("Account " + caller + " doesn't
have permissions to create tags" +
-                            		" for resource " + key);
+                            throw new PermissionDeniedException("Account " + caller + " doesn't
have permissions to create tags" + " for resource " + key);
                         }
-                        
+
                         String value = tags.get(key);
-                        
+
                         if (value == null || value.isEmpty()) {
                             throw new InvalidParameterValueException("Value for the key "
+ key + " is either null or empty");
                         }
-                       
-                        ResourceTagVO resourceTag = new ResourceTagVO(key, value, accountDomainPair.first(),
-                                accountDomainPair.second(), 
-                                id, resourceType, customer, resourceUuid);
+
+                        ResourceTagVO resourceTag = new ResourceTagVO(key, value, accountDomainPair.first(),
accountDomainPair.second(), id, resourceType, customer, resourceUuid);
                         resourceTag = _resourceTagDao.persist(resourceTag);
                         resourceTags.add(resourceTag);
                     }
@@ -316,36 +312,35 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
 
         return resourceTags;
     }
-    
 
     @Override
     public String getUuid(String resourceId, ResourceObjectType resourceType) {
         GenericDao<?, Long> dao = _daoMap.get(resourceType);
         Class<?> claz = DbUtil.getEntityBeanType(dao);
 
-       String identiyUUId = null;
-
-       while (claz != null && claz != Object.class) {
-           try {
-               String tableName = DbUtil.getTableName(claz);
-               if (tableName == null) {
-                   throw new InvalidParameterValueException("Unable to find resource of type
" + resourceType + " in the database");
-               }
-
-               claz = claz.getSuperclass();
-               if (claz == Object.class) {
-                   identiyUUId = _identityDao.getIdentityUuid(tableName, resourceId);
-               }
-           } catch (Exception ex) {
-               //do nothing here, it might mean uuid field is missing and we have to search
further
-           }
-       }
-
-       if (identiyUUId == null) {
-           return resourceId;
-       }
-
-       return identiyUUId;
+        String identiyUUId = null;
+
+        while (claz != null && claz != Object.class) {
+            try {
+                String tableName = DbUtil.getTableName(claz);
+                if (tableName == null) {
+                    throw new InvalidParameterValueException("Unable to find resource of
type " + resourceType + " in the database");
+                }
+
+                claz = claz.getSuperclass();
+                if (claz == Object.class) {
+                    identiyUUId = _identityDao.getIdentityUuid(tableName, resourceId);
+                }
+            } catch (Exception ex) {
+                //do nothing here, it might mean uuid field is missing and we have to search
further
+            }
+        }
+
+        if (identiyUUId == null) {
+            return resourceId;
+        }
+
+        return identiyUUId;
     }
 
     @Override
@@ -353,21 +348,22 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     @ActionEvent(eventType = EventTypes.EVENT_TAGS_DELETE, eventDescription = "deleting resource
tags")
     public boolean deleteTags(List<String> resourceIds, ResourceObjectType resourceType,
Map<String, String> tags) {
         Account caller = CallContext.current().getCallingAccount();
-        
+
         SearchBuilder<ResourceTagVO> sb = _resourceTagDao.createSearchBuilder();
         sb.and().op("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.IN);
         sb.or("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.IN);
         sb.cp();
         sb.and("resourceType", sb.entity().getResourceType(), SearchCriteria.Op.EQ);
-        
+
         SearchCriteria<ResourceTagVO> sc = sb.create();
         sc.setParameters("resourceId", resourceIds.toArray());
         sc.setParameters("resourceUuid", resourceIds.toArray());
         sc.setParameters("resourceType", resourceType);
-        
-        List<? extends ResourceTag> resourceTags = _resourceTagDao.search(sc, null);;
+
+        List<? extends ResourceTag> resourceTags = _resourceTagDao.search(sc, null);
+        ;
         final List<ResourceTag> tagsToRemove = new ArrayList<ResourceTag>();
-        
+
         // Finalize which tags should be removed
         for (ResourceTag resourceTag : resourceTags) {
             //1) validate the permissions
@@ -391,16 +387,16 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
                             break;
                         }
                     }
-                } 
+                }
             } else {
                 tagsToRemove.add(resourceTag);
             }
         }
-        
+
         if (tagsToRemove.isEmpty()) {
             throw new InvalidParameterValueException("Unable to find tags by parameters specified");
         }
-        
+
         //Remove the tags
         Transaction.execute(new TransactionCallbackNoReturn() {
             @Override
@@ -415,7 +411,6 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
         return true;
     }
 
-
     @Override
     public List<? extends ResourceTag> listByResourceTypeAndId(ResourceObjectType type,
long resourceId) {
         return _resourceTagDao.listBy(resourceId, type);


Mime
View raw message