@Override protected CompositeDatastore createDatastore() { final List<Datastore> datastores = new ArrayList<>(); for (final DCCheckBox<Datastore> checkBox : _checkBoxes) { if (checkBox.isSelected()) { final String datastoreName = checkBox.getText(); final Datastore datastore = checkBox.getValue(); if (datastore == null) { throw new IllegalStateException("No such datastore: " + datastoreName); } datastores.add(datastore); } } return new CompositeDatastore(_datastoreNameField.getText(), datastores); }
public String getChildDatastores() { if (!isCompositeDatastore()) { return null; } CompositeDatastore compositeDatastore = (CompositeDatastore) _datastore; List<? extends Datastore> childDatastores = compositeDatastore.getDatastores(); List<String> names = CollectionUtils.map(childDatastores, new HasNameMapper()); return names.toString(); } }
for (int i = 0; i < datastoreNames.length; i++) { final String datastoreName = datastoreNames[i]; if (originalDatastore == null || !originalDatastore.getName().equals(datastoreName)) { final DCCheckBox<Datastore> checkBox = new DCCheckBox<>(datastoreName, false); checkBox.setValue(mutableDatastoreCatalog.getDatastore(datastoreName)); _datastoreNameField.setText(originalDatastore.getName()); _datastoreNameField.setEnabled(false); final List<? extends Datastore> containedDatastores = originalDatastore.getDatastores(); final Set<String> containedDatastoreNames = new HashSet<>(); for (final Datastore datastore : containedDatastores) {
final CompositeDatastore ds = new CompositeDatastore(name, childDatastores); ds.setDescription(compositeDatastoreType.getDescription()); datastores.put(name, ds);
return "In-memory collection of records."; } else if (datastore instanceof CompositeDatastore) { final List<? extends Datastore> datastores = ((CompositeDatastore) datastore).getDatastores(); final StringBuilder sb = new StringBuilder(); for (final Datastore ds : datastores) {