use of org.apache.cloudstack.api.response.ListResponse in project cloudstack by apache.
the class ListConditionsCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
List<? extends Condition> conditions = null;
conditions = _autoScaleService.listConditions(this);
ListResponse<ConditionResponse> response = new ListResponse<ConditionResponse>();
List<ConditionResponse> cndnResponses = new ArrayList<ConditionResponse>();
for (Condition cndn : conditions) {
ConditionResponse cndnResponse = _responseGenerator.createConditionResponse(cndn);
cndnResponses.add(cndnResponse);
}
response.setResponses(cndnResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of org.apache.cloudstack.api.response.ListResponse in project cloudstack by apache.
the class ListVpnGatewaysCmd method execute.
@Override
public void execute() {
Pair<List<? extends Site2SiteVpnGateway>, Integer> gws = _s2sVpnService.searchForVpnGateways(this);
ListResponse<Site2SiteVpnGatewayResponse> response = new ListResponse<Site2SiteVpnGatewayResponse>();
List<Site2SiteVpnGatewayResponse> gwResponses = new ArrayList<Site2SiteVpnGatewayResponse>();
for (Site2SiteVpnGateway gw : gws.first()) {
if (gw == null) {
continue;
}
Site2SiteVpnGatewayResponse site2SiteVpnGatewayRes = _responseGenerator.createSite2SiteVpnGatewayResponse(gw);
site2SiteVpnGatewayRes.setObjectName("vpngateway");
gwResponses.add(site2SiteVpnGatewayRes);
}
response.setResponses(gwResponses, gws.second());
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.ListResponse in project cloudstack by apache.
the class ListRemoteAccessVpnsCmd method execute.
@Override
public void execute() {
Pair<List<? extends RemoteAccessVpn>, Integer> vpns = _ravService.searchForRemoteAccessVpns(this);
ListResponse<RemoteAccessVpnResponse> response = new ListResponse<RemoteAccessVpnResponse>();
List<RemoteAccessVpnResponse> vpnResponses = new ArrayList<RemoteAccessVpnResponse>();
if (vpns.first() != null && !vpns.first().isEmpty()) {
for (RemoteAccessVpn vpn : vpns.first()) {
vpnResponses.add(_responseGenerator.createRemoteAccessVpnResponse(vpn));
}
}
response.setResponses(vpnResponses, vpns.second());
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.ListResponse in project cloudstack by apache.
the class ListStaticRoutesCmd method execute.
@Override
public void execute() {
Pair<List<? extends StaticRoute>, Integer> result = _vpcService.listStaticRoutes(this);
ListResponse<StaticRouteResponse> response = new ListResponse<StaticRouteResponse>();
List<StaticRouteResponse> routeResponses = new ArrayList<StaticRouteResponse>();
for (StaticRoute route : result.first()) {
StaticRouteResponse ruleData = _responseGenerator.createStaticRouteResponse(route);
routeResponses.add(ruleData);
}
response.setResponses(routeResponses, result.second());
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.ListResponse in project cloudstack by apache.
the class ListPrivateGatewaysCmd method execute.
@Override
public void execute() {
Pair<List<PrivateGateway>, Integer> gateways = _vpcService.listPrivateGateway(this);
ListResponse<PrivateGatewayResponse> response = new ListResponse<PrivateGatewayResponse>();
List<PrivateGatewayResponse> projectResponses = new ArrayList<PrivateGatewayResponse>();
for (PrivateGateway gateway : gateways.first()) {
PrivateGatewayResponse gatewayResponse = _responseGenerator.createPrivateGatewayResponse(gateway);
projectResponses.add(gatewayResponse);
}
response.setResponses(projectResponses, gateways.second());
response.setResponseName(getCommandName());
setResponseObject(response);
}
Aggregations