Interface JsonApiHandler<T>

All Known Implementing Classes:
DefaultJsonApiHandler, JsonApiHandlerChain

public interface JsonApiHandler<T>
  • Method Summary

    Modifier and Type Method Description
    default void afterDelete​(JsonApiContext context, T entity)
    Called after an existing entity has been removed from the persistence context/database.
    default void afterFind​(JsonApiContext context, T entity)
    Called after the database has been searched for the requested entity/entities.
    default void afterMerge​(JsonApiContext context, T entity)
    Called after an existing entity has been merged into the persistence context.
    default void afterPersist​(JsonApiContext context, T entity)
    Called after a new entity has been added to the persistence context/database.
    default void afterValidation​(JsonApiContext context, java.util.Set<javax.validation.ConstraintViolation<?>> violations)
    Called following a validation operation.
    default void beforeDelete​(JsonApiContext context, T entity)
    Called prior to an attempt to remove an existing entity from the persistence context/database.
    default void beforeMerge​(JsonApiContext context, T entity)
    Called prior to an existing entity being merged into the persistence context.
    default void beforePersist​(JsonApiContext context, T entity)
    Called prior to a new entity being added to the persistence context/database.
    default void beforeResponse​(JsonApiContext context)
    Called at the end of each request.
    default void beforeUpdate​(JsonApiContext context, T entity)
    Called prior to an existing entity being updated with new values submitted by the client.
    boolean isHandler​(java.lang.String resourceType, java.lang.String httpMethod)  
    default void onRequest​(JsonApiContext context)
    Called at the beginning of each request prior to validation or any database operations.
  • Method Details

    • isHandler

      boolean isHandler​(java.lang.String resourceType, java.lang.String httpMethod)
    • onRequest

      default void onRequest​(JsonApiContext context)
      Called at the beginning of each request prior to validation or any database operations.
      Parameters:
      context -
    • afterValidation

      default void afterValidation​(JsonApiContext context, java.util.Set<javax.validation.ConstraintViolation<?>> violations)
      Called following a validation operation.
      Parameters:
      context -
      violations -
    • afterFind

      default void afterFind​(JsonApiContext context, T entity)
      Called after the database has been searched for the requested entity/entities.
      Parameters:
      context -
      entity -
    • beforePersist

      default void beforePersist​(JsonApiContext context, T entity)
      Called prior to a new entity being added to the persistence context/database.
      Parameters:
      context -
      entity -
    • afterPersist

      default void afterPersist​(JsonApiContext context, T entity)
      Called after a new entity has been added to the persistence context/database.
      Parameters:
      context -
      entity -
    • beforeUpdate

      default void beforeUpdate​(JsonApiContext context, T entity)
      Called prior to an existing entity being updated with new values submitted by the client.
      Parameters:
      context -
      entity -
    • beforeMerge

      default void beforeMerge​(JsonApiContext context, T entity)
      Called prior to an existing entity being merged into the persistence context. When this method is called, the entity has already been updated with any changes submitted by the client.
      Parameters:
      context -
      entity -
    • afterMerge

      default void afterMerge​(JsonApiContext context, T entity)
      Called after an existing entity has been merged into the persistence context. When this method is called, the entity has already been updated with any changes submitted by the client.
      Parameters:
      context -
      entity -
    • beforeDelete

      default void beforeDelete​(JsonApiContext context, T entity)
      Called prior to an attempt to remove an existing entity from the persistence context/database.
      Parameters:
      context -
      entity -
    • afterDelete

      default void afterDelete​(JsonApiContext context, T entity)
      Called after an existing entity has been removed from the persistence context/database.
      Parameters:
      context -
      entity -
    • beforeResponse

      default void beforeResponse​(JsonApiContext context)
      Called at the end of each request.
      Parameters:
      context -