23 | * Note: This might be replaced by utility method from commons-lang or guava someday 24 | * if one of those libraries is added as dependency. 25 | *
26 | * 27 | * @param array The array of strings 28 | * @param separator The separator 29 | * @return the resulting string 30 | */ 31 | public static String join(String[] array, String separator) { 32 | int len = array.length; 33 | if (len == 0) return ""; 34 | 35 | StringBuilder out = new StringBuilder(); 36 | out.append(array[0]); 37 | for (int i = 1; i < len; i++) { 38 | out.append(separator).append(array[i]); 39 | } 40 | return out.toString(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /consonance-webservice/src/main/java/io/swagger/wes/api/StringUtil.java: -------------------------------------------------------------------------------- 1 | package io.swagger.wes.api; 2 | 3 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2017-09-15T17:06:31.319-07:00") 4 | public class StringUtil { 5 | /** 6 | * Check if the given array contains the given value (with case-insensitive comparison). 7 | * 8 | * @param array The array 9 | * @param value The value to search 10 | * @return true if the array contains the value 11 | */ 12 | public static boolean containsIgnoreCase(String[] array, String value) { 13 | for (String str : array) { 14 | if (value == null && str == null) return true; 15 | if (value != null && value.equalsIgnoreCase(str)) return true; 16 | } 17 | return false; 18 | } 19 | 20 | /** 21 | * Join an array of strings with the given separator. 22 | *23 | * Note: This might be replaced by utility method from commons-lang or guava someday 24 | * if one of those libraries is added as dependency. 25 | *
26 | * 27 | * @param array The array of strings 28 | * @param separator The separator 29 | * @return the resulting string 30 | */ 31 | public static String join(String[] array, String separator) { 32 | int len = array.length; 33 | if (len == 0) return ""; 34 | 35 | StringBuilder out = new StringBuilder(); 36 | out.append(array[0]); 37 | for (int i = 1; i < len; i++) { 38 | out.append(separator).append(array[i]); 39 | } 40 | return out.toString(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /consonance-webservice/src/main/java/io/swagger/workflow/api/StringUtil.java: -------------------------------------------------------------------------------- 1 | package io.swagger.workflow.api; 2 | 3 | @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-07-11T20:20:51.265Z") 4 | public class StringUtil { 5 | /** 6 | * Check if the given array contains the given value (with case-insensitive comparison). 7 | * 8 | * @param array The array 9 | * @param value The value to search 10 | * @return true if the array contains the value 11 | */ 12 | public static boolean containsIgnoreCase(String[] array, String value) { 13 | for (String str : array) { 14 | if (value == null && str == null) return true; 15 | if (value != null && value.equalsIgnoreCase(str)) return true; 16 | } 17 | return false; 18 | } 19 | 20 | /** 21 | * Join an array of strings with the given separator. 22 | *23 | * Note: This might be replaced by utility method from commons-lang or guava someday 24 | * if one of those libraries is added as dependency. 25 | *
26 | * 27 | * @param array The array of strings 28 | * @param separator The separator 29 | * @return the resulting string 30 | */ 31 | public static String join(String[] array, String separator) { 32 | int len = array.length; 33 | if (len == 0) return ""; 34 | 35 | StringBuilder out = new StringBuilder(); 36 | out.append(array[0]); 37 | for (int i = 1; i < len; i++) { 38 | out.append(separator).append(array[i]); 39 | } 40 | return out.toString(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /swagger-ga4gh-client/src/main/java/io/swagger/client/auth/HttpBasicAuth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * workflow_execution.proto 3 | * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) 4 | * 5 | * OpenAPI spec version: version not set 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package io.swagger.client.auth; 15 | 16 | import io.swagger.client.Pair; 17 | 18 | import com.squareup.okhttp.Credentials; 19 | 20 | import java.util.Map; 21 | import java.util.List; 22 | 23 | import java.io.UnsupportedEncodingException; 24 | 25 | public class HttpBasicAuth implements Authentication { 26 | private String username; 27 | private String password; 28 | 29 | public String getUsername() { 30 | return username; 31 | } 32 | 33 | public void setUsername(String username) { 34 | this.username = username; 35 | } 36 | 37 | public String getPassword() { 38 | return password; 39 | } 40 | 41 | public void setPassword(String password) { 42 | this.password = password; 43 | } 44 | 45 | @Override 46 | public void applyToParams(List23 | * Note: This might be replaced by utility method from commons-lang or guava someday 24 | * if one of those libraries is added as dependency. 25 | *
26 | * 27 | * @param array The array of strings 28 | * @param separator The separator 29 | * @return the resulting string 30 | */ 31 | public static String join(String[] array, String separator) { 32 | int len = array.length; 33 | if (len == 0) return ""; 34 | 35 | StringBuilder out = new StringBuilder(); 36 | out.append(array[0]); 37 | for (int i = 1; i < len; i++) { 38 | out.append(separator).append(array[i]); 39 | } 40 | return out.toString(); 41 | } 42 | 43 | /** 44 | * Convert the given object to string with each line indented by 4 spaces 45 | * (except the first line). 46 | */ 47 | public static String toIndentedString(Object o) { 48 | if (o == null) return "null"; 49 | return o.toString().replace("\n", "\n "); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /consonance-webservice/src/main/java/io/swagger/workflow/api/JobsApi.java: -------------------------------------------------------------------------------- 1 | package io.swagger.workflow.api; 2 | 3 | import io.consonance.webservice.core.ConsonanceUser; 4 | import io.dropwizard.auth.Auth; 5 | import io.dropwizard.hibernate.UnitOfWork; 6 | import io.swagger.annotations.ApiParam; 7 | import io.swagger.workflow.api.factories.JobsApiServiceFactory; 8 | import io.swagger.workflow.model.JobStatus; 9 | 10 | import javax.ws.rs.GET; 11 | import javax.ws.rs.Path; 12 | import javax.ws.rs.PathParam; 13 | import javax.ws.rs.Produces; 14 | import javax.ws.rs.core.Context; 15 | import javax.ws.rs.core.Response; 16 | import javax.ws.rs.core.UriInfo; 17 | 18 | @Path("/jobs") 19 | 20 | @Produces({ "application/json" }) 21 | @io.swagger.annotations.Api(description = "the jobs API") 22 | @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-07-11T20:20:51.265Z") 23 | public class JobsApi { 24 | private final JobsApiService delegate = JobsApiServiceFactory.getJobsApi(); 25 | 26 | @Context 27 | private UriInfo uriInfo; 28 | 29 | @GET 30 | @Path("/{jobId}") 31 | @UnitOfWork 32 | @Produces({ "application/json" }) 33 | @io.swagger.annotations.ApiOperation(value = "", notes = "Get status for a workflow ", response = JobStatus.class, tags={ "GA4GH-workflow-execution" }) 34 | @io.swagger.annotations.ApiResponses(value = { 35 | @io.swagger.annotations.ApiResponse(code = 200, message = "Description of job including its status", response = JobStatus.class) }) 36 | public Response jobsDescriptorUrlGet( 37 | @ApiParam(value = "URL to descriptor for workflow",required=true) @PathParam("jobId") String jobId, 38 | @Auth ConsonanceUser user) 39 | throws NotFoundException { 40 | return delegate.jobsDescriptorUrlGet(jobId, user, uriInfo); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /consonance-client/src/main/java/io/consonance/client/mix/JobMixIn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Consonance - workflow software for multiple clouds 3 | * Copyright (C) 2016 OICR 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see36 | * Note: This might be replaced by utility method from commons-lang or guava someday 37 | * if one of those libraries is added as dependency. 38 | *
39 | * 40 | * @param array The array of strings 41 | * @param separator The separator 42 | * @return the resulting string 43 | */ 44 | public static String join(String[] array, String separator) { 45 | int len = array.length; 46 | if (len == 0) return ""; 47 | 48 | StringBuilder out = new StringBuilder(); 49 | out.append(array[0]); 50 | for (int i = 1; i < len; i++) { 51 | out.append(separator).append(array[i]); 52 | } 53 | return out.toString(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /consonance-webservice/src/main/java/io/consonance/webservice/jdbi/JobDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Consonance - workflow software for multiple clouds 3 | * Copyright (C) 2016 OICR 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see