src/com/vehiclerental/presentationLayer/branch/StaffBranchController.java
/**
     * Search for vehicles in the given branch according to the given parameters
     *
     * @param request the request parameters
     * @return the result response
     */
Search for vehicles in the given branch according to the given parameters
@param request the request parameters
@return the result response
Search for vehicles in the given branch according to the given parameters @param request the request parameters @return the result response
public static BranchResponseMessage handleSearchVehicles(BranchRequestMessage<SearchVehicleContract> request) {
        try {
            VehicleService vehicleService = ServiceFactory.getVehicleService();
            List<VehicleContract> vehicleContracts = vehicleService.searchVehicles(request.object, NodeConfiguration.Current.nodeBranch);
            return generateSuccessfulResponse(request.operationCode, vehicleContracts);
        } catch (InvalidPropertyException e) {
            return generateError(request.operationCode, 400, e.getMessage());
        } catch (Exception e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
            return generateError(request.operationCode, 500, "Branch error");
        }
    }
public static BranchResponseMessage handleSearchVehicles ( BranchRequestMessage < SearchVehicleContract > request ) { try { VehicleService vehicleService = ServiceFactory . getVehicleService ( ) ; List < VehicleContract > vehicleContracts = vehicleService . searchVehicles ( request . object , NodeConfiguration . Current . nodeBranch ) ; return generateSuccessfulResponse ( request . operationCode , vehicleContracts ) ; } catch ( InvalidPropertyException e ) { return generateError ( request . operationCode , 400 , e . getMessage ( ) ) ; } catch ( Exception e ) { System . out . println ( e . getMessage ( ) ) ; e . printStackTrace ( ) ; return generateError ( request . operationCode , 500 , "Branch error" ) ; } }
Search for vehicles in the given branch according to the given parameters
 @param request the request parameters
 @return the result response
Search for vehicles in the given branch according to the given parameters @param request the request parameters @return the result response