Class FederatedStore

    • Constructor Detail

      • FederatedStore

        public FederatedStore()
    • Method Detail

      • initialise

        public void initialise​(String graphId,
                               Schema unused,
                               StoreProperties properties)
                        throws StoreException
        Initialise this FederatedStore with any sub-graphs defined within the properties.
        Overrides:
        initialise in class Store
        Parameters:
        graphId - the graphId to label this FederatedStore.
        unused - unused
        properties - properties to initialise this FederatedStore with, can contain details on graphs to add to scope.
        Throws:
        StoreException - if no cache has been set
      • addGraphs

        public void addGraphs​(Set<String> graphAuths,
                              String owningUserId,
                              boolean isPublic,
                              GraphSerialisable... graphs)
                       throws StorageException
        Adds graphs to the scope of FederatedStore.

        To be used by the FederatedStore and Handlers only. Users should add graphs via the AddGraph operation. public access will be ignored if the FederatedStore denies this action at initialisation, will default to usual access with owningUserId and graphAuths

        Parameters:
        owningUserId - the adding userId
        graphs - the graph to add
        isPublic - if this class should have public access.
        graphAuths - the access auths for the graph being added
        Throws:
        StorageException - if unable to put graph into storage
      • remove

        public boolean remove​(String graphId,
                              User user,
                              boolean removeCache)

        Removes graphs from the scope of FederatedStore.

        To be used by the FederatedStore and Handlers only. Users should remove graphs via the RemoveGraph operation.

        Parameters:
        graphId - to be removed from scope
        user - to match visibility against
        removeCache - to remove associated caches with this graph.
        Returns:
        success of removal
      • remove

        public boolean remove​(String graphId,
                              User user,
                              boolean removeCache,
                              boolean asAdmin)
      • getExternallySupportedOperations

        public Set<Class<? extends Operation>> getExternallySupportedOperations()
        Returns:
        a collection of all the Operations supported by subgraphs.
      • removeExternallySupportedOperation

        public void removeExternallySupportedOperation​(Class<? extends Operation> operation)
      • addExternallySupportedOperation

        public void addExternallySupportedOperation​(Class<? extends Operation> operation)
      • getAllGraphIds

        public Collection<String> getAllGraphIds​(User user)
        Parameters:
        user - the visibility to use for getting graphIds
        Returns:
        All the graphId(s) within scope of this FederatedStore and within visibility for the given user. These will be returned in random order.
      • getAllGraphIds

        public List<String> getAllGraphIds​(User user,
                                           boolean userRequestingAdminUsage)
      • getSchema

        public Schema getSchema()
        Get Schema for this FederatedStore (without a context)

        This will return a merged schema of the optimised compact schemas of the stores inside this FederatedStore. It uses an empty/default Context, meaning it can only return results for graphs where this is valid, an empty Schema is otherwise returned. To supply a Context, use the getSchema() method, or ideally use the GetSchema operation instead.

        Overrides:
        getSchema in class Store
        Returns:
        Schema, empty if default Context not valid
      • getOriginalSchema

        public Schema getOriginalSchema()
        Get Schema for this FederatedStore (without a context)

        This will return a merged schema of the original schemas of the stores inside this FederatedStore. This method uses an empty/default Context, meaning it can only return results for graphs where this is valid, an empty Schema is otherwise returned. To supply a Context, use the getSchema() method, or ideally use the GetSchema operation instead.

        Overrides:
        getOriginalSchema in class Store
        Returns:
        Schema, empty if default Context not valid
      • getSchema

        public Schema getSchema​(Context context,
                                boolean getCompactSchema)
        Get Schema for this FederatedStore.

        This will return a merged schema of the original schemas or the optimised compact schemas of the stores inside this FederatedStore.

        Parameters:
        context - context with valid User
        getCompactSchema - if true, gets the optimised compact schemas
        Returns:
        Schema
      • getGraphs

        public List<GraphSerialisable> getGraphs​(User user,
                                                 List<String> graphIds,
                                                 IFederationOperation operation)

        Gets a collection of graph objects within FederatedStore scope from the given csv of graphIds, with visibility of the given user.

        Graphs are returned once per operation, this does not allow an infinite loop of FederatedStores to occur.

        if graphIdsCSV is null then all graph objects within FederatedStore scope are returned.

        Parameters:
        user - the users scope to get graphs for.
        graphIds - the list of graphIds to get. null will return all graphs.
        operation - the requesting operation, graphs are returned only once per operation.
        Returns:
        the graph collection.
      • getAllGraphsAndAuths

        public Map<String,​Object> getAllGraphsAndAuths​(User user,
                                                             List<String> graphIds,
                                                             boolean userRequestingAdminUsage)
      • isLimitedToLibraryProperties

        public boolean isLimitedToLibraryProperties​(User user)
        The FederatedStore at time of initialisation, can set the auths required to allow users to use custom StoreProperties outside the scope of the GraphLibrary.
        Parameters:
        user - the user needing validation for custom property usage.
        Returns:
        boolean permission
      • isLimitedToLibraryProperties

        public boolean isLimitedToLibraryProperties​(User user,
                                                    boolean userRequestingAdminUsage)
      • getStoreConfiguredGraphIds

        public List<String> getStoreConfiguredGraphIds()
      • getStoreConfiguredMergeFunctions

        public Map<String,​BiFunction> getStoreConfiguredMergeFunctions()