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 Summary
ConstructorsModifierConstructorDescriptionprotectedRedactingMessageBodyWriter(MessageBodyRedactor<T> redactor, Class<T> clazz, com.fasterxml.jackson.databind.ObjectMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(T entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) Test if the entity is aclazzor a Collection ofclazzvoidwriteTo(T entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) Redact and serialize one or more entities ofclazz
-
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 aclazzor a Collection ofclazz- Specified by:
isWriteablein interfacejavax.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:
getSizein interfacejavax.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.WebApplicationExceptionRedact and serialize one or more entities ofclazz- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<T>- Throws:
IOExceptionjavax.ws.rs.WebApplicationException
-