Class JsonTransformer


  • public final class JsonTransformer
    extends java.lang.Object
    This class is used in order to make transformations on Json objects received from Vitam
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.fasterxml.jackson.databind.node.ObjectNode buildAllParentsRef​(java.lang.String unitId, com.fasterxml.jackson.databind.JsonNode allParents)
      This method builds an ObjectNode based on a list of JsonNode object
      static java.io.ByteArrayOutputStream buildLogbookStatCsvFile​(com.fasterxml.jackson.databind.JsonNode logbookOperation)
      Generates execution time by step relative to a logbook operation
      static com.fasterxml.jackson.databind.JsonNode transformResultObjects​(com.fasterxml.jackson.databind.JsonNode searchResult)
      This method transforms ResultObjects so thr IHM could display results
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • transformResultObjects

        public static com.fasterxml.jackson.databind.JsonNode transformResultObjects​(com.fasterxml.jackson.databind.JsonNode searchResult)
        This method transforms ResultObjects so thr IHM could display results
        Parameters:
        searchResult - the Json to be transformed
        Returns:
        the transformed JsonNode
      • buildAllParentsRef

        public static com.fasterxml.jackson.databind.node.ObjectNode buildAllParentsRef​(java.lang.String unitId,
                                                                                        com.fasterxml.jackson.databind.JsonNode allParents)
                                                                                 throws VitamException
        This method builds an ObjectNode based on a list of JsonNode object
        Parameters:
        unitId - achive unit
        allParents - list of JsonNode Objects used to build the referential
        Returns:
        An ObjectNode where the key is the identifier and the value is the parent details (Title, Id, _up)
        Throws:
        VitamException - if error when creating parent ObjectNode
      • buildLogbookStatCsvFile

        public static java.io.ByteArrayOutputStream buildLogbookStatCsvFile​(com.fasterxml.jackson.databind.JsonNode logbookOperation)
                                                                     throws VitamException,
                                                                            java.io.IOException
        Generates execution time by step relative to a logbook operation
        Parameters:
        logbookOperation - logbook operation in JsonNode format
        Returns:
        CSV report logbook
        Throws:
        VitamException - if unexpected error in CSV file generation process
        java.io.IOException - if error when write output stream
        java.lang.Exception - if error in others cases