Search in sources :

Example 1 with JobsClient

use of com.github.jmchilton.blend4j.galaxy.JobsClient in project irida by phac-nml.

the class AnalysisProvenanceServiceGalaxyTest method setUp.

@Before
public void setUp() {
    this.galaxyHistoriesService = mock(GalaxyHistoriesService.class);
    this.toolsClient = mock(ToolsClient.class);
    this.jobsClient = mock(JobsClient.class);
    this.provenanceService = new AnalysisProvenanceServiceGalaxy(galaxyHistoriesService, toolsClient, jobsClient);
}
Also used : GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) AnalysisProvenanceServiceGalaxy(ca.corefacility.bioinformatics.irida.service.analysis.workspace.galaxy.AnalysisProvenanceServiceGalaxy) ToolsClient(com.github.jmchilton.blend4j.galaxy.ToolsClient) JobsClient(com.github.jmchilton.blend4j.galaxy.JobsClient) Before(org.junit.Before)

Example 2 with JobsClient

use of com.github.jmchilton.blend4j.galaxy.JobsClient in project irida by phac-nml.

the class JobDetailsCommandLineTransfer method main.

public static void main(String[] args) {
    checkNotNull(GALAXY_URL, "Galaxy URL is required. [galaxy.url]");
    checkNotNull(GALAXY_API, "Galaxy API key is required. [galaxy.api.key]");
    checkNotNull(JDBC_URL, "JDBC URL is required. [jdbc.url]");
    checkNotNull(JDBC_USER, "JDBC user is required. [jdbc.user]");
    checkNotNull(JDBC_PASS, "JDBC password is required. [jdbc.pass]");
    final GalaxyInstance gi = GalaxyInstanceFactory.get(GALAXY_URL, GALAXY_API);
    final JobsClient jobsClient = gi.getJobsClient();
    final DriverManagerDataSource dataSource = new DriverManagerDataSource(JDBC_URL, JDBC_USER, JDBC_PASS);
    dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    final JdbcTemplate template = new JdbcTemplate(dataSource);
    template.query("select id, execution_manager_identifier from tool_execution", (rs, row) -> Pair.of(rs.getLong("id"), rs.getString("execution_manager_identifier"))).forEach(e -> {
        final JobDetails jobDetails = jobsClient.showJob(e.v);
        template.update("update tool_execution set command_line = ? where id = ?", jobDetails.getCommandLine(), e.k);
        logger.debug(String.format("Updated tool execution [%s] with command line [%s]", e.k, jobDetails.getCommandLine()));
    });
}
Also used : Logger(org.slf4j.Logger) GalaxyInstance(com.github.jmchilton.blend4j.galaxy.GalaxyInstance) LoggerFactory(org.slf4j.LoggerFactory) GalaxyInstanceFactory(com.github.jmchilton.blend4j.galaxy.GalaxyInstanceFactory) DriverManagerDataSource(org.springframework.jdbc.datasource.DriverManagerDataSource) Preconditions(com.google.common.base.Preconditions) JobsClient(com.github.jmchilton.blend4j.galaxy.JobsClient) JobDetails(com.github.jmchilton.blend4j.galaxy.beans.JobDetails) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) DriverManagerDataSource(org.springframework.jdbc.datasource.DriverManagerDataSource) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) GalaxyInstance(com.github.jmchilton.blend4j.galaxy.GalaxyInstance) JobDetails(com.github.jmchilton.blend4j.galaxy.beans.JobDetails) JobsClient(com.github.jmchilton.blend4j.galaxy.JobsClient)

Example 3 with JobsClient

use of com.github.jmchilton.blend4j.galaxy.JobsClient in project irida by phac-nml.

the class AnalysisExecutionServiceTestConfig method analysisProvenanceServiceGalaxy.

@Lazy
@Bean
public AnalysisProvenanceServiceGalaxy analysisProvenanceServiceGalaxy() {
    final ToolsClient toolsClient = localGalaxy.getGalaxyInstanceAdmin().getToolsClient();
    final JobsClient jobsClient = localGalaxy.getGalaxyInstanceAdmin().getJobsClient();
    return new AnalysisProvenanceServiceGalaxy(galaxyHistoriesService, toolsClient, jobsClient);
}
Also used : AnalysisProvenanceServiceGalaxy(ca.corefacility.bioinformatics.irida.service.analysis.workspace.galaxy.AnalysisProvenanceServiceGalaxy) ToolsClient(com.github.jmchilton.blend4j.galaxy.ToolsClient) JobsClient(com.github.jmchilton.blend4j.galaxy.JobsClient) Lazy(org.springframework.context.annotation.Lazy) Bean(org.springframework.context.annotation.Bean)

Aggregations

JobsClient (com.github.jmchilton.blend4j.galaxy.JobsClient)3 AnalysisProvenanceServiceGalaxy (ca.corefacility.bioinformatics.irida.service.analysis.workspace.galaxy.AnalysisProvenanceServiceGalaxy)2 ToolsClient (com.github.jmchilton.blend4j.galaxy.ToolsClient)2 GalaxyHistoriesService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService)1 GalaxyInstance (com.github.jmchilton.blend4j.galaxy.GalaxyInstance)1 GalaxyInstanceFactory (com.github.jmchilton.blend4j.galaxy.GalaxyInstanceFactory)1 JobDetails (com.github.jmchilton.blend4j.galaxy.beans.JobDetails)1 Preconditions (com.google.common.base.Preconditions)1 Before (org.junit.Before)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1 Bean (org.springframework.context.annotation.Bean)1 Lazy (org.springframework.context.annotation.Lazy)1 JdbcTemplate (org.springframework.jdbc.core.JdbcTemplate)1 DriverManagerDataSource (org.springframework.jdbc.datasource.DriverManagerDataSource)1