Class RedactingMessageBodyWriter<T>

java.lang.Object
com.lucidworks.apollo.rest.providers.RedactingMessageBodyWriter<T>
Type Parameters:
T - The entity class to match
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<T>
Direct Known Subclasses:
RedactingSearchClusterMessageBodyWriter

public abstract class RedactingMessageBodyWriter<T> extends Object implements javax.ws.rs.ext.MessageBodyWriter<T>
Base implementation for a MessageBodyWriter that performs redaction of sensitive data
See Also:
  • RedactingSchemaVisitor
  • Constructor Details

    • RedactingMessageBodyWriter

      protected RedactingMessageBodyWriter(MessageBodyRedactor<T> redactor, Class<T> clazz, com.fasterxml.jackson.databind.ObjectMapper mapper)
  • Method Details

    • isWriteable

      public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Test if the entity is a clazz or a Collection of clazz
      Specified by:
      isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>
    • getSize

      public long getSize(T entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>
    • writeTo

      public void writeTo(T entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
      Redact and serialize one or more entities of clazz
      Specified by:
      writeTo in interface javax.ws.rs.ext.MessageBodyWriter<T>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException