mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ApiDiscovery: Fix response and service impl to make them test-able
This commit is contained in:
parent
45d21c3202
commit
179db40e3a
@ -57,18 +57,34 @@ public class ApiDiscoveryResponse extends BaseResponse {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setSince(String since) {
|
||||
this.since = since;
|
||||
}
|
||||
|
||||
public String getSince() {
|
||||
return since;
|
||||
}
|
||||
|
||||
public void setAsync(Boolean isAsync) {
|
||||
this.isAsync = isAsync;
|
||||
}
|
||||
|
||||
public boolean getAsync() {
|
||||
return isAsync;
|
||||
}
|
||||
|
||||
public String getRelated() {
|
||||
return related;
|
||||
}
|
||||
|
||||
@ -58,18 +58,16 @@ public class ApiDiscoveryServiceImpl implements ApiDiscoveryService {
|
||||
if (s_apiNameDiscoveryResponseMap == null) {
|
||||
long startTime = System.nanoTime();
|
||||
s_apiNameDiscoveryResponseMap = new HashMap<String, ApiDiscoveryResponse>();
|
||||
cacheResponseMap();
|
||||
//TODO: Fix and use PluggableService to get the classes
|
||||
Set<Class<?>> cmdClasses = ReflectUtil.getClassesWithAnnotation(APICommand.class,
|
||||
new String[]{"org.apache.cloudstack.api", "com.cloud.api"});
|
||||
cacheResponseMap(cmdClasses);
|
||||
long endTime = System.nanoTime();
|
||||
s_logger.info("Api Discovery Service: Annotation, docstrings, api relation graph processed in " + (endTime - startTime) / 1000000.0 + " ms");
|
||||
}
|
||||
}
|
||||
|
||||
private void cacheResponseMap() {
|
||||
Set<Class<?>> cmdClasses = ReflectUtil.getClassesWithAnnotation(APICommand.class,
|
||||
new String[]{"org.apache.cloudstack.api", "com.cloud.api"});
|
||||
|
||||
//TODO: Fix and use PluggableService to get the classes
|
||||
|
||||
protected void cacheResponseMap(Set<Class<?>> cmdClasses) {
|
||||
Map<String, List<String>> responseApiNameListMap = new HashMap<String, List<String>>();
|
||||
|
||||
for (Class<?> cmdClass : cmdClasses) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user