Utils (The Data Transfer Agent Service 2.1.3-4.7.1-132914 API)
Date: 2017-10-17

org.gcube.datatransfer.agent.impl.utils

## Class Utils

- java.lang.Object
- - org.gcube.datatransfer.agent.impl.utils.Utils

-     public class Utils
      extends Object

  Author:
    Fabio Simeoni (FAO), Andrea Manzi (CERN)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.gcube.common.core.utils.logging.GCUBELog` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Utils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `consumeStream(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> stream)`
    `static String` | `getParameterFromWSResource(org.gcube.common.core.informationsystem.client.RPDocument resource, String field)`
    `static org.gcube.data.trees.patterns.Pattern` | `getPattern(org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder h)` Converts a `AnyHolder` returned by the service into a `Pattern`.
    `static <E extends org.gcube.common.core.faults.GCUBEFault> E` | `newFault(E fault, Throwable cause)` Moved here from data-transfer-common to remove the depdendency on gcf in that component Returns a given fault after serialising into it an original cause.
    `static String` | `replaceUnderscore(String input)`
    `static org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder` | `toHolder(Element e)`
    `static org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder` | `toHolder(org.gcube.data.trees.data.Node n)` Transforms a `Node` into a `AnyHolder` accepted by the service.
    `static org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder` | `toHolder(org.gcube.data.trees.patterns.Pattern p)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          public static org.gcube.common.core.utils.logging.GCUBELog logger

  - ### Constructor Detail

    - #### Utils

          public Utils()

  - ### Method Detail

    - #### getPattern

          public static org.gcube.data.trees.patterns.Pattern getPattern(org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder h)
                                                                  throws Exception

      Converts a `AnyHolder` returned by the service into a `Pattern`.
      Parameters:
        `h` - the holder
      Returns:
        the pattern
      Throws:
        `Exception` - if the conversion fails

    - #### newFault

          public static <E extends org.gcube.common.core.faults.GCUBEFault> E newFault(E fault,
                                                                       Throwable cause)

      Moved here from data-transfer-common to remove the depdendency on gcf in that component Returns a given fault after serialising into it an original cause.
      Type Parameters:
        `E` - the type of the fault
      Parameters:
        `fault` - the fault
        `cause` - the cause
      Returns:
        the fault

    - #### toHolder

          public static org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder toHolder(org.gcube.data.trees.patterns.Pattern p)
                                                                                         throws Exception

      Throws:
        `Exception`

    - #### toHolder

          public static org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder toHolder(Element e)

    - #### toHolder

          public static org.gcube.datatransfer.agent.stubs.datatransferagent.AnyHolder toHolder(org.gcube.data.trees.data.Node n)
                                                                                         throws Exception

      Transforms a `Node` into a `AnyHolder` accepted by the service.
      Parameters:
        `n` - the node
      Returns:
        the holder
      Throws:
        `Exception` - if the conversion fails

    - #### replaceUnderscore

          public static String replaceUnderscore(String input)

    - #### consumeStream

          public static boolean consumeStream(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> stream)

    - #### getParameterFromWSResource

          public static String getParameterFromWSResource(org.gcube.common.core.informationsystem.client.RPDocument resource,
                                          String field)

Copyright © 2017. All Rights Reserved.