From 06d3d8db85332e23fc72ac2194a7e17cf00e4064 Mon Sep 17 00:00:00 2001 From: kishan Date: Thu, 6 Oct 2011 00:35:52 +0530 Subject: [PATCH] bug 11561: Added new Dao RandomlyIncreasing, which will increase the Vm Id by 1-10 randomly status 11561: resolved fixed --- .../RandomlyIncreasingVMInstanceDaoImpl.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java diff --git a/server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java b/server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java new file mode 100644 index 00000000000..a7015606b4c --- /dev/null +++ b/server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (C) 2011 Cloud.com, Inc. All rights reserved. + * + * This software is licensed under the GNU General Public License v3 or later. + * + * It is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package com.cloud.vm.dao; + + +import javax.ejb.Local; + +import org.apache.log4j.Logger; + +@Local(value = { UserVmDao.class }) +public class RandomlyIncreasingVMInstanceDaoImpl extends UserVmDaoImpl { + + public static final Logger s_logger = Logger.getLogger(RandomlyIncreasingVMInstanceDaoImpl.class); + + @Override + public K getNextInSequence(final Class clazz, final String name) { + return getRandomlyIncreasingNextInSequence(clazz, name); + } + +}