Class SmartExecutorExceptionMapper

java.lang.Object
org.gcube.vremanagement.executor.exception.SmartExecutorExceptionMapper

public abstract class SmartExecutorExceptionMapper extends Object
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • mapper

      protected static final org.gcube.com.fasterxml.jackson.databind.ObjectMapper mapper
  • Constructor Details

    • SmartExecutorExceptionMapper

      public SmartExecutorExceptionMapper()
  • Method Details

    • getObjectMapper

      public static org.gcube.com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      Returns:
      the ObjectMapper
    • marshal

      public static <T extends OutputStream, EE extends ExecutorException> T marshal(EE object, T stream) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
      Write the serialization of a given resource to a given OutputStream .
      Parameters:
      object - the resource
      stream - the stream in input
      Throws:
      IOException
      org.gcube.com.fasterxml.jackson.databind.JsonMappingException
      org.gcube.com.fasterxml.jackson.core.JsonGenerationException
    • marshal

      public static <T extends Writer, EE extends ExecutorException> T marshal(EE object, T writer) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
      Write the serialization of a given resource to a given Writer .
      Parameters:
      object - the resource
      writer - the writer in input
      Throws:
      IOException
      org.gcube.com.fasterxml.jackson.databind.JsonMappingException
      org.gcube.com.fasterxml.jackson.core.JsonGenerationException
    • marshal

      public static <EE extends ExecutorException> String marshal(EE object) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
      Return the String serialization of a given resource
      Parameters:
      object - the resource
      Returns:
      the String serialization of a given resource
      Throws:
      org.gcube.com.fasterxml.jackson.core.JsonProcessingException
    • unmarshal

      public static <EE extends ExecutorException> EE unmarshal(Class<EE> clz, Reader reader) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
      Creates a resource of given class from its serialization in a given Reader.
      Parameters:
      clz - the class of the resource
      reader - the reader
      Returns:
      the resource
      Throws:
      org.gcube.com.fasterxml.jackson.core.JsonParseException
      org.gcube.com.fasterxml.jackson.databind.JsonMappingException
      IOException
    • unmarshal

      public static <EE extends ExecutorException> EE unmarshal(Class<EE> clz, InputStream stream) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
      Creates a resource of given class from its serialization in a given InputStream.
      Parameters:
      clz - the class of the resource
      stream - the stream
      Returns:
      the resource
      Throws:
      IOException
      org.gcube.com.fasterxml.jackson.databind.JsonMappingException
      org.gcube.com.fasterxml.jackson.core.JsonParseException
    • unmarshal

      public static <EE extends ExecutorException> EE unmarshal(Class<EE> clz, String string) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
      Creates a resource of given class from its serialization in a given String
      Parameters:
      clz - the class of the resource
      string -
      Returns:
      the resource
      Throws:
      org.gcube.com.fasterxml.jackson.core.JsonParseException
      org.gcube.com.fasterxml.jackson.databind.JsonMappingException
      IOException