Class GraphConfig


  • public final class GraphConfig
    extends Object
    GraphConfig contains configuration for Graphs. This configuration is used along side a Schema and StoreProperties to create a Graph. This configuration is made up of graph properties such as a graphId, GraphLibrary, a graph View and GraphHooks. To create an instance of GraphConfig you can either use the GraphConfig.Builder or a json file. If you wish to write a GraphHook in a separate json file and include it, you can do it by using the GraphHookPath GraphHook and setting the path field within.
    See Also:
    GraphConfig.Builder
    • Constructor Detail

      • GraphConfig

        public GraphConfig()
      • GraphConfig

        public GraphConfig​(String graphId)
    • Method Detail

      • getGraphId

        public String getGraphId()
      • setGraphId

        public void setGraphId​(String graphId)
      • getView

        public View getView()
      • setView

        public void setView​(View view)
      • setLibrary

        public void setLibrary​(GraphLibrary library)
      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String description)
      • getHooks

        public List<GraphHook> getHooks()
        Returns a list of all the graph hooks.
        Returns:
        List of graph hooks.
      • getOtelActive

        public Boolean getOtelActive()
        Is OpenTelemtery logging set to be active
        Returns:
        True if active
      • setOtelActive

        public void setOtelActive​(Boolean otelActive)
        Set OpenTelemetry logging to be active
        Parameters:
        otelActive - is active
      • addHook

        public void addHook​(GraphHook hook)
        Adds the supplied GraphHook to the list of graph hooks.
        Parameters:
        hook - The hook to add.
      • hasHook

        public boolean hasHook​(Class<? extends GraphHook> hookClass)
        Checks the current GraphHook list to see if any of the hooks match the supplied class. Will return true if list contains one or more matches.
        Parameters:
        hookClass - Class to check for match.
        Returns:
        True if hook with matching class found.
      • validateAndUpdateGetFromCacheHook

        public void validateAndUpdateGetFromCacheHook​(Store store,
                                                      Class<? extends Operation> operationClass,
                                                      Class<? extends GetFromCacheHook> hookClass,
                                                      String suffixFromProperties)
        Extracts and compares the cache suffixes of the supplied Operation's handler and GetFromCacheHook resolver hook, throws GraphHookSuffixException if mismatched as writing and reading to cache will not behave correctly.

        Will attempt to add the supplied GetFromCacheHook to the graph config if not currently present.

        Parameters:
        store - The Store the operationClass is for
        operationClass - The Operation requiring cache write
        hookClass - The Hook requiring cache reading
        suffixFromProperties - The suffix from property
      • initView

        public void initView​(Schema schema)
        Initialises the View for the graph config based on supplied schema.
        Parameters:
        schema - The schema to set the View from.