use of com.cloud.template.VirtualMachineTemplate.TemplateFilter in project cosmic by MissionCriticalCloud.
the class ListIsosCmd method listInReadyState.
public boolean listInReadyState() {
final Account account = CallContext.current().getCallingAccount();
// It is account specific if account is admin type and domainId and accountName are not null
final boolean isAccountSpecific = (account == null || _accountService.isAdmin(account.getId())) && (getAccountName() != null) && (getDomainId() != null);
// Show only those that are downloaded.
final TemplateFilter templateFilter = TemplateFilter.valueOf(getIsoFilter());
boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable) || (templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);
if (!onlyReady) {
if (isReady() != null && isReady().booleanValue() != onlyReady) {
onlyReady = isReady().booleanValue();
}
}
return onlyReady;
}
use of com.cloud.template.VirtualMachineTemplate.TemplateFilter in project cloudstack by apache.
the class ListTemplatesCmd method listInReadyState.
public boolean listInReadyState() {
Account account = CallContext.current().getCallingAccount();
// It is account specific if account is admin type and domainId and accountName are not null
boolean isAccountSpecific = (account == null || _accountService.isAdmin(account.getId())) && (getAccountName() != null) && (getDomainId() != null);
// Show only those that are downloaded.
TemplateFilter templateFilter = TemplateFilter.valueOf(getTemplateFilter());
boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable) || (templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);
return onlyReady;
}
Aggregations