use of org.eclipse.che.api.workspace.shared.dto.ServerDto in project che-server by eclipse-che.
the class WorkspaceService method filterServers.
private WorkspaceDto filterServers(WorkspaceDto workspace, boolean includeInternal) {
// no runtime - nothing to filter
if (workspace.getRuntime() == null) {
return workspace;
}
// if it is needed to include internal there is nothing to filter
if (includeInternal) {
return workspace;
}
for (MachineDto machine : workspace.getRuntime().getMachines().values()) {
Map<String, ServerDto> filteredServers = new HashMap<>();
machine.getServers().forEach((name, server) -> {
if (!ServerConfig.isInternal(server.getAttributes())) {
filteredServers.put(name, server);
}
});
machine.withServers(filteredServers);
}
return workspace;
}
use of org.eclipse.che.api.workspace.shared.dto.ServerDto in project devspaces-images by redhat-developer.
the class WorkspaceService method filterServers.
private WorkspaceDto filterServers(WorkspaceDto workspace, boolean includeInternal) {
// no runtime - nothing to filter
if (workspace.getRuntime() == null) {
return workspace;
}
// if it is needed to include internal there is nothing to filter
if (includeInternal) {
return workspace;
}
for (MachineDto machine : workspace.getRuntime().getMachines().values()) {
Map<String, ServerDto> filteredServers = new HashMap<>();
machine.getServers().forEach((name, server) -> {
if (!ServerConfig.isInternal(server.getAttributes())) {
filteredServers.put(name, server);
}
});
machine.withServers(filteredServers);
}
return workspace;
}
Aggregations