public MongoDBResolver(DataSourcesConfiguration ds) { datasources = ds.getDataSourcesByType(MongoConfiguration.class); }
/** * initialize datasource configuration from the given json document * * @param node Json document * * The document has the following format: <pre> * { * "datasourceName" : { * "type" : datasourceType, * <Type specific configuration> * } * ... * } * </pre> * * Each datasource is defined by a field in a Json object. For each * datasource definition, the 'type' field gives the class name of a a * JsonInitializable object. When Json object is processed, an instance of * 'type' is instantiated for each datasource, and processing of the actual * datasource configuration is delegated to the implementation, */ public DataSourcesConfiguration(JsonNode node) { this.initializeFromJson(node); }
private synchronized void initializeParser() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException, InstantiationException { if (parser == null) { Extensions<JsonNode> extensions = new Extensions<>(); extensions.addDefaultExtensions(); Map<String, DataSourceConfiguration> ds = datasources.getDataSources(); for (Map.Entry<String, DataSourceConfiguration> entry : ds.entrySet()) { Class<? extends DataStoreParser> tempParser = entry.getValue().getMetadataDataStoreParser(); DataStoreParser backendParser = tempParser.newInstance(); extensions.registerDataStoreParser(backendParser.getDefaultName(), backendParser); } parser = new JSONMetadataParser(extensions, new DefaultTypes(), NODE_FACTORY); } }
JSONMetadataParser jsonParser, LightblueFactory factory) { DataSourceConfiguration cfg = datasources.getDataSourceConfiguration(datasource); if (cfg != null) { DBResolver dbresolver = new MongoDBResolver(datasources);
if (!loadStatically || lightblueFactory == null) { lightblueFactory = new LightblueFactory( new DataSourcesConfiguration(getDatasourcesJson()), getLightblueCrudJson(), getLightblueMetadataJson());
private synchronized void initializeParser() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException, InstantiationException { if (parser == null) { Extensions<JsonNode> extensions = new Extensions<>(); extensions.addDefaultExtensions(); Map<String, DataSourceConfiguration> ds = datasources.getDataSources(); for (Map.Entry<String, DataSourceConfiguration> entry : ds.entrySet()) { Class<? extends DataStoreParser> tempParser = entry.getValue().getMetadataDataStoreParser(); DataStoreParser backendParser = tempParser.newInstance(); injectDependencies(backendParser); extensions.registerDataStoreParser(backendParser.getDefaultName(), backendParser); } parser = new JSONMetadataParser(extensions, new DefaultTypes(), NODE_FACTORY); } }
JSONMetadataParser jsonParser, LightblueFactory factory) { DataSourceConfiguration cfg = datasources.getDataSourceConfiguration(datasource); if (cfg != null) { DBResolver dbresolver = new MongoDBResolver(datasources);
public MongoDBResolver(DataSourcesConfiguration ds) { datasources = ds.getDataSourcesByType(MongoConfiguration.class); }
private synchronized void initializeParser() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException, InstantiationException { if (parser == null) { Extensions<JsonNode> extensions = new Extensions<>(); extensions.addDefaultExtensions(); Map<String, DataSourceConfiguration> ds = datasources.getDataSources(); for (Map.Entry<String, DataSourceConfiguration> entry : ds.entrySet()) { Class<? extends DataStoreParser> tempParser = entry.getValue().getMetadataDataStoreParser(); DataStoreParser backendParser = tempParser.newInstance(); injectDependencies(backendParser); extensions.registerDataStoreParser(backendParser.getDefaultName(), backendParser); } parser = new JSONMetadataParser(extensions, new DefaultTypes(), NODE_FACTORY); } }
/** * initialize datasource configuration from the given json document * * @param node Json document * * The document has the following format: <pre> * { * "datasourceName" : { * "type" : datasourceType, * <Type specific configuration> * } * ... * } * </pre> * * Each datasource is defined by a field in a Json object. For each * datasource definition, the 'type' field gives the class name of a a * JsonInitializable object. When Json object is processed, an instance of * 'type' is instantiated for each datasource, and processing of the actual * datasource configuration is delegated to the implementation, */ public DataSourcesConfiguration(JsonNode node) { this.initializeFromJson(node); }
public CRUDController createController(ControllerConfiguration cfg, DataSourcesConfiguration ds) { return new LdapCRUDController(new LdapDBResolver( new HashSet<LdapDataSourceConfiguration>(ds.getDataSourcesByType(LdapDataSourceConfiguration.class).values()))); }
/** * initialize datasource configuration from the given json document * * @param node Json document * * The document has the following format: <pre> * { * "datasourceName" : { * "type" : datasourceType, * <Type specific configuration> * } * ... * } * </pre> * * Each datasource is defined by a field in a Json object. For each * datasource definition, the 'type' field gives the class name of a a * JsonInitializable object. When Json object is processed, an instance of * 'type' is instantiated for each datasource, and processing of the actual * datasource configuration is delegated to the implementation, */ public DataSourcesConfiguration(JsonNode node) { this.initializeFromJson(node); }