Search in sources :

Example 1 with CatalogServiceAndFields

use of com.emc.storageos.db.client.model.uimodels.CatalogServiceAndFields in project coprhd-controller by CoprHD.

the class CatalogServiceManagerImpl method getCatalogServicesWithFields.

public List<CatalogServiceAndFields> getCatalogServicesWithFields(List<URI> ids) {
    List<CatalogServiceAndFields> catalogServicesWithFields = new ArrayList<CatalogServiceAndFields>();
    if (ids == null) {
        return null;
    }
    for (URI id : ids) {
        CatalogService catalogService = client.catalogServices().findById(id);
        if (catalogService != null) {
            List<CatalogServiceField> fields = getCatalogServiceFields(catalogService.getId());
            SortedIndexUtils.sort(fields);
            CatalogServiceAndFields catalogServiceWithFields = new CatalogServiceAndFields();
            catalogServiceWithFields.setCatalogService(catalogService);
            catalogServiceWithFields.setCatalogServiceFields(fields);
            catalogServicesWithFields.add(catalogServiceWithFields);
        }
    }
    return catalogServicesWithFields;
}
Also used : CatalogServiceField(com.emc.storageos.db.client.model.uimodels.CatalogServiceField) ArrayList(java.util.ArrayList) CatalogService(com.emc.storageos.db.client.model.uimodels.CatalogService) NamedURI(com.emc.storageos.db.client.model.NamedURI) URI(java.net.URI) CatalogServiceAndFields(com.emc.storageos.db.client.model.uimodels.CatalogServiceAndFields)

Example 2 with CatalogServiceAndFields

use of com.emc.storageos.db.client.model.uimodels.CatalogServiceAndFields 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);
}
Also used : CatalogServiceField(com.emc.storageos.db.client.model.uimodels.CatalogServiceField) WorkflowServiceDescriptor(com.emc.sa.catalog.WorkflowServiceDescriptor) ServiceDescriptor(com.emc.sa.descriptor.ServiceDescriptor) CatalogServiceBulkRep(com.emc.vipr.model.catalog.CatalogServiceBulkRep) ArrayList(java.util.ArrayList) CatalogService(com.emc.storageos.db.client.model.uimodels.CatalogService) CatalogServiceRestRep(com.emc.vipr.model.catalog.CatalogServiceRestRep) CatalogServiceAndFields(com.emc.storageos.db.client.model.uimodels.CatalogServiceAndFields)

Aggregations

CatalogService (com.emc.storageos.db.client.model.uimodels.CatalogService)2 CatalogServiceAndFields (com.emc.storageos.db.client.model.uimodels.CatalogServiceAndFields)2 CatalogServiceField (com.emc.storageos.db.client.model.uimodels.CatalogServiceField)2 ArrayList (java.util.ArrayList)2 WorkflowServiceDescriptor (com.emc.sa.catalog.WorkflowServiceDescriptor)1 ServiceDescriptor (com.emc.sa.descriptor.ServiceDescriptor)1 NamedURI (com.emc.storageos.db.client.model.NamedURI)1 CatalogServiceBulkRep (com.emc.vipr.model.catalog.CatalogServiceBulkRep)1 CatalogServiceRestRep (com.emc.vipr.model.catalog.CatalogServiceRestRep)1 URI (java.net.URI)1