Search in sources :

Example 1 with ServiceDescriptorList

use of com.emc.vipr.model.catalog.ServiceDescriptorList in project coprhd-controller by CoprHD.

the class ServiceDescriptorService method getServiceDescriptors.

/**
 * List service descriptors
 *
 * @prereq none
 * @brief List service descriptors
 * @return List of service descriptors
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("")
public ServiceDescriptorList getServiceDescriptors() {
    Collection<ServiceDescriptor> descriptors = this.serviceDescriptors.listDescriptors(Locale.getDefault());
    descriptors.addAll(workflowServiceDescriptor.listDescriptors());
    List<ServiceDescriptorRestRep> serviceDescriptors = Lists.newArrayList();
    for (ServiceDescriptor descriptor : descriptors) {
        serviceDescriptors.add(map(descriptor));
    }
    ServiceDescriptorList serviceDescriptorList = new ServiceDescriptorList(serviceDescriptors);
    return serviceDescriptorList;
}
Also used : ServiceDescriptorRestRep(com.emc.vipr.model.catalog.ServiceDescriptorRestRep) WorkflowServiceDescriptor(com.emc.sa.catalog.WorkflowServiceDescriptor) ServiceDescriptor(com.emc.sa.descriptor.ServiceDescriptor) ServiceDescriptorList(com.emc.vipr.model.catalog.ServiceDescriptorList) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

WorkflowServiceDescriptor (com.emc.sa.catalog.WorkflowServiceDescriptor)1 ServiceDescriptor (com.emc.sa.descriptor.ServiceDescriptor)1 ServiceDescriptorList (com.emc.vipr.model.catalog.ServiceDescriptorList)1 ServiceDescriptorRestRep (com.emc.vipr.model.catalog.ServiceDescriptorRestRep)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1