Class GalaxyLibrariesService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService
-
public class GalaxyLibrariesService extends java.lang.Object
A service class for dealing with Galaxy libraries.
-
-
Constructor Summary
Constructors Constructor Description GalaxyLibrariesService(com.github.jmchilton.blend4j.galaxy.LibrariesClient librariesClient, int libraryPollingTime, int libraryUploadTimeout, int threadPoolSize)
Builds a new GalaxyLibrariesService with the given LibrariesClient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.github.jmchilton.blend4j.galaxy.beans.Library
buildEmptyLibrary(GalaxyProjectName libraryName)
Builds a new empty library with the given name.void
deleteLibrary(java.lang.String libraryId)
Deletes the Galaxy library with the given id.java.util.Map<java.nio.file.Path,java.lang.String>
filesToLibraryWait(java.util.Set<java.nio.file.Path> paths, com.github.jmchilton.blend4j.galaxy.beans.Library library, DataStorage dataStorage)
Uploads a set of files to a given library, waiting until all uploads are complete.java.lang.String
fileToLibrary(java.nio.file.Path path, InputFileType fileType, com.github.jmchilton.blend4j.galaxy.beans.Library library, DataStorage dataStorage)
Uploads the given file to a library with the given information.
-
-
-
Constructor Detail
-
GalaxyLibrariesService
public GalaxyLibrariesService(com.github.jmchilton.blend4j.galaxy.LibrariesClient librariesClient, int libraryPollingTime, int libraryUploadTimeout, int threadPoolSize)
Builds a new GalaxyLibrariesService with the given LibrariesClient.- Parameters:
librariesClient
- The LibrariesClient used to interact with Galaxy libraries.libraryPollingTime
- The time (in seconds) for polling a Galaxy library.libraryUploadTimeout
- The timeout (in seconds) for waiting for files to be uploaded to a library.threadPoolSize
- The thread pool size for parallel polling of Galaxy to check if uploads are finished.
-
-
Method Detail
-
buildEmptyLibrary
public com.github.jmchilton.blend4j.galaxy.beans.Library buildEmptyLibrary(GalaxyProjectName libraryName) throws CreateLibraryException
Builds a new empty library with the given name.- Parameters:
libraryName
- The name of the new library.- Returns:
- A Library object for the newly created library.
- Throws:
CreateLibraryException
- If no library could be created.
-
fileToLibrary
public java.lang.String fileToLibrary(java.nio.file.Path path, InputFileType fileType, com.github.jmchilton.blend4j.galaxy.beans.Library library, DataStorage dataStorage) throws UploadException
Uploads the given file to a library with the given information.- Parameters:
path
- The path of the file to upload.fileType
- The type of the file to upload.library
- The library to upload the file into.dataStorage
- TheDataStorage
method to apply to this dataset.- Returns:
- A dataset id for the dataset in this library.
- Throws:
UploadException
- If there was an issue uploading the file to the library.
-
filesToLibraryWait
public java.util.Map<java.nio.file.Path,java.lang.String> filesToLibraryWait(java.util.Set<java.nio.file.Path> paths, com.github.jmchilton.blend4j.galaxy.beans.Library library, DataStorage dataStorage) throws UploadException
Uploads a set of files to a given library, waiting until all uploads are complete.- Parameters:
paths
- The set of paths to upload.library
- The library to initially upload the file into.dataStorage
- The type of DataStorage strategy to use.- Returns:
- An @{link Map} of paths and ids for each dataset object in this library.
- Throws:
UploadException
- If there was an issue uploading the file to Galaxy.
-
deleteLibrary
public void deleteLibrary(java.lang.String libraryId) throws DeleteGalaxyObjectFailedException
Deletes the Galaxy library with the given id.- Parameters:
libraryId
- The id of the library to delete.- Throws:
DeleteGalaxyObjectFailedException
- If there was a failure to delete the library.
-
-