Class JsonApiResource

java.lang.Object
io.xlate.jsonapi.rvp.JsonApiResource

@Consumes("application/vnd.api+json")
@Produces("application/vnd.api+json")
public abstract class JsonApiResource
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected javax.ws.rs.core.Configuration config  
    protected javax.persistence.EntityManager persistenceContext  
    protected javax.ws.rs.core.Request request  
    protected javax.ws.rs.core.SecurityContext security  
    protected javax.ws.rs.core.UriInfo uriInfo  
    protected javax.validation.Validator validator  
  • Constructor Summary

    Constructors 
    Constructor Description
    JsonApiResource()  
  • Method Summary

    Modifier and Type Method Description
    javax.ws.rs.core.Response addRelationship​(java.lang.String resourceType, java.lang.String id, java.lang.String relationshipName, javax.json.JsonObject input)  
    javax.ws.rs.core.Response create​(java.lang.String resourceType, javax.json.JsonObject input)  
    javax.ws.rs.core.Response delete​(java.lang.String resourceType, java.lang.String id)  
    javax.ws.rs.core.Response deleteRelationship​(java.lang.String resourceType, java.lang.String id, java.lang.String relationshipName, javax.json.JsonObject input)  
    javax.ws.rs.core.Response index​(java.lang.String resourceType)  
    protected void initialize​(java.util.Set<JsonApiResourceType<?>> resourceTypes)  
    javax.ws.rs.core.Response patchUpdate​(java.lang.String resourceType, java.lang.String id, javax.json.JsonObject input)  
    javax.ws.rs.core.Response read​(java.lang.String resourceType, java.lang.String id)  
    javax.ws.rs.core.Response readRelated​(java.lang.String resourceType, java.lang.String id, java.lang.String relationshipName)  
    javax.ws.rs.core.Response readRelationship​(java.lang.String resourceType, java.lang.String id, java.lang.String relationshipName)  
    javax.ws.rs.core.Response replaceRelationship​(java.lang.String resourceType, java.lang.String id, java.lang.String relationshipName, javax.json.JsonObject input)  
    javax.ws.rs.core.Response update​(java.lang.String resourceType, java.lang.String id, javax.json.JsonObject input)  
    protected java.util.Set<javax.validation.ConstraintViolation<?>> validateEntity​(java.lang.String resourceType, java.lang.String id, javax.json.JsonObject input)  
    protected java.util.Set<javax.validation.ConstraintViolation<?>> validateParameters​(JsonApiQuery params)  

    Methods inherited from class java.lang.Object

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

    • request

      @Context protected javax.ws.rs.core.Request request
    • uriInfo

      @Context protected javax.ws.rs.core.UriInfo uriInfo
    • security

      @Context protected javax.ws.rs.core.SecurityContext security
    • config

      @Context protected javax.ws.rs.core.Configuration config
    • persistenceContext

      protected javax.persistence.EntityManager persistenceContext
    • validator

      @Inject protected javax.validation.Validator validator
  • Constructor Details

  • Method Details

    • initialize

      protected void initialize​(java.util.Set<JsonApiResourceType<?>> resourceTypes)
    • validateParameters

      protected java.util.Set<javax.validation.ConstraintViolation<?>> validateParameters​(JsonApiQuery params)
    • validateEntity

      protected java.util.Set<javax.validation.ConstraintViolation<?>> validateEntity​(java.lang.String resourceType, java.lang.String id, javax.json.JsonObject input)
    • create

      @POST @Path("{resource-type}") public javax.ws.rs.core.Response create​(@PathParam("resource-type") java.lang.String resourceType, javax.json.JsonObject input)
    • index

      @GET @Path("{resource-type}") public javax.ws.rs.core.Response index​(@PathParam("resource-type") java.lang.String resourceType)
    • read

      @GET @Path("{resource-type}/{id}") public javax.ws.rs.core.Response read​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id)
    • readRelated

      @GET @Path("{resource-type}/{id}/{relationship-name}") public javax.ws.rs.core.Response readRelated​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id, @PathParam("relationship-name") java.lang.String relationshipName)
    • readRelationship

      @GET @Path("{resource-type}/{id}/relationships/{relationship-name}") public javax.ws.rs.core.Response readRelationship​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id, @PathParam("relationship-name") java.lang.String relationshipName)
    • replaceRelationship

      @PATCH @Path("{resource-type}/{id}/relationships/{relationship-name}") public javax.ws.rs.core.Response replaceRelationship​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id, @PathParam("relationship-name") java.lang.String relationshipName, javax.json.JsonObject input)
    • addRelationship

      @POST @Path("{resource-type}/{id}/relationships/{relationship-name}") public javax.ws.rs.core.Response addRelationship​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id, @PathParam("relationship-name") java.lang.String relationshipName, javax.json.JsonObject input)
    • deleteRelationship

      @DELETE @Path("{resource-type}/{id}/relationships/{relationship-name}") public javax.ws.rs.core.Response deleteRelationship​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id, @PathParam("relationship-name") java.lang.String relationshipName, javax.json.JsonObject input)
    • patchUpdate

      @PATCH @Path("{resource-type}/{id}") public javax.ws.rs.core.Response patchUpdate​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id, javax.json.JsonObject input)
    • update

      @PUT @Path("{resource-type}/{id}") public javax.ws.rs.core.Response update​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id, javax.json.JsonObject input)
    • delete

      @DELETE @Path("{resource-type}/{id}") public javax.ws.rs.core.Response delete​(@PathParam("resource-type") java.lang.String resourceType, @PathParam("id") java.lang.String id)