Interface WebServiceProxy


  • public interface WebServiceProxy
    This class lists REST endpoints that are used to access to the server.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  WebServiceProxy.InstanceHolder
      This class creates an instance of Web Proxy Server that creates a JSON object out of the question object and logs HTTP traffic and builds the actual HTTP requests.
    • Method Detail

      • getQuestions

        @GET("questions")
        io.reactivex.Single<List<Question>> getQuestions​(@Header("Authorization")
                                                         String bearerToken)
        This method defines the behavior of a GET request to the URL /interviewprep/questions/. It returns all questions from the server.
        Parameters:
        bearerToken - Token in the form of a bearer token used to authenticate with the server. *
        Returns:
        A List of Questions in the form of a ReactiveX Single.
      • getRandomQuestion

        @GET("questions/random")
        io.reactivex.Single<Question> getRandomQuestion​(@Header("Authorization")
                                                        String bearerToken)
        This method defines the behavior of a GET request to the URL /interviewprep/questions/random. It returns a random question from the server.
        Parameters:
        bearerToken - Token in the form of a bearer token used to authenticate with the server. *
        Returns:
        A random Question in the form of a ReactiveX Single.
      • getQuestion

        @GET("questions/{questionId}")
        io.reactivex.Single<Question> getQuestion​(@Path("questionId")
                                                  UUID questionId,
                                                  @Header("Authorization")
                                                  String bearerToken)
        This method defines the behavior of a GET request to the URL /interviewprep/questions/questionId. It returns a single question from the server.
        Parameters:
        bearerToken - Token in the form of a bearer token used to authenticate with the server.
        questionId - A question id in the form of a universally unique identifier.
        Returns:
        A single Question in the form of a ReactiveX Single.
      • updateQuestion

        @PUT("questions/{questionId}")
        io.reactivex.Single<Question> updateQuestion​(@Path("questionId")
                                                     UUID questionId,
                                                     @Body
                                                     Question question,
                                                     @Header("Authorization")
                                                     String bearerToken)
        This method defines the behavior of a PUT request to the URL /interviewprep/questions/questionId. It sends and returns an updated question from the server.
        Parameters:
        bearerToken - Token in the form of a bearer token used to authenticate with the server.
        questionId - A question id in the form of a universally unique identifier.
        question - The updated Question object.
        Returns:
        An updated Question in the form of a ReactiveX Single.
      • createQuestion

        @POST("questions")
        io.reactivex.Single<Question> createQuestion​(@Body
                                                     Question question,
                                                     @Header("Authorization")
                                                     String bearerToken)
        This method defines the behavior of a POST request to the URL /interviewprep/questions/. It sends a newly created question to the server.
        Parameters:
        bearerToken - Token in the form of a bearer token used to authenticate with the server.
        question - The newly created Question object.
        Returns:
        The newly created Question in the form of a ReactiveX Single.
      • deleteQuestion

        @DELETE("questions/{questionId}")
        io.reactivex.Completable deleteQuestion​(@Path("questionId")
                                                UUID questionId,
                                                @Header("Authorization")
                                                String bearerToken)
        This method defines the behavior of a DELETE request to the URL /interviewprep/questions/questionId. It deletes a specified question from the server.
        Parameters:
        bearerToken - Token in the form of a bearer token used to authenticate with the server.
        questionId - A question id in the form of a universally unique identifier.
        Returns:
        A ReactiveX Completable.
      • getInstance

        static WebServiceProxy getInstance()
        Returns a single instance of the class instance holder.
        Returns:
        A single instance of the class instance holder.