mirror of https://github.com/apache/cloudstack.git
Removing dead code that had previously been refactored.
This commit is contained in:
parent
3659b7b207
commit
c44d3391bb
|
|
@ -180,16 +180,6 @@ public interface ManagementServer {
|
|||
*/
|
||||
UserAccount getUserAccount(String username, Long domainId);
|
||||
|
||||
/**
|
||||
* Gets a user and account by username, password and domain
|
||||
*
|
||||
* @param username
|
||||
* @param password
|
||||
* @param domainId
|
||||
* @return a user object
|
||||
*/
|
||||
// UserAccount getUserAccount(String username, String password, Long domainId);
|
||||
|
||||
/**
|
||||
* Authenticates a user when s/he logs in.
|
||||
* @param username required username for authentication
|
||||
|
|
@ -279,24 +269,8 @@ public interface ManagementServer {
|
|||
* @throws IllegalArgumentException
|
||||
*/
|
||||
boolean unregisterPreallocatedLun(long id) throws IllegalArgumentException;
|
||||
|
||||
String updateAdminPassword(long userId, String oldPassword, String newPassword);
|
||||
|
||||
/**
|
||||
* Updates a user's information
|
||||
* @param userId
|
||||
* @param username
|
||||
* @param password
|
||||
* @param firstname
|
||||
* @param lastname
|
||||
* @param email
|
||||
* @param timezone
|
||||
* @param apikey
|
||||
* @param secretkey
|
||||
* @return true if update was successful, false otherwise
|
||||
* @throws InvalidParameterValueException
|
||||
*/
|
||||
// boolean updateUser(long userId, String username, String password, String firstname, String lastname, String email, String timezone, String apiKey, String secretKey) throws InvalidParameterValueException;
|
||||
String updateAdminPassword(long userId, String oldPassword, String newPassword);
|
||||
|
||||
/**
|
||||
* Locate a user by their apiKey
|
||||
|
|
@ -312,23 +286,6 @@ public interface ManagementServer {
|
|||
*/
|
||||
Account getAccount(long accountId);
|
||||
|
||||
/**
|
||||
* Create an API key for a user; this key is used as the user's identity when making
|
||||
* calls to the developer API
|
||||
* @param userId
|
||||
* @return the new API key
|
||||
*/
|
||||
// String createApiKey(Long userId);
|
||||
|
||||
/**
|
||||
* Create a secret key for a user, this key is used to sign requests made by the user
|
||||
* to the developer API. When a request is received from a user, the secret key is
|
||||
* retrieved from the database (using the apiKey) and used to verify the request signature.
|
||||
* @param userId
|
||||
* @return the new secret key
|
||||
*/
|
||||
// String createSecretKey(Long userId);
|
||||
|
||||
/**
|
||||
* Gets Storage statistics for a given host
|
||||
*
|
||||
|
|
@ -343,8 +300,7 @@ public interface ManagementServer {
|
|||
* @return guest OS Category
|
||||
*/
|
||||
GuestOSCategoryVO getHostGuestOSCategory(long hostId);
|
||||
|
||||
|
||||
|
||||
/** Get storage statistics (used/available) for a pool
|
||||
* @param id pool id
|
||||
* @return storage statistics
|
||||
|
|
@ -427,13 +383,13 @@ public interface ManagementServer {
|
|||
* @return list of private IP addresses
|
||||
*/
|
||||
List<DataCenterIpAddressVO> listPrivateIpAddressesBy(Long podId, Long zoneId);
|
||||
|
||||
|
||||
/**
|
||||
* Generates a random password that will be used (initially) by newly created and started virtual machines
|
||||
* @return a random password
|
||||
*/
|
||||
String generateRandomPassword();
|
||||
|
||||
|
||||
/**
|
||||
* Attaches an ISO to the virtual CDROM device of the specified VM. Will fail if the VM already has an ISO mounted.
|
||||
* @param vmId
|
||||
|
|
@ -467,7 +423,6 @@ public interface ManagementServer {
|
|||
*/
|
||||
UserVm deployVirtualMachine(long userId, long accountId, long dataCenterId, long serviceOfferingId, long templateId, Long diskOfferingId, String domain, String password, String displayName, String group, String userData, String [] groups, long startEventId, long size) throws ResourceAllocationException, InvalidParameterValueException, InternalErrorException, InsufficientStorageCapacityException, PermissionDeniedException, ExecutionException, StorageUnavailableException, ConcurrentOperationException;
|
||||
long deployVirtualMachineAsync(long userId, long accountId, long dataCenterId, long serviceOfferingId, long templateId, Long diskOfferingId, String domain, String password, String displayName, String group, String userData, String [] groups, long size) throws InvalidParameterValueException, PermissionDeniedException;
|
||||
|
||||
|
||||
/**
|
||||
* Destroys a Virtual Machine
|
||||
|
|
@ -483,7 +438,7 @@ public interface ManagementServer {
|
|||
* @return the async-call job id
|
||||
*/
|
||||
long destroyVirtualMachineAsync(long userId, long vmId);
|
||||
|
||||
|
||||
/**
|
||||
* Starts a Domain Router
|
||||
*
|
||||
|
|
@ -507,7 +462,7 @@ public interface ManagementServer {
|
|||
* @return true if successfully rebooted, false otherwise
|
||||
*/
|
||||
boolean rebootRouter(long routerId, long startEventId) throws InternalErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* Finds a domain router by user and data center
|
||||
* @param userId
|
||||
|
|
@ -522,8 +477,7 @@ public interface ManagementServer {
|
|||
* @return a domainRouter
|
||||
*/
|
||||
DomainRouterVO findDomainRouterById(long domainRouterId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a data center by id
|
||||
*
|
||||
|
|
@ -672,13 +626,6 @@ public interface ManagementServer {
|
|||
*/
|
||||
String changePrivateIPRange(boolean add, Long podId, String startIP, String endIP) throws InvalidParameterValueException;
|
||||
|
||||
/**
|
||||
* Finds users with usernames similar to the parameter
|
||||
* @param username
|
||||
* @return list of Users
|
||||
*/
|
||||
// List<? extends User> findUsersLike(String username);
|
||||
|
||||
/**
|
||||
* Finds a user by their user ID.
|
||||
* @param ownerId
|
||||
|
|
@ -773,7 +720,7 @@ public interface ManagementServer {
|
|||
* @throws InternalErrorException
|
||||
*/
|
||||
boolean copyTemplate(long userId, long templateId, long sourceZoneId, long destZoneId, long startEventId) throws InternalErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* Finds a template by the specified ID.
|
||||
* @param templateId
|
||||
|
|
@ -840,16 +787,6 @@ public interface ManagementServer {
|
|||
*/
|
||||
List<NetworkRuleConfigVO> searchForNetworkRules(ListPortForwardingServiceRulesCmd c) throws InvalidParameterValueException, PermissionDeniedException;
|
||||
|
||||
/**
|
||||
* Saves an event with the specified parameters.
|
||||
* @param userId
|
||||
* @param accountId
|
||||
* @param type
|
||||
* @param description
|
||||
* @return ID of the saved event.
|
||||
*/
|
||||
// Long saveEvent(Long userId, long accountId, String level, String type, String description, String params);
|
||||
|
||||
/**
|
||||
* Obtains a list of events by the specified search criteria.
|
||||
* Can search by: "username", "type", "level", "startDate", "endDate"
|
||||
|
|
@ -986,7 +923,7 @@ public interface ManagementServer {
|
|||
* @return the updated rule if successful, null otherwise
|
||||
*/
|
||||
NetworkRuleConfigVO applyPortForwardingServiceRule(Long ruleId) throws NetworkRuleConflictException;
|
||||
|
||||
|
||||
ConsoleProxyInfo getConsoleProxy(long dataCenterId, long userVmId);
|
||||
ConsoleProxyVO startConsoleProxy(long instanceId, long startEventId) throws InternalErrorException;
|
||||
long startConsoleProxyAsync(long instanceId);
|
||||
|
|
@ -1001,7 +938,6 @@ public interface ManagementServer {
|
|||
VMInstanceVO startSystemVM(StartSystemVMCmd cmd) throws InternalErrorException;
|
||||
boolean rebootSystemVM(RebootSystemVmCmd cmd);
|
||||
|
||||
|
||||
/**
|
||||
* Returns a configuration value with the specified name
|
||||
* @param name
|
||||
|
|
@ -1016,7 +952,6 @@ public interface ManagementServer {
|
|||
* @return the vnc port if found; -1 if unable to find.
|
||||
*/
|
||||
int getVncPort(VirtualMachine vm);
|
||||
|
||||
|
||||
/**
|
||||
* Search for domains owned by the given domainId/domainName (those parameters are wrapped
|
||||
|
|
@ -1066,8 +1001,6 @@ public interface ManagementServer {
|
|||
* @return domainVO the domain with the matching path, or null if no domain with the given path exists
|
||||
*/
|
||||
DomainVO findDomainByPath(String domainPath);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Finds accounts with account identifiers similar to the parameter
|
||||
|
|
@ -1128,7 +1061,7 @@ public interface ManagementServer {
|
|||
* @return owning account if ip address is allocated, null otherwise
|
||||
*/
|
||||
Account findAccountByIpAddress(String ipAddress);
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a Limit
|
||||
* @param limitId - the database ID of the Limit
|
||||
|
|
@ -1487,7 +1420,7 @@ public interface ManagementServer {
|
|||
public String getNetworkGroupsNamesForVm(long vmId);
|
||||
|
||||
boolean checkLocalStorageConfigVal();
|
||||
|
||||
|
||||
boolean validateCustomVolumeSizeRange(long size) throws InvalidParameterValueException;
|
||||
boolean updateUser(UpdateUserCmd cmd) throws InvalidParameterValueException;
|
||||
boolean updateTemplatePermissions(UpdateTemplateOrIsoPermissionsCmd cmd)throws InvalidParameterValueException, PermissionDeniedException,InternalErrorException;
|
||||
|
|
|
|||
|
|
@ -832,7 +832,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean deleteAccount(AccountVO account) {
|
||||
long accountId = account.getId();
|
||||
long userId = 1L; // only admins can delete users, pass in userId 1 XXX: Shouldn't it be userId 2.
|
||||
|
|
@ -1214,10 +1214,8 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
return success;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean updateUser(UpdateUserCmd cmd) throws InvalidParameterValueException
|
||||
{
|
||||
public boolean updateUser(UpdateUserCmd cmd) throws InvalidParameterValueException {
|
||||
Long id = cmd.getId();
|
||||
String apiKey = cmd.getApiKey();
|
||||
String firstName = cmd.getFirstname();
|
||||
|
|
@ -1278,28 +1276,21 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
s_logger.debug("updating user with id: " + id);
|
||||
}
|
||||
UserAccount userAccount = _userAccountDao.findById(id);
|
||||
try
|
||||
{
|
||||
try {
|
||||
//check if the apiKey and secretKey are globally unique
|
||||
if(apiKey != null && secretKey != null)
|
||||
{
|
||||
if (apiKey != null && secretKey != null) {
|
||||
Pair<User, Account> apiKeyOwner = findUserByApiKey(apiKey);
|
||||
|
||||
if(apiKeyOwner != null)
|
||||
{
|
||||
|
||||
if(apiKeyOwner != null) {
|
||||
User usr = apiKeyOwner.first();
|
||||
|
||||
if(usr.getId() != id)
|
||||
if (usr.getId() != id) {
|
||||
throw new InvalidParameterValueException("The api key:"+apiKey+" exists in the system for user id:"+id+" ,please provide a unique key");
|
||||
else
|
||||
{
|
||||
} else {
|
||||
//allow the updation to take place
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
_userDao.update(id, userName, password, firstName, lastName, email, accountId, timeZone, apiKey, secretKey);
|
||||
EventUtils.saveEvent(new Long(1), Long.valueOf(1), EventVO.LEVEL_INFO, EventTypes.EVENT_USER_UPDATE, "User, " + userName + " for accountId = "
|
||||
+ accountId + " domainId = " + userAccount.getDomainId() + " and timezone = "+timeZone + " was updated.");
|
||||
|
|
@ -1509,8 +1500,6 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
return _snapMgr.createVolumeFromSnapshotAsync(userId, accountId, snapshotId, volumeName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public VolumeVO findRootVolume(long vmId) {
|
||||
List<VolumeVO> volumes = _volumeDao.findByInstanceAndType(vmId, VolumeType.ROOT);
|
||||
|
|
@ -2963,7 +2952,6 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
}
|
||||
|
||||
return _dcDao.search(sc, searchFilter);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -4236,7 +4224,6 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public VolumeVO findAnyVolumeById(long volumeId) {
|
||||
return _volumeDao.findById(volumeId);
|
||||
|
|
@ -4487,34 +4474,6 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
return _publicIpAddressDao.search(sc, searchFilter);
|
||||
}
|
||||
|
||||
/*
|
||||
* Left in just in case we have to resurrect this code for demo purposes, but for now
|
||||
*
|
||||
* @Override public List<UsageVO> searchForUsage(Criteria c) { Filter searchFilter = new Filter(UsageVO.class,
|
||||
* c.getOrderBy(), c.getAscending(), c.getOffset(), c.getLimit()); SearchCriteria sc = new
|
||||
* SearchCriteria(UsageVO.class);
|
||||
*
|
||||
* Object[] accountIds = (Object[]) c.getCriteria(Criteria.ACCOUNTID); Object startDate =
|
||||
* c.getCriteria(Criteria.STARTDATE); Object endDate = c.getCriteria(Criteria.ENDDATE); Object domainId =
|
||||
* c.getCriteria(Criteria.DOMAINID);
|
||||
*
|
||||
* if (accountIds.length == 1) { if (accountIds[0] != null) { sc.addAnd("accountId", SearchCriteria.Op.EQ,
|
||||
* accountIds[0]); } } else { sc.addAnd("accountId", SearchCriteria.Op.IN, accountIds); } if (domainId != null) {
|
||||
* sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); } if (startDate != null && endDate != null) {
|
||||
* sc.addAnd("startDate", SearchCriteria.Op.BETWEEN, startDate, endDate); sc.addAnd("startDate",
|
||||
* SearchCriteria.Op.BETWEEN, startDate, endDate); } else if (startDate != null) { sc.addAnd("startDate",
|
||||
* SearchCriteria.Op.LTEQ, startDate); sc.addAnd("endDate", SearchCriteria.Op.GTEQ, startDate); } else if (endDate
|
||||
* != null) { sc.addAnd("startDate", SearchCriteria.Op.LTEQ, endDate); sc.addAnd("endDate", SearchCriteria.Op.GTEQ,
|
||||
* endDate); }
|
||||
*
|
||||
* List<UsageVO> usageRecords = null; Transaction txn = Transaction.currentTxn(Transaction.USAGE_DB); try {
|
||||
* usageRecords = _usageDao.search(sc, searchFilter); } finally { txn.close();
|
||||
*
|
||||
* // switch back to VMOPS_DB txn = Transaction.currentTxn(Transaction.VMOPS_DB); txn.close(); }
|
||||
*
|
||||
* return usageRecords; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public List<DiskTemplateVO> listAllActiveDiskTemplates() {
|
||||
return _diskTemplateDao.listAllActive();
|
||||
|
|
@ -6679,7 +6638,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
return stopSecondaryStorageVm(id, eventId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean rebootSystemVM(RebootSystemVmCmd cmd) {
|
||||
VMInstanceVO systemVm = _vmInstanceDao.findByIdTypes(cmd.getId(), VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.SecondaryStorageVm);
|
||||
|
|
@ -6936,4 +6895,3 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
return accountId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue