Class FederatedStoreUtil


  • public final class FederatedStoreUtil
    extends Object
    • Method Detail

      • getCleanStrings

        public static List<String> getCleanStrings​(String value)
      • updateOperationForGraph

        public static <OP extends Operation> OP updateOperationForGraph​(OP operation,
                                                                        Graph graph,
                                                                        Context context)

        Within FederatedStore an Operation is executed against a collection of many graphs.

        Problem: When an Operation contains View information about an Element which is not known by the Graph; It will fail validation when executed.

        Solution: For each operation, remove all elements from the View that is unknown to the graph. This method will also update AddElements operations to allow elements to be added to various federated graphs with different schemas at the same time without causing validation errors.

        Type Parameters:
        OP - Operation type
        Parameters:
        operation - current operation
        graph - current graph
        context - current context, used for getSchema operation
        Returns:
        cloned operation with modified View for the given graph.
      • getFederatedOperation

        public static <INPUT,​OUTPUT extends Iterable<?>> FederatedOperation<INPUT,​OUTPUT> getFederatedOperation​(InputOutput<INPUT,​OUTPUT> operation)
        Defaulted with a iterableConcat
        Type Parameters:
        INPUT - payload input type
        OUTPUT - merge function output type
        Parameters:
        operation - operation to be wrapped in FederatedOperation
        Returns:
        the wrapped operation
      • getDefaultMergeFunction

        public static BiFunction getDefaultMergeFunction()
      • shallowCloneWithDeepOptions

        public static Operation shallowCloneWithDeepOptions​(Operation op)
        Return a clone of the given operations with a deep clone of options.

        Because payloadOperation.shallowClone() is used it can't be guaranteed that original options won't be modified. So a deep clone of the options is made for the shallow clone of the operation.

        Parameters:
        op - the operation to clone
        Returns:
        a clone of the operation with a deep clone of options.