src/com/vehiclerental/presentationLayer/headOffice/StaffHeadOfficeController.java
/**
     * Updates a specific booking status
     *
     * @param request the request parameters
     * @return the result response
     */
Updates a specific booking status
@param request the request parameters
@return the result response
Updates a specific booking status @param request the request parameters @return the result response
public static HeadOfficeResponseMessage HandleChangeBookingStatus(HeadOfficeRequestMessage request) {
        Branch destBranch = getRequestBranch(request);
        if (destBranch == null) {
            return generateError(request.OperationCode, 404, "Branch not found");
        }
        try {
            User user = doAuthentication(request.getAuthEmail(), request.getAuthPassword(), true);
            ClusterCommunicationObject<String> rawMpiResponse = ForwardRequestToBranch(destBranch, request.OperationCode, request.SerializedObject, ChangeBookingStatusContract.class, user);
            Type jsonType = new TypeToken<BranchResponseMessage<BookingContract>>() {}.getType();
            BranchResponseMessage<BookingContract> mpiResponse = SerializationUtils.deserialize(rawMpiResponse.object, jsonType);
            if (mpiResponse.Status != 200) {
                return generateError(request.OperationCode, mpiResponse.Status, mpiResponse.Error);
            }
            return generateSuccessfulResponse(request.OperationCode, mpiResponse.Object);
        } catch (ClusterCommunicatorException e) {
            return generateError(request.OperationCode, 500, "Server error");
        } catch (NotAuthorizedException e) {
            return generateError(request.OperationCode, 401, "Unauthorized");
        }
    }
public static HeadOfficeResponseMessage HandleChangeBookingStatus ( HeadOfficeRequestMessage request ) { Branch destBranch = getRequestBranch ( request ) ; if ( destBranch == null ) { return generateError ( request . OperationCode , 404 , "Branch not found" ) ; } try { User user = doAuthentication ( request . getAuthEmail ( ) , request . getAuthPassword ( ) , true ) ; ClusterCommunicationObject < String > rawMpiResponse = ForwardRequestToBranch ( destBranch , request . OperationCode , request . SerializedObject , ChangeBookingStatusContract . class , user ) ; Type jsonType = new TypeToken < BranchResponseMessage < BookingContract > > ( ) { } . getType ( ) ; BranchResponseMessage < BookingContract > mpiResponse = SerializationUtils . deserialize ( rawMpiResponse . object , jsonType ) ; if ( mpiResponse . Status != 200 ) { return generateError ( request . OperationCode , mpiResponse . Status , mpiResponse . Error ) ; } return generateSuccessfulResponse ( request . OperationCode , mpiResponse . Object ) ; } catch ( ClusterCommunicatorException e ) { return generateError ( request . OperationCode , 500 , "Server error" ) ; } catch ( NotAuthorizedException e ) { return generateError ( request . OperationCode , 401 , "Unauthorized" ) ; } }
Updates a specific booking status
 @param request the request parameters
 @return the result response
Updates a specific booking status @param request the request parameters @return the result response
//Parse MPI response //Form socket response