bug 11561: Added new Dao RandomlyIncreasing, which will increase the Vm Id by 1-10 randomly

status 11561: resolved fixed
This commit is contained in:
kishan 2011-10-06 00:35:52 +05:30
parent 86ea3a1c12
commit 06d3d8db85
1 changed files with 36 additions and 0 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
*
*/
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> K getNextInSequence(final Class<K> clazz, final String name) {
return getRandomlyIncreasingNextInSequence(clazz, name);
}
}