CS-6840: List all objects without require parameter

This commit is contained in:
Sheng Yang 2012-06-28 15:22:32 -07:00
parent 3995dc9cb1
commit d9688f74ba
4 changed files with 9 additions and 3 deletions

View File

@ -37,7 +37,7 @@ public class ListVpnConnectionsCmd extends BaseListProjectAndAccountResourcesCmd
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="s2s_vpn_connection")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the vpn connection")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="id of the vpn connection")
private Long id;
/////////////////////////////////////////////////////

View File

@ -37,7 +37,7 @@ public class ListVpnCustomerGatewaysCmd extends BaseListProjectAndAccountResourc
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="s2s_customer_gateway")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the customer gateway")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="id of the customer gateway")
private Long id;
/////////////////////////////////////////////////////

View File

@ -37,7 +37,7 @@ public class ListVpnGatewaysCmd extends BaseListProjectAndAccountResourcesCmd {
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="s2s_vpn_gateway")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the vpn gateway")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="id of the vpn gateway")
private Long id;
/////////////////////////////////////////////////////

View File

@ -306,6 +306,8 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnService, Manager {
List<Site2SiteCustomerGateway> results = new ArrayList<Site2SiteCustomerGateway>();
if (id != null) {
results.add(_customerGatewayDao.findById(cmd.getId()));
} else {
results.addAll(_customerGatewayDao.listAll());
}
return results;
}
@ -316,6 +318,8 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnService, Manager {
List<Site2SiteVpnGateway> results = new ArrayList<Site2SiteVpnGateway>();
if (id != null) {
results.add(_vpnGatewayDao.findById(cmd.getId()));
} else {
results.addAll(_vpnGatewayDao.listAll());
}
return results;
}
@ -326,6 +330,8 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnService, Manager {
List<Site2SiteVpnConnection> results = new ArrayList<Site2SiteVpnConnection>();
if (id != null) {
results.add(_vpnConnectionDao.findById(cmd.getId()));
} else {
results.addAll(_vpnConnectionDao.listAll());
}
return results;
}