
website.automate.manager.api.client.ProjectRetrievalRemoteService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of manager-api-client Show documentation
Show all versions of manager-api-client Show documentation
Implementation of the automate.website public API.
package website.automate.manager.api.client;
import static java.util.Arrays.asList;
import java.util.List;
import website.automate.manager.api.client.model.Authentication;
import website.automate.manager.api.client.model.Project;
import website.automate.manager.api.client.model.Scenario;
import website.automate.manager.api.client.support.RestTemplate;
public class ProjectRetrievalRemoteService {
private static final ProjectRetrievalRemoteService INSTANCE = new ProjectRetrievalRemoteService();
public static ProjectRetrievalRemoteService getInstance(){
return INSTANCE;
}
private ScenarioRetrievalRemoteService scenarioRetrievalRemoteService = ScenarioRetrievalRemoteService.getInstance();
private RestTemplate restTemplate = RestTemplate.getInstance();
public List getProjectsByPrincipal(Authentication principal) {
return asList(restTemplate.performGet(Project [].class,
"/public/project/my?profile=BRIEF",
principal));
}
public List getProjectsWithScenariosByPrincipal(Authentication principal){
List projects = getProjectsByPrincipal(principal);
for(Project project : projects){
List scenarios = scenarioRetrievalRemoteService.getScenariosByProjectIdAndPrincipal(project.getId(), principal);
project.setScenarios(scenarios);
}
return projects;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy