Package github.priyatam.springrest.domain

Examples of github.priyatam.springrest.domain.Vehicle


    @RequestMapping(method = RequestMethod.GET, value = "/vehicle/{vin}")
    @ResponseBody
    public ResponseEntity<Vehicle> getVehicle(@PathVariable String vin) {
        logger.debug(String.format("Retrieving Vehicle %s :", vin));

        Vehicle vehicle = persistenceHelper.loadVehicleByVin(vin);
        if (vehicle == null) {
            logger.warn("No Vehicle found");
            return new ResponseEntity<Vehicle>(null, new HttpHeaders(), HttpStatus.NOT_FOUND);
        }
View Full Code Here


    @RequestMapping(method = RequestMethod.GET, value = "/policy/{policyNum}/vehicle/{vin}")
    @ResponseBody
    public ResponseEntity<Vehicle> getVehicle(@PathVariable String policyNum, @PathVariable String vin) {
        logger.debug(String.format("Retrieving Vehicle %s for Policy %s :", vin, policyNum));

        Vehicle vehicle = persistenceHelper.loadVehicleByVin(vin);
        if (vehicle == null) {
            logger.warn("No Vehicle found");
            return new ResponseEntity<Vehicle>(null, new HttpHeaders(), HttpStatus.NOT_FOUND);
        }
View Full Code Here

    }

    public void toVehicle(Policy policy, String policyNum, List<Vehicle> vehicles) {
        for (Vehicle _v : vehicles) {
            if (_v.getLinks().size() != 2) {
                Vehicle vehicle = new Vehicle.Builder().withVin(_v.getVin()).build();
                vehicle.addLink(LinkBuilder.build(URLS.POLICY.expand(policyNum), "Policy", Link.REL_PARENT));
                vehicle.addLink(LinkBuilder.build(URLS.POLICY_VEHICLE.expand(policyNum, _v.getVin()), _v.toString()));

                if (policy != null) {
                    policy = policy.deepCopyWithVehicles(Lists.newArrayList(vehicle));
                }
            }
View Full Code Here

TOP

Related Classes of github.priyatam.springrest.domain.Vehicle

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.