use of org.jboss.tools.openshift.internal.ui.models.IReplicationControllerWrapper in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerContentProvider method getProjectChildren.
protected Object[] getProjectChildren(IProjectWrapper project) {
switch(project.getState()) {
case LOADED:
removeStub(project);
Collection<IResourceWrapper<?, ?>> services = project.getResourcesOfKind(ResourceKind.SERVICE);
Collection<IReplicationControllerWrapper> dcs = project.getResourcesOfType(IReplicationControllerWrapper.class);
services.addAll(dcs);
Collection<IResourceWrapper<?, ?>> pods = project.getResourcesOfKind(ResourceKind.POD).stream().filter(wrapper -> ResourceUtils.isRuntimePod((IPod) wrapper.getWrapped()) && !((IPod) wrapper.getWrapped()).isAnnotatedWith(OpenShiftAPIAnnotations.DEPLOYMENT_NAME)).collect(Collectors.toList());
services.addAll(pods);
return services.toArray();
case LOAD_STOPPED:
LoadingStub stub = removeStub(project);
if (stub != null) {
return stub.getChildren();
}
default:
project.load(e -> {
handleLoadingException(project, e);
});
return new Object[] { makeStub(project) };
}
}
Aggregations