Search in sources :

Example 1 with OrderInfo

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

the class ApiMapperUtils method newOrderInfo.

public static OrderInfo newOrderInfo(OrderRestRep order) {
    OrderInfo it = new OrderInfo();
    it.setId(order.getId().toString());
    it.setOrderNumber(order.getOrderNumber());
    it.setLink(Link.newSelfLink(orderUrl(order.getId().toString())));
    it.setInactive(order.getInactive());
    it.setService(newServiceReference(order.getCatalogService().getId().toString()));
    it.setSummary(order.getSummary());
    it.setMessage(order.getMessage());
    it.setCreatedDate(order.getCreationTime().getTime());
    it.setDateCompleted(order.getDateCompleted());
    it.setSubmittedBy(order.getSubmittedBy());
    it.setStatus(order.getOrderStatus());
    it.setExecutionWindow(order.getExecutionWindow() != null && order.getExecutionWindow().getId() != null ? order.getExecutionWindow().getId().toString() : null);
    it.setExecution(newExecutionReference(order.getId().toString()));
    it.setTags(getTags(order));
    if (order.getParameters() != null) {
        it.setParameters(newParameters(order.getParameters()));
    }
    return it;
}
Also used : OrderInfo(com.emc.vipr.model.catalog.OrderInfo)

Example 2 with OrderInfo

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

the class OrdersApi method bulkOrders.

public static void bulkOrders(BulkIdParam param) {
    if (param == null || param.getIds().size() > DEFAULT_MAX_BULK_SIZE) {
        badRequest();
    }
    List<OrderInfo> orders = Lists.newArrayList();
    for (OrderRestRep order : getCatalogClient().orders().getByIds(param.getIds())) {
        // NOSONAR
        // ("Suppressing Sonar violation of Possible null pointer dereference of param. In the previous if condition it is already taken care of the case when param is null hence recheck is not required.")
        checkPermissions(order);
        orders.add(newOrderInfo(order));
    }
    renderApi(orders);
}
Also used : OrderRestRep(com.emc.vipr.model.catalog.OrderRestRep) OrderInfo(com.emc.vipr.model.catalog.OrderInfo) ApiMapperUtils.newOrderInfo(util.api.ApiMapperUtils.newOrderInfo)

Aggregations

OrderInfo (com.emc.vipr.model.catalog.OrderInfo)2 OrderRestRep (com.emc.vipr.model.catalog.OrderRestRep)1 ApiMapperUtils.newOrderInfo (util.api.ApiMapperUtils.newOrderInfo)1