src/com/vehiclerental/presentationLayer/headOffice/GuestHeadOfficeController.java
/**
     * Search available vehicle in the specified branch with the specified parameters (The search will be extended to all the branches in the system)
     *
     * @param request the request parameters
     * @return the result response
     */
Search available vehicle in the specified branch with the specified parameters (The search will be extended to all the branches in the system)
@param request the request parameters
@return the result response
Search available vehicle in the specified branch with the specified parameters ( The search will be extended to all the branches in the system ) @param request the request parameters @return the result response
public static HeadOfficeResponseMessage HandleSearchAvailableVehicles(HeadOfficeRequestMessage request) throws Exception {
        Branch destBranch = NodeConfiguration.Current.branches.get(request.BranchId);
        if (destBranch == null) {
            return generateError(request.OperationCode, 404, "Branch not found");
        }
        try {
            ClusterCommunicationObject<String> rawClusterResponse = ForwardRequestToBranch(destBranch, request.OperationCode, request.SerializedObject, SearchAvailableVehiclesRequestContract.class, null);
            Type jsonType = new TypeToken<BranchResponseMessage<List<BookingSearchResultContract>>>() {}.getType();
            BranchResponseMessage<List<BookingSearchResultContract>> clusterResponse = SerializationUtils.deserialize(rawClusterResponse.object, jsonType);
            if (clusterResponse.Status != 200) {
                return generateError(request.OperationCode, clusterResponse.Status, clusterResponse.Error);
            }
            return generateSuccessfulResponse(request.OperationCode, clusterResponse.Object);
        } catch (ClusterCommunicatorException e) {
            return generateError(request.OperationCode, 500, "Server error");
        }
    }
public static HeadOfficeResponseMessage HandleSearchAvailableVehicles ( HeadOfficeRequestMessage request ) throws Exception { Branch destBranch = NodeConfiguration . Current . branches . get ( request . BranchId ) ; if ( destBranch == null ) { return generateError ( request . OperationCode , 404 , "Branch not found" ) ; } try { ClusterCommunicationObject < String > rawClusterResponse = ForwardRequestToBranch ( destBranch , request . OperationCode , request . SerializedObject , SearchAvailableVehiclesRequestContract . class , null ) ; Type jsonType = new TypeToken < BranchResponseMessage < List < BookingSearchResultContract > > > ( ) { } . getType ( ) ; BranchResponseMessage < List < BookingSearchResultContract > > clusterResponse = SerializationUtils . deserialize ( rawClusterResponse . object , jsonType ) ; if ( clusterResponse . Status != 200 ) { return generateError ( request . OperationCode , clusterResponse . Status , clusterResponse . Error ) ; } return generateSuccessfulResponse ( request . OperationCode , clusterResponse . Object ) ; } catch ( ClusterCommunicatorException e ) { return generateError ( request . OperationCode , 500 , "Server error" ) ; } }
Search available vehicle in the specified branch with the specified parameters (The search will be extended to all the branches in the system)
 @param request the request parameters
 @return the result response
Search available vehicle in the specified branch with the specified parameters ( The search will be extended to all the branches in the system ) @param request the request parameters @return the result response
//Parse MPI response //Form socket response //e.printStackTrace();