Package com.cloud.api.response

Examples of com.cloud.api.response.TrafficTypeResponse


    public void execute(){
        List<? extends PhysicalNetworkTrafficType> trafficTypes = _networkService.listTrafficTypes(getPhysicalNetworkId());
        ListResponse<TrafficTypeResponse> response = new ListResponse<TrafficTypeResponse>();
        List<TrafficTypeResponse> trafficTypesResponses = new ArrayList<TrafficTypeResponse>();
        for (PhysicalNetworkTrafficType trafficType : trafficTypes) {
            TrafficTypeResponse trafficTypeResponse = _responseGenerator.createTrafficTypeResponse(trafficType);
            trafficTypesResponses.add(trafficTypeResponse);
        }

        response.setResponses(trafficTypesResponses);
        response.setResponseName(getCommandName());
View Full Code Here


   
    @Override
    public void execute(){
        PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel());
        if (result != null) {
            TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        }else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update traffic type");
        }
    }
View Full Code Here

        return response;
    }

    @Override
    public TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType result) {
        TrafficTypeResponse response = new TrafficTypeResponse();
        response.setId(result.getUuid());
        response.setPhysicalNetworkId(result.getPhysicalNetworkId());
        response.setTrafficType(result.getTrafficType().toString());
        response.setXenLabel(result.getXenNetworkLabel());
        response.setKvmLabel(result.getKvmNetworkLabel());
        response.setVmwareLabel(result.getVmwareNetworkLabel());

        response.setObjectName("traffictype");
        return response;
    }
View Full Code Here

    @Override
    public void execute(){
        UserContext.current().setEventDetails("TrafficType Id: "+getEntityId());
        PhysicalNetworkTrafficType result = _networkService.getPhysicalNetworkTrafficType(getEntityId());
        if (result != null) {
            TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        }else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add traffic type to physical network");
        }
    }
View Full Code Here

TOP

Related Classes of com.cloud.api.response.TrafficTypeResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.