Class ApiResponseBuilder.Json

java.lang.Object
org.opencastproject.external.common.ApiResponseBuilder.Json
Enclosing class:
ApiResponseBuilder

public static class ApiResponseBuilder.Json extends Object
Class that handles Json responses for the external API.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javax.ws.rs.core.Response
    conflict(ApiVersion version, com.google.gson.JsonElement json)
    Create a conflict json response for the external api
    static javax.ws.rs.core.Response
    created(String acceptHeader, URI location, com.google.gson.JsonElement json)
    Create a created json response for the external api
    static javax.ws.rs.core.Response
    created(ApiVersion version, URI location, com.google.gson.JsonElement json)
    Create a created json response for the external api
    static javax.ws.rs.core.Response
    ok(String acceptHeader, com.google.gson.JsonElement json)
    Create an ok json response for the external api
    static javax.ws.rs.core.Response
    ok(String acceptHeader, String body)
    Create an ok json response for the external api
    static javax.ws.rs.core.Response
    ok(ApiVersion version, com.google.gson.JsonElement json)
    Create an ok json response for the external api
    static javax.ws.rs.core.Response
    ok(ApiVersion version, String body)
    Create an ok json response for the external api

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Json

      public Json()
  • Method Details

    • ok

      public static javax.ws.rs.core.Response ok(ApiVersion version, String body)
      Create an ok json response for the external api
      Parameters:
      version - The version that was requested for the api
      body - The body of the response.
      Returns:
      The new Response
    • ok

      public static javax.ws.rs.core.Response ok(String acceptHeader, String body)
      Create an ok json response for the external api
      Parameters:
      acceptHeader - The accept header string that was sent by the client.
      body - The body of the response.
      Returns:
      The new Response
    • ok

      public static javax.ws.rs.core.Response ok(ApiVersion version, com.google.gson.JsonElement json)
      Create an ok json response for the external api
      Parameters:
      version - The version that was requested for the api
      json - The json body of the response.
      Returns:
      The new Response
    • ok

      public static javax.ws.rs.core.Response ok(String acceptHeader, com.google.gson.JsonElement json)
      Create an ok json response for the external api
      Parameters:
      acceptHeader - The accept header string that was sent by the client.
      json - The json body of the response.
      Returns:
      The new Response
    • created

      public static javax.ws.rs.core.Response created(String acceptHeader, URI location, com.google.gson.JsonElement json)
      Create a created json response for the external api
      Parameters:
      acceptHeader - The accept header string that was sent by the client.
      location - The location
      json - The json body of the response.
      Returns:
      The new Response
    • created

      public static javax.ws.rs.core.Response created(ApiVersion version, URI location, com.google.gson.JsonElement json)
      Create a created json response for the external api
      Parameters:
      version - The version that was requested for the api
      location - The location
      json - The json body of the response.
      Returns:
      The new Response
    • conflict

      public static javax.ws.rs.core.Response conflict(ApiVersion version, com.google.gson.JsonElement json)
      Create a conflict json response for the external api
      Parameters:
      version - The version that was requested for the api
      json - The json body of the response.
      Returns:
      The new Response