package be.iminds.ilabt.jfed.experimenter_gui.editor.properties.cmi;

/**
 * User: twalcari
 * Date: 8/28/2014
 * Time: 17:02
 */
@Deprecated
public class FilteredCMIManager implements CMIManager {
//    private final ResourceClass resourceClass;
//    private final CMIManager cmiManager;
//
//    public FilteredCMIManager(@Nonnull ResourceClass resourceClass, @Nonnull CMIManager cmiManager) {
//        this.resourceClass = resourceClass;
//        this.cmiManager = cmiManager;
//    }
//
//    @Override
//    public ObservableList<ComponentManagerInfo> getComponentManagerInfos() {
//        ObservableList<ComponentManagerInfo> filteredResult = FXCollections.observableArrayList();
//
//        filteredResult.addAll(cmiManager.getComponentManagerInfos().stream()
//                .filter(cmi -> resourceClass.getEnabledTestbeds().containsKey(cmi.getAuthority().getDefaultComponentManagerAsGeniUrn()))
//                .collect(Collectors.toList()));
//        return filteredResult;
//    }
//
//    @Override
//    public ObservableList<FXRspecNode> filterComponentIds(ComponentManagerInfo cmi, ObservableList<FXRspecNode> nodesList) {
//        final JFedGuiConfig.EnabledTestbed enabledTestbed =
//                resourceClass.getEnabledTestbeds().get(cmi.getAuthority().getDefaultComponentManagerAsGeniUrn());
//        if (enabledTestbed == null || enabledTestbed.getEnabledComponentIds().isEmpty())
//            return cmiManager.filterComponentIds(cmi, nodesList);
//
//        else {
//            return nodesList.filtered(input -> input.getComponentId() != null
//                    && enabledTestbed.getEnabledComponentIds().contains(input.getComponentId()));
//        }
//    }
//
//    @Override
//    public ComponentManagerInfo getComponentManagerInfo(GeniUrn componentManagerId) {
//        return cmiManager.getComponentManagerInfo(componentManagerId);
//    }
}
