All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.status.JsonStatusReporter Maven / Gradle / Ivy

The newest version!
package com.enonic.xp.status;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.MediaType;

public abstract class JsonStatusReporter
    implements StatusReporter
{
    @Override
    public final MediaType getMediaType()
    {
        return MediaType.JSON_UTF_8;
    }

    @Override
    public final void report( final OutputStream outputStream )
        throws IOException
    {
        outputStream.write( getReport().toString().getBytes( StandardCharsets.UTF_8 ) );
    }

    public abstract JsonNode getReport();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy