public ProxyStore build() { try { store.initialise(graphId, new Schema(), properties); } catch (final StoreException e) { throw new IllegalArgumentException("The store could not be initialised with the provided properties", e); } return store; } }
/** * @param config configuration containing optional graphIds * @param context the user context to match visibility against. * @return merged schema of the visible graphs. */ public Schema getSchema(final Map<String, String> config, final Context context) { if (null == context) { // no context then return an empty schema return new Schema(); } return getSchema(config, context.getUser()); }
public Schema getSchema(final Map<String, String> config, final User user) { if (null == user) { // no user then return an empty schema return new Schema(); } final List<String> graphIds = FederatedStoreUtil.getGraphIds(config); final Stream<Graph> graphs = getStream(user, graphIds); final Builder schemaBuilder = new Builder(); try { graphs.forEach(g -> schemaBuilder.merge(g.getSchema())); } catch (final SchemaException e) { final List<String> resultGraphIds = getStream(user, graphIds).map(Graph::getGraphId).collect(Collectors.toList()); throw new SchemaException(String.format(UNABLE_TO_MERGE_THE_SCHEMAS_FOR_ALL_OF_YOUR_FEDERATED_GRAPHS, resultGraphIds, KEY_OPERATION_OPTIONS_GRAPH_IDS), e); } return schemaBuilder.build(); }
/** * Initialise this FederatedStore with any sub-graphs defined within the * properties. * * @param graphId the graphId to label this FederatedStore. * @param unused unused * @param properties properties to initialise this FederatedStore with, can * contain details on graphs to add to scope. * @throws StoreException if no cache has been set */ @Override public void initialise(final String graphId, final Schema unused, final StoreProperties properties) throws StoreException { super.initialise(graphId, new Schema(), properties); customPropertiesAuths = getCustomPropertiesAuths(); isPublicAccessAllowed = Boolean.valueOf(getProperties().getIsPublicAccessAllowed()); }
public Schema getSchema(final GetSchema operation, final Context context) { if (null == context || null == context.getUser()) { return new Schema();