use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceService method getCatalogServiceById.
private CatalogService getCatalogServiceById(URI id, boolean checkInactive) {
CatalogService catalogService = catalogServiceManager.getCatalogServiceById(id);
ArgValidator.checkEntity(catalogService, id, isIdEmbeddedInURL(id), checkInactive);
return catalogService;
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceService method queryBulkResourceReps.
private CatalogServiceBulkRep queryBulkResourceReps(List<URI> ids, CatalogServiceFilter filter) {
List<CatalogServiceRestRep> catalogServiceRestReps = new ArrayList<CatalogServiceRestRep>();
List<CatalogServiceAndFields> catalogServicesWithFields = catalogServiceManager.getCatalogServicesWithFields(ids);
Map<String, ServiceDescriptor> descriptors = getServiceDescriptors();
for (CatalogServiceAndFields catalogServiceAndField : catalogServicesWithFields) {
if ((filter == null) || filter.isAccessible(catalogServiceAndField.getCatalogService())) {
CatalogService service = catalogServiceAndField.getCatalogService();
ServiceDescriptor descriptor = descriptors.get(service.getBaseService());
List<CatalogServiceField> serviceFields = catalogServiceAndField.getCatalogServiceFields();
catalogServiceRestReps.add(map(service, descriptor, serviceFields));
}
}
catalogServiceRestReps = SortedIndexUtils.createSortedList(catalogServiceRestReps.iterator());
return new CatalogServiceBulkRep(catalogServiceRestReps);
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceService method getRecentCatalogServices.
/**
* Gets the list a user's recent services
*
* @brief List user's recent catalog services
* @return a list of user's recent services
* @throws DatabaseException when a DB error occurs
*/
@GET
@Path("/recent")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public CatalogServiceList getRecentCatalogServices() throws DatabaseException {
StorageOSUser user = getUserFromContext();
List<CatalogService> catalogServices = catalogServiceManager.getRecentCatalogServices(user);
return toCatalogServiceList(catalogServices);
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class OrderService method createNewOrder.
public Order createNewOrder(StorageOSUser user, URI tenantId, OrderCreateParam createParam) {
ArgValidator.checkFieldNotNull(createParam.getCatalogService(), "catalogService");
CatalogService service = catalogServiceManager.getCatalogServiceById(createParam.getCatalogService());
if (service == null) {
throw APIException.badRequests.orderServiceNotFound(asString(createParam.getCatalogService()));
}
final ServiceDescriptor descriptor = ServiceDescriptorUtil.getServiceDescriptorByName(serviceDescriptors, workflowServiceDescriptor, service.getBaseService());
if (descriptor == null) {
throw APIException.badRequests.orderServiceDescriptorNotFound(service.getBaseService());
}
// Getting and setting workflow document (if its workflow service)
if (null != descriptor.getWorkflowId()) {
final String workflowDocument = catalogServiceManager.getWorkflowDocument(service.getBaseService());
if (null == workflowDocument) {
throw APIException.badRequests.workflowNotFound(service.getBaseService());
}
createParam.setWorkflowDocument(workflowDocument);
}
Order order = createNewObject(tenantId, createParam);
addLockedFields(service.getId(), descriptor, createParam);
validateParameters(descriptor, createParam.getParameters(), service.getMaxSize());
List<OrderParameter> orderParams = createOrderParameters(order, createParam, encryptionProvider);
orderManager.createOrder(order, orderParams, user);
return order;
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceMapper method toCatalogServiceList.
public static CatalogServiceList toCatalogServiceList(List<CatalogService> catalogServices) {
CatalogServiceList list = new CatalogServiceList();
for (CatalogService catalogService : catalogServices) {
NamedRelatedResourceRep resourceRep = toNamedRelatedResource(ResourceTypeEnum.CATALOG_SERVICE, catalogService.getId(), catalogService.getLabel());
list.getCatalogServices().add(resourceRep);
}
return list;
}
Aggregations