use of org.apache.cloudstack.api.response.ResourceIconResponse in project cloudstack by apache.
the class ResourceIconDaoImpl method listResourceIcons.
@Override
public List<ResourceIconResponse> listResourceIcons(List<String> resourceUuids, ResourceTag.ResourceObjectType resourceType) {
SearchCriteria<ResourceIconVO> sc = AllFieldsSearch.create();
sc.setParameters("uuid", resourceUuids.toArray());
sc.setParameters("resourceType", resourceType);
List<ResourceIconVO> resourceIcons = listBy(sc);
List<ResourceIconResponse> iconResponses = new ArrayList<>();
for (ResourceIconVO resourceIcon : resourceIcons) {
ResourceIconResponse response = new ResourceIconResponse();
response.setResourceId(resourceIcon.getResourceUuid());
response.setResourceType(resourceIcon.getResourceType());
response.setImage(resourceIcon.getIcon());
response.setObjectName(ApiConstants.RESOURCE_ICON);
iconResponses.add(response);
}
return iconResponses;
}
use of org.apache.cloudstack.api.response.ResourceIconResponse in project cloudstack by apache.
the class ResourceIconDaoImpl method newResourceIconResponse.
@Override
public ResourceIconResponse newResourceIconResponse(ResourceIcon resourceIcon) {
ResourceIconResponse resourceIconResponse = new ResourceIconResponse();
resourceIconResponse.setResourceId(resourceIcon.getResourceUuid());
resourceIconResponse.setResourceType(resourceIcon.getResourceType());
resourceIconResponse.setImage(resourceIcon.getIcon());
resourceIconResponse.setObjectName(ApiConstants.RESOURCE_ICON);
return resourceIconResponse;
}
use of org.apache.cloudstack.api.response.ResourceIconResponse in project cloudstack by apache.
the class ListDomainChildrenCmd method updateDomainResponse.
private void updateDomainResponse(List<DomainResponse> response) {
for (DomainResponse domainResponse : response) {
ResourceIcon resourceIcon = resourceIconManager.getByResourceTypeAndUuid(ResourceTag.ResourceObjectType.Domain, domainResponse.getId());
if (resourceIcon == null) {
continue;
}
ResourceIconResponse iconResponse = _responseGenerator.createResourceIconResponse(resourceIcon);
domainResponse.setResourceIconResponse(iconResponse);
}
}
use of org.apache.cloudstack.api.response.ResourceIconResponse in project cloudstack by apache.
the class ListDomainsCmd method updateDomainResponse.
private void updateDomainResponse(List<DomainResponse> response) {
for (DomainResponse domainResponse : response) {
ResourceIcon resourceIcon = resourceIconManager.getByResourceTypeAndUuid(ResourceTag.ResourceObjectType.Domain, domainResponse.getId());
if (resourceIcon == null) {
continue;
}
ResourceIconResponse iconResponse = _responseGenerator.createResourceIconResponse(resourceIcon);
domainResponse.setResourceIconResponse(iconResponse);
}
}
use of org.apache.cloudstack.api.response.ResourceIconResponse in project cloudstack by apache.
the class ListNetworksCmd method updateNetworkResponse.
private void updateNetworkResponse(List<NetworkResponse> response) {
for (NetworkResponse networkResponse : response) {
ResourceIcon resourceIcon = resourceIconManager.getByResourceTypeAndUuid(ResourceTag.ResourceObjectType.Network, networkResponse.getId());
if (resourceIcon == null) {
resourceIcon = resourceIconManager.getByResourceTypeAndUuid(ResourceTag.ResourceObjectType.Vpc, networkResponse.getVpcId());
if (resourceIcon == null) {
continue;
}
}
ResourceIconResponse iconResponse = _responseGenerator.createResourceIconResponse(resourceIcon);
networkResponse.setResourceIconResponse(iconResponse);
}
}
Aggregations