Store all parameters of url call to BaseCmd.fullUrlParams so there will be no

changes in future API because all parameters can be retrieve from API command itself
This commit is contained in:
Frank 2011-06-08 10:25:15 -07:00
parent 7768ab4176
commit 379cbc1d55
3 changed files with 14 additions and 5 deletions

View File

@ -89,7 +89,8 @@ public abstract class BaseCmd {
private static final DateFormat _outputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
private Object _responseObject = null;
private Map<String, String> fullUrlParams;
@Parameter(name="response", type=CommandType.STRING)
private String responseType;
@ -112,7 +113,7 @@ public abstract class BaseCmd {
public static LoadBalancingRulesService _lbService;
public static RemoteAccessVpnService _ravService;
public static BareMetalVmService _bareMetalVmService;
static void setComponents(ResponseGenerator generator) {
ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
@ -546,5 +547,13 @@ public abstract class BaseCmd {
(accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) ||
(accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) ||
(accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
}
}
public void setFullUrlParams(Map<String, String> map) {
this.fullUrlParams = map;
}
public Map<String, String> getFullUrlParams() {
return this.fullUrlParams;
}
}

View File

@ -815,7 +815,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS
allocationState = Host.HostAllocationState.Enabled.toString();
}
return discoverHostsFull(dcId, podId, clusterId, clusterName, url, username, password, cmd.getHypervisor(), hostTags, bareMetalParams, allocationState);
return discoverHostsFull(dcId, podId, clusterId, clusterName, url, username, password, cmd.getHypervisor(), hostTags, cmd.getFullUrlParams(), allocationState);
}
@Override

View File

@ -342,7 +342,7 @@ public class ApiServer implements HttpRequestHandler {
if (cmdClassName != null) {
Class<?> cmdClass = Class.forName(cmdClassName);
BaseCmd cmdObj = (BaseCmd) cmdClass.newInstance();
cmdObj.setFullUrlParams(paramMap);
cmdObj.setResponseType(responseType);
// This is where the command is either serialized, or directly dispatched
response = queueCommand(cmdObj, paramMap);