cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [3/5] git commit: updated refs/heads/master to 7cb4b57
Date Tue, 04 Feb 2014 23:52:47 GMT
1) Added External UUID control support for network.
2) Moved UUIDManager interface to cloud-util package


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

Branch: refs/heads/master
Commit: 6af6ce7e9e9f573f2afb89819b4d74944cabf403
Parents: 9290995
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Tue Feb 4 10:53:23 2014 -0800
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Tue Feb 4 15:47:12 2014 -0800

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkService.java   |  2 +-
 .../cloudstack/api/BaseAsyncCustomIdCmd.java    |  4 +++
 api/src/org/apache/cloudstack/api/BaseCmd.java  |  6 ++--
 .../apache/cloudstack/api/BaseCustomIdCmd.java  |  3 ++
 .../command/user/network/UpdateNetworkCmd.java  | 15 +++++---
 .../api/command/user/vm/UpdateVMCmd.java        | 11 ++++--
 .../command/user/volume/UpdateVolumeCmd.java    | 11 ++++--
 .../com/cloud/network/NetworkServiceImpl.java   |  6 +++-
 .../com/cloud/storage/VolumeApiServiceImpl.java |  6 ++--
 .../src/com/cloud/uuididentity/UUIDManager.java | 37 --------------------
 .../com/cloud/uuididentity/UUIDManagerImpl.java |  1 +
 server/src/com/cloud/vm/UserVmManagerImpl.java  |  9 ++---
 .../com/cloud/vpc/MockNetworkManagerImpl.java   |  3 +-
 utils/src/com/cloud/utils/db/UUIDManager.java   | 37 ++++++++++++++++++++
 14 files changed, 90 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/api/src/com/cloud/network/NetworkService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java
index 1731b11..d7d8546 100755
--- a/api/src/com/cloud/network/NetworkService.java
+++ b/api/src/com/cloud/network/NetworkService.java
@@ -77,7 +77,7 @@ public interface NetworkService {
     IpAddress getIp(long id);
 
     Network updateGuestNetwork(long networkId, String name, String displayText, Account callerAccount,
User callerUser, String domainSuffix, Long networkOfferingId,
-        Boolean changeCidr, String guestVmCidr, Boolean displayNetwork);
+        Boolean changeCidr, String guestVmCidr, Boolean displayNetwork, String newUUID);
 
     PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed,
List<String> isolationMethods, String broadcastDomainRange, Long domainId,
         List<String> tags, String name);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
index 18264da..3e14f80 100644
--- a/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api;
 
+
 public abstract class BaseAsyncCustomIdCmd extends BaseAsyncCmd {
     @Parameter(name = ApiConstants.CUSTOM_ID,
                type = CommandType.STRING,
@@ -25,4 +26,7 @@ public abstract class BaseAsyncCustomIdCmd extends BaseAsyncCmd {
     public String getCustomId() {
         return customId;
     }
+
+    public abstract void checkUuid(String id, Class<?> cls);
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/api/src/org/apache/cloudstack/api/BaseCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
index aa0549a..5b50153 100644
--- a/api/src/org/apache/cloudstack/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -29,8 +29,6 @@ import java.util.regex.Pattern;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.affinity.AffinityGroupService;
 import org.apache.cloudstack.alert.AlertService;
@@ -40,6 +38,7 @@ import org.apache.cloudstack.network.lb.ApplicationLoadBalancerService;
 import org.apache.cloudstack.network.lb.InternalLoadBalancerVMService;
 import org.apache.cloudstack.query.QueryService;
 import org.apache.cloudstack.usage.UsageService;
+import org.apache.log4j.Logger;
 
 import com.cloud.configuration.ConfigurationService;
 import com.cloud.domain.Domain;
@@ -82,6 +81,7 @@ import com.cloud.user.DomainService;
 import com.cloud.user.ResourceLimitService;
 import com.cloud.utils.ReflectUtil;
 import com.cloud.utils.db.EntityManager;
+import com.cloud.utils.db.UUIDManager;
 import com.cloud.vm.UserVmService;
 import com.cloud.vm.snapshot.VMSnapshotService;
 
@@ -200,6 +200,8 @@ public abstract class BaseCmd {
     public NetworkModel _ntwkModel;
     @Inject
     public AlertService _alertSvc;
+    @Inject
+    public UUIDManager _uuidMgr;
 
     public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException,
ServerApiException, ConcurrentOperationException,
         ResourceAllocationException, NetworkRuleConflictException;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java b/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
index 8ae746f..c930db0 100644
--- a/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
@@ -26,4 +26,7 @@ public abstract class BaseCustomIdCmd extends BaseCmd {
     public String getCustomId() {
         return customId;
     }
+
+    public abstract void checkUuid(String id, Class<?> cls);
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
index 2091102..65da3c3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
@@ -16,17 +16,17 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.network;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.NetworkOfferingResponse;
 import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ConcurrentOperationException;
@@ -38,7 +38,7 @@ import com.cloud.user.Account;
 import com.cloud.user.User;
 
 @APICommand(name = "updateNetwork", description = "Updates a network", responseObject = NetworkResponse.class)
-public class UpdateNetworkCmd extends BaseAsyncCmd {
+public class UpdateNetworkCmd extends BaseAsyncCustomIdCmd {
     public static final Logger s_logger = Logger.getLogger(UpdateNetworkCmd.class.getName());
 
     private static final String s_name = "updatenetworkresponse";
@@ -141,7 +141,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
 
         Network result =
             _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(),
callerAccount, callerUser, getNetworkDomain(), getNetworkOfferingId(),
-                getChangeCidr(), getGuestVmCidr(), getDisplayNetwork());
+                getChangeCidr(), getGuestVmCidr(), getDisplayNetwork(), this.getCustomId());
 
         if (result != null) {
             NetworkResponse response = _responseGenerator.createNetworkResponse(result);
@@ -188,4 +188,11 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
     public Long getSyncObjId() {
         return id;
     }
+
+    @Override
+    public void checkUuid(String id, Class<?> cls) {
+        if (this.getCustomId() != null) {
+            _uuidMgr.checkUuid(this.getCustomId(), Network.class);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
index e0ca787..630d4fc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
@@ -16,8 +16,6 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vm;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,6 +25,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.GuestOSResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
 
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.ResourceUnavailableException;
@@ -147,4 +146,12 @@ public class UpdateVMCmd extends BaseCustomIdCmd {
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update vm");
         }
     }
+
+    @Override
+    public void checkUuid(String id, Class<?> cls) {
+        if (this.getCustomId() != null) {
+            _uuidMgr.checkUuid(this.getCustomId(), UserVm.class);
+
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
index b57f2b4..310acde 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
@@ -16,8 +16,6 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.volume;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
@@ -28,6 +26,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.StoragePoolResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -149,4 +148,12 @@ public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd {
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update volume");
         }
     }
+
+    @Override
+    public void checkUuid(String id, Class<?> cls) {
+        if (this.getCustomId() != null) {
+            _uuidMgr.checkUuid(this.getCustomId(), Volume.class);
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index 40c5b64..c786426 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1939,7 +1939,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService
{
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_NETWORK_UPDATE, eventDescription = "updating
network", async = true)
     public Network updateGuestNetwork(final long networkId, String name, String displayText,
Account callerAccount, User callerUser, String domainSuffix,
-            final Long networkOfferingId, Boolean changeCidr, String guestVmCidr, Boolean
displayNetwork) {
+            final Long networkOfferingId, Boolean changeCidr, String guestVmCidr, Boolean
displayNetwork, String customId) {
 
         boolean restartNetwork = false;
 
@@ -1984,6 +1984,10 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService
{
             network.setDisplayText(displayText);
         }
 
+        if (customId != null) {
+            network.setUuid(customId);
+        }
+
         // display flag is not null and has changed
         if (displayNetwork != null && displayNetwork != network.getDisplayNetwork())
{
             if (!_accountMgr.isRootAdmin(callerAccount.getType())) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 6955825..d4fa8c1 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -26,8 +26,6 @@ import java.util.concurrent.ExecutionException;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
 import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;
 import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;
@@ -75,6 +73,7 @@ import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO;
 import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -152,10 +151,10 @@ import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.db.TransactionCallback;
 import com.cloud.utils.db.TransactionStatus;
+import com.cloud.utils.db.UUIDManager;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.utils.fsm.StateMachine2;
-import com.cloud.uuididentity.UUIDManager;
 import com.cloud.vm.UserVmManager;
 import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VMInstanceVO;
@@ -1348,7 +1347,6 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
         }
 
         if (customId != null) {
-            _uuidMgr.checkUuid(customId, Volume.class);
             volume.setUuid(customId);
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/server/src/com/cloud/uuididentity/UUIDManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/uuididentity/UUIDManager.java b/server/src/com/cloud/uuididentity/UUIDManager.java
deleted file mode 100644
index ecf238c..0000000
--- a/server/src/com/cloud/uuididentity/UUIDManager.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.uuididentity;
-
-
-public interface UUIDManager {
-
-    /**
-     * Generates a new uuid or uses the customId
-     * @param entityType the type of entity
-     * @param customId optional custom uuid of the object.
-     * @return newly created uuid.
-     */
-    public <T> String generateUuid(Class<T> entityType, String customId);
-
-    /**
-     * Checks the uuid for correct format, uniqueness and permissions.
-     * @param uuid uuid to check
-     * @param entityType the type of entity
-     * .
-     */
-    <T> void checkUuid(String uuid, Class<T> entityType);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/server/src/com/cloud/uuididentity/UUIDManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/uuididentity/UUIDManagerImpl.java b/server/src/com/cloud/uuididentity/UUIDManagerImpl.java
index 09ba3d1..c514746 100644
--- a/server/src/com/cloud/uuididentity/UUIDManagerImpl.java
+++ b/server/src/com/cloud/uuididentity/UUIDManagerImpl.java
@@ -28,6 +28,7 @@ import com.cloud.exception.PermissionDeniedException;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.utils.db.EntityManager;
+import com.cloud.utils.db.UUIDManager;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 @Local(value = {UUIDManager.class})

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 82b9bfb..f6f20cc 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -34,9 +34,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.affinity.AffinityGroupService;
@@ -83,6 +80,8 @@ import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -254,11 +253,11 @@ import com.cloud.utils.db.TransactionCallbackNoReturn;
 import com.cloud.utils.db.TransactionCallbackWithException;
 import com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn;
 import com.cloud.utils.db.TransactionStatus;
+import com.cloud.utils.db.UUIDManager;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.exception.ExecutionException;
 import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.utils.net.NetUtils;
-import com.cloud.uuididentity.UUIDManager;
 import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.dao.InstanceGroupDao;
 import com.cloud.vm.dao.InstanceGroupVMMapDao;
@@ -1917,8 +1916,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
             isDynamicallyScalable = vm.isDynamicallyScalable();
         }
 
-        _uuidMgr.checkUuid(customId, UserVm.class);
-
         _vmDao.updateVM(id, displayName, ha, osTypeId, userData, isDisplayVmEnabled, isDynamicallyScalable,
customId);
 
         if (updateUserdata) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index 2267883..32beb0b 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -27,7 +27,6 @@ import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
 import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd;
@@ -250,7 +249,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkOrches
      */
     @Override
     public Network updateGuestNetwork(long networkId, String name, String displayText, Account
callerAccount, User callerUser, String domainSuffix,
-        Long networkOfferingId, Boolean changeCidr, String guestVmCidr, Boolean displayNetwork)
{
+        Long networkOfferingId, Boolean changeCidr, String guestVmCidr, Boolean displayNetwork,
String newUUID) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6af6ce7e/utils/src/com/cloud/utils/db/UUIDManager.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/db/UUIDManager.java b/utils/src/com/cloud/utils/db/UUIDManager.java
new file mode 100644
index 0000000..6bc3f5d
--- /dev/null
+++ b/utils/src/com/cloud/utils/db/UUIDManager.java
@@ -0,0 +1,37 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.utils.db;
+
+
+public interface UUIDManager {
+
+    /**
+     * Generates a new uuid or uses the customId
+     * @param entityType the type of entity
+     * @param customId optional custom uuid of the object.
+     * @return newly created uuid.
+     */
+    public <T> String generateUuid(Class<T> entityType, String customId);
+
+    /**
+     * Checks the uuid for correct format, uniqueness and permissions.
+     * @param uuid uuid to check
+     * @param entityType the type of entity
+     * .
+     */
+    <T> void checkUuid(String uuid, Class<T> entityType);
+}


Mime
View raw message