├── .classpath
├── .gitignore
├── .project
├── .settings
├── org.eclipse.jdt.core.prefs
└── org.eclipse.m2e.core.prefs
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── nb-configuration.xml
├── pom.xml
├── release.sh
├── src
├── main
│ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── jmchilton
│ │ │ └── blend4j
│ │ │ ├── BaseClient.java
│ │ │ ├── Config.java
│ │ │ ├── exceptions
│ │ │ ├── ApiException.java
│ │ │ ├── ResponseException.java
│ │ │ └── SerializationException.java
│ │ │ ├── galaxy
│ │ │ ├── Client.java
│ │ │ ├── ConfigurationClient.java
│ │ │ ├── ConfigurationClientImpl.java
│ │ │ ├── DefaultWebResourceFactoryImpl.java
│ │ │ ├── GalaxyAuthWebResourceFactoryImpl.java
│ │ │ ├── GalaxyInstance.java
│ │ │ ├── GalaxyInstanceFactory.java
│ │ │ ├── GalaxyInstanceImpl.java
│ │ │ ├── GalaxyResponseException.java
│ │ │ ├── HistoriesClient.java
│ │ │ ├── HistoriesClientImpl.java
│ │ │ ├── JobsClient.java
│ │ │ ├── JobsClientImpl.java
│ │ │ ├── LibrariesClient.java
│ │ │ ├── LibrariesClientImpl.java
│ │ │ ├── RolesClient.java
│ │ │ ├── RolesClientImpl.java
│ │ │ ├── SearchClient.java
│ │ │ ├── SearchClientImpl.java
│ │ │ ├── SslHacking.java
│ │ │ ├── ToolDataClient.java
│ │ │ ├── ToolDataClientImpl.java
│ │ │ ├── ToolShedRepositoriesClient.java
│ │ │ ├── ToolShedRepositoriesClientImpl.java
│ │ │ ├── ToolsClient.java
│ │ │ ├── ToolsClientImpl.java
│ │ │ ├── UsersClient.java
│ │ │ ├── UsersClientImpl.java
│ │ │ ├── WebResourceFactory.java
│ │ │ ├── WorkflowsClient.java
│ │ │ ├── WorkflowsClientImpl.java
│ │ │ └── beans
│ │ │ │ ├── Dataset.java
│ │ │ │ ├── DirectoryLibraryUpload.java
│ │ │ │ ├── FileLibraryUpload.java
│ │ │ │ ├── FilesystemPathsLibraryUpload.java
│ │ │ │ ├── GalaxyObject.java
│ │ │ │ ├── HasGalaxyUrl.java
│ │ │ │ ├── History.java
│ │ │ │ ├── HistoryContents.java
│ │ │ │ ├── HistoryContentsProvenance.java
│ │ │ │ ├── HistoryDataset.java
│ │ │ │ ├── HistoryDeleteResponse.java
│ │ │ │ ├── HistoryDetails.java
│ │ │ │ ├── HistoryExport.java
│ │ │ │ ├── InstallableRepositoryRevision.java
│ │ │ │ ├── InstalledRepository.java
│ │ │ │ ├── Job.java
│ │ │ │ ├── JobDetails.java
│ │ │ │ ├── JobInputOutput.java
│ │ │ │ ├── Library.java
│ │ │ │ ├── LibraryContent.java
│ │ │ │ ├── LibraryDataset.java
│ │ │ │ ├── LibraryFolder.java
│ │ │ │ ├── LibraryPermissions.java
│ │ │ │ ├── LibraryUpload.java
│ │ │ │ ├── OutputDataset.java
│ │ │ │ ├── RepositoryInstall.java
│ │ │ │ ├── RepositoryWorkflow.java
│ │ │ │ ├── Role.java
│ │ │ │ ├── TabularToolDataTable.java
│ │ │ │ ├── Tool.java
│ │ │ │ ├── ToolExecution.java
│ │ │ │ ├── ToolInputs.java
│ │ │ │ ├── ToolParameter.java
│ │ │ │ ├── ToolSection.java
│ │ │ │ ├── UrlLibraryUpload.java
│ │ │ │ ├── User.java
│ │ │ │ ├── UserCreate.java
│ │ │ │ ├── Workflow.java
│ │ │ │ ├── WorkflowDetails.java
│ │ │ │ ├── WorkflowInputDefinition.java
│ │ │ │ ├── WorkflowInputs.java
│ │ │ │ ├── WorkflowInvocationInputs.java
│ │ │ │ ├── WorkflowInvocationOutputs.java
│ │ │ │ ├── WorkflowOutputs.java
│ │ │ │ ├── WorkflowStepDefinition.java
│ │ │ │ └── collection
│ │ │ │ ├── CollectionSource.java
│ │ │ │ ├── request
│ │ │ │ ├── AbstractElement.java
│ │ │ │ ├── CollectionDescription.java
│ │ │ │ ├── CollectionElement.java
│ │ │ │ ├── HistoryDatasetElement.java
│ │ │ │ └── SimpleElement.java
│ │ │ │ └── response
│ │ │ │ ├── CollectionElementResponse.java
│ │ │ │ ├── CollectionResponse.java
│ │ │ │ └── ElementResponse.java
│ │ │ ├── toolshed
│ │ │ ├── Client.java
│ │ │ ├── RepositoriesClient.java
│ │ │ ├── RepositoriesClientImpl.java
│ │ │ ├── RepositoryUtils.java
│ │ │ ├── ToolShedInstance.java
│ │ │ ├── ToolShedInstanceFactory.java
│ │ │ ├── ToolShedInstanceImpl.java
│ │ │ ├── ToolShedUtils.java
│ │ │ └── beans
│ │ │ │ ├── Repository.java
│ │ │ │ ├── RepositoryDetails.java
│ │ │ │ └── RepositoryRevision.java
│ │ │ └── util
│ │ │ ├── MoreObjects.java
│ │ │ ├── Objects.java
│ │ │ ├── Preconditions.java
│ │ │ └── package-info.java
│ └── javadoc
│ │ ├── overview.html
│ │ └── resources
│ │ └── syntaxhighlighterstyle.css
└── test
│ ├── java
│ └── com
│ │ └── github
│ │ └── jmchilton
│ │ └── blend4j
│ │ ├── galaxy
│ │ ├── ConfigurationTest.java
│ │ ├── Examples.java
│ │ ├── HistoriesTest.java
│ │ ├── IntegrationTest.java
│ │ ├── JobsTest.java
│ │ ├── LibrariesTest.java
│ │ ├── ObjectMapperTest.java
│ │ ├── SearchTest.java
│ │ ├── TestGalaxyInstance.java
│ │ ├── TestHelpers.java
│ │ ├── ToolDataTest.java
│ │ ├── ToolShedRepositoriesTest.java
│ │ ├── ToolsTest.java
│ │ ├── UserTest.java
│ │ └── WorkflowsTest.java
│ │ └── toolshed
│ │ └── RepositoriesClientTest.java
│ └── resources
│ ├── com
│ └── github
│ │ └── jmchilton
│ │ └── blend4j
│ │ └── galaxy
│ │ ├── TestWorkflow1.ga
│ │ ├── TestWorkflowCollectionList.ga
│ │ ├── TestWorkflowRandomlines.ga
│ │ ├── collection_list.xml
│ │ └── tool_conf_test.xml
│ └── log4j.properties
└── ssl
├── InstallCert$SavingTrustManager.class
├── InstallCert.class
├── InstallCert.java
└── SSLPoke.class
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | test-output
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | blend4j
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
3 | org.eclipse.jdt.core.compiler.compliance=1.5
4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5 | org.eclipse.jdt.core.compiler.source=1.5
6 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - openjdk8
4 | before_install:
5 | - sudo apt-get update -qq
6 | - sudo apt-get install -qq mercurial libsqlite3-dev python-dev python-virtualenv samtools bedtools
7 | install:
8 | - mvn -version
9 | - mvn clean package install -DskipTests -Dgpg.skip
10 | after_failure:
11 | - echo "Tests failed, dumping all logs."
12 | - cat /tmp/**/bootstrap-log/*
13 | script: travis_wait mvn test -B
14 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # blend4j changelog
2 |
3 | ## [0.2.1][021release] (Jan 22, 2020)
4 |
5 | - Added `invokeWorkflow` to `WorkflowsClient` to be used instead of `runWorkflow`.
6 | - Added updated `importWorkfow(String json, boolean publish)` to `WorkflowsClient` that should be used over the deprecated `importWorkflow(String json)`.
7 |
8 | ## [0.2.0][020release] (March 26, 2018)
9 |
10 | - Update to [galaxy-bootstrap 0.7.0][gxbootstrap070].
11 | - Added support for accessing Galaxy Tool Data tables. Thanks to Dan Fornika - .
12 | - blend4j now requires Java 1.8+ to run.
13 |
14 | [gxbootstrap070]: http://mvnrepository.com/artifact/com.github.jmchilton.galaxybootstrap/galaxybootstrap/0.7.0
15 | [020release]: http://mvnrepository.com/artifact/com.github.jmchilton.blend4j/blend4j/0.2.0
16 |
17 | ## [0.1.2][012release] (December 18, 2014)
18 |
19 | - Add ability to get information about a [library dataset][getlibrarydataset].
20 | - Update to [galaxy-bootstrap 0.5.0][gxbootstrap050] to account for recent Galaxy configuration changes.
21 | - Various bug fixes for recent API changes in Galaxy. [1][012bugfix1], [2][012bugfix2], [3][012bugfix3]
22 |
23 | [012release]: http://mvnrepository.com/artifact/com.github.jmchilton.blend4j/blend4j/0.1.2
24 | [getlibrarydataset]: https://github.com/jmchilton/blend4j/commit/e0bd2be2fc93530aa89744701dc96f0591d3894c
25 | [gxbootstrap050]: https://github.com/jmchilton/blend4j/commit/a9a87c3c0b93a2add1572932f39583106cb8c60c
26 | [012bugfix1]: https://github.com/jmchilton/blend4j/commit/f9a5a4bd32424f039ee90c9c1735bc5f90a38973
27 | [012bugfix2]: https://github.com/jmchilton/blend4j/commit/47de71cee239fa4feb975120828429fabac9b500
28 | [012bugfix3]: https://github.com/jmchilton/blend4j/commit/48ff545c1303a5b84b862afae98e6f7f49145d99
29 |
30 |
31 | ## [0.1.1][011release] (August 27, 2014)
32 |
33 | - Dataset collection support by @apetkau. Among other things the [histories client][historiesclient]
34 | can now [create][historiescollectioncreate] and [return][historiescollectionshow] information about collections and the [workflows client][workflowsclient] can [specify][workflowscollectioninput] dataset collections as inputs.
35 | - Documentation overhaul - [API documentation][apidocs] now available online.
36 | - Update tool shed client defaults to reflect the fact main tool shed is now being served over HTTPS.
37 | - Allow authentication with a [username and password][011changesetbasicauth]
38 | instead of an API key. In this case an API key will be generated automatically before the first API call and used for subsequent communication.
39 | - Introduce unified [exception handling][011changesetexceptionhandling].
40 | Hopefully this will allow clients to decouple exception handling from underlying framework.
41 | - [Improved logging options][011changesetfreekfixes] and [various][011changesetdocfixes1]
42 | [documentation][011changesetdocfixes2] and spelling corrections by @FreekDB.
43 | - Various testing improvements by @apetkau.
44 |
45 | [011release]: http://mvnrepository.com/artifact/com.github.jmchilton.blend4j/blend4j/0.1.1
46 | [011changesetdocfixes1]: https://github.com/jmchilton/blend4j/commit/58abbe03c2223e504ee90e83ffd5626b1afa6b85
47 | [011changesetdocfixes2]: https://github.com/jmchilton/blend4j/commit/3ae570820b4fdb4bad0914349913c909c048b4a7
48 | [011changesetfreekfixes]: https://github.com/jmchilton/blend4j/commit/22de9dd4cec55ca9a68abab2c48c8fa2cddd3a6c
49 | [011changesetexceptionhandling]: https://github.com/jmchilton/blend4j/commit/8e56c8b5adeebf4ce22e672bc16375dab513496b
50 | [011changesetbasicauth]: https://github.com/jmchilton/blend4j/commit/f92909fbda3616da09614b65810ebd86ce496b19
51 | [historiescollectionshow]: http://jmchilton.github.io/blend4j/apidocs/com/github/jmchilton/blend4j/galaxy/HistoriesClient.html#showDatasetCollection(java.lang.String%2C%20java.lang.String)
52 | [historiescollectioncreate]: http://jmchilton.github.io/blend4j/apidocs/com/github/jmchilton/blend4j/galaxy/HistoriesClient.html#createDatasetCollection(java.lang.String%2C%20com.github.jmchilton.blend4j.galaxy.beans.collection.request.CollectionDescription)
53 | [workflowscollectioninput]: http://jmchilton.github.io/blend4j/apidocs/com/github/jmchilton/blend4j/galaxy/beans/WorkflowInputs.InputSourceType.html
54 |
55 | ## [0.1.0][010release] (May 08, 2014)
56 |
57 | - Parse more information from dataset provenance API calls (job id, standard error, and standard output). [changeset][010changesetprov]
58 | - Parse [more][010changesetcontents1] [information][010changesetcontents2] from dataset contents API calls (purged, hid, history content type, state, dataset info, blurb).
59 | - Bugfixes for importing workflows from an installed tool shed repository.
60 | - Various testing and logging improvements.
61 |
62 | [010release]: http://mvnrepository.com/artifact/com.github.jmchilton.blend4j/blend4j/0.1.0
63 | [010changesetprov]: https://github.com/jmchilton/blend4j/commit/d253bfc51ad8b7a9e19d1b9956d1f5ad97cfbc53
64 | [010changesetcontents1]: https://github.com/jmchilton/blend4j/commit/82717441b4d9015c38170b1231298c95630c62ee
65 | [010changesetcontents2]: https://github.com/jmchilton/blend4j/commit/76d004d59c54799fa4d10473e360158169e65b08
66 |
67 | ## [0.1-alpha-8][010alpha8release] (Apr 10, 2014)
68 |
69 | - Allow setting more [workflow parameters][010alpha8changesetworkflowparams] by steps instead of tool and allow setting multiple parameters per tool/step.
70 | - Parse more [details][010alpha8changesetworkflowdetails] during workflow detail API calls (e.g. owner, deleted, published, and step information).
71 | - Various small test fixes.
72 |
73 | [010alpha8release]: http://mvnrepository.com/artifact/com.github.jmchilton.blend4j/blend4j/0.1-alpha-8
74 | [010alpha8changesetworkflowparams]: https://github.com/jmchilton/blend4j/commit/4f9f8b710bcc715159b5d71a2691e33df77e0c25
75 | [010alpha8changesetworkflowdetails]: https://github.com/jmchilton/blend4j/commit/26d65c704292c2eb70b9500d45373277fdf5e340
76 |
77 | [apidocs]: http://jmchilton.github.io/blend4j/apidocs/
78 | [workflowsclient]: http://jmchilton.github.io/blend4j/apidocs/com/github/jmchilton/blend4j/galaxy/WorkflowsClient.html
79 | [historiesclient]: http://jmchilton.github.io/blend4j/apidocs/com/github/jmchilton/blend4j/galaxy/HistoriesClient.html
80 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://travis-ci.org/galaxyproject/blend4j)
2 |
3 | # About
4 |
5 | blend4j is a partial reimplementation of the Python library [bioblend][1]
6 | for the JVM. bioblend for Python is a library for scripting interactions
7 | with Galaxy, CloudMan, and BioCloudCentral.
8 |
9 | [1]: https://github.com/afgane/bioblend
10 |
11 | # Usage
12 |
13 | blend4j's [JavaDocs][api] contain some quick usage examples. Many more
14 | examples can be found in [Aaron Petkau][apetkau]'s [blend4j tutorials][tutorial]
15 | and the [integration tests][tests]. Examples of using
16 | blend4j in larger open source projects include [Molgenis integration][molgensis] by [Dennis Hendriksen][dennishendriksen] and the
17 | [TraIT Workflow Runner][trait] for use with
18 | [tranSMART][transmart] by [Freek de Bruijn][freekdb].
19 |
20 | blend4j requires Java 8+ to function.
21 |
22 | [api]: http://galaxyproject.github.io/blend4j/apidocs/
23 | [tutorial]: https://github.com/apetkau/blend4j-tutorials
24 | [tests]: https://github.com/jmchilton/blend4j/tree/master/src/test/java/com/github/jmchilton/blend4j/galaxy
25 | [molgensis]: https://github.com/molgenis/molgenis/commit/57d229a8d36fa9dae1155685e85187399863057f
26 | [transmart]: https://github.com/transmart
27 | [trait]: https://github.com/CTMM-TraIT/trait_workflow_runner
28 | [apetkau]: https://github.com/apetkau
29 | [freekdb]: https://github.com/freekdb
30 | [dennishendriksen]: https://github.com/dennishendriksen
31 |
32 | # Building
33 |
34 | blend4j can be built with [Apache Maven][b1].
35 |
36 | % git clone git://github.com/galaxyproject/blend4j.git
37 | % cd blend4j
38 | % mvn compile
39 |
40 | # Testing
41 |
42 | [](https://travis-ci.org/galaxyproject/blend4j)
43 |
44 | blend4j can be tested with [Apache Maven][b1].
45 |
46 | % mvn test
47 |
48 | In this default mode, blend4j will use the [galaxy-bootstrap][t1] library to download, configure,
49 | and run an instance of Galaxy for testing (requiring an Internet connection). blend4j can be tested against an existing instance using the following Java system properties.
50 |
51 | % mvn -Dtest.galaxy.key= -Dtest.galaxy.instance= test
52 |
53 | The above example will run a variety of tests and make various assumptions - some which may not be true for the supplied API key. Maven can be configured to run [a specific test or tests][t2].
54 |
55 | [b1]: http://maven.apache.org/
56 | [t1]: https://github.com/jmchilton/galaxy-bootstrap
57 | [t2]: http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
58 |
59 | # Jars
60 |
61 | The easiest way to obtain blend4j is using Maven Central.
62 |
63 | For instance, if a project is using Maven, a blend4j dependency can be added by
64 | adding the following to the dependencies section of the project's pom.xml file.
65 |
66 | ```xml
67 |
68 | com.github.jmchilton.blend4j
69 | blend4j
70 | 0.2.0
71 |
72 | ```
73 |
74 | Similar dependencies can be specified if using Ivy, Grape, Gradle, Buildr, or SBT.
75 | See [mvnrepository][d1] for more details.
76 |
77 |
78 | The latest blend4j jars can be downloaded from the [Maven Central Repository][d0].
79 |
80 | [d0]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.jmchilton.blend4j%22
81 | [d1]: http://mvnrepository.com/artifact/com.github.jmchilton.blend4j/blend4j/
82 |
83 | # License
84 |
85 | The code is freely available under the [Apache License Version 2.0][l1].
86 |
87 | [l1]: http://www.apache.org/licenses/LICENSE-2.0.html
88 |
89 |
--------------------------------------------------------------------------------
/release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | read -s -p "GPG Password: " gpgpass
4 | mvn_args="-Dgpg.passphrase=$gpgpass -DskipTests=true -DperformRelease=true"
5 |
6 | mvn $mvn_args release:clean
7 |
8 | mvn $mvn_args release:prepare
9 |
10 | mvn $mvn_args release:perform
11 |
12 | echo "Artifacts staged, must be released by visiting: https://oss.sonatype.org/, closing staging repository, and then releasing."
13 |
--------------------------------------------------------------------------------
/src/main/java/com/github/jmchilton/blend4j/Config.java:
--------------------------------------------------------------------------------
1 | package com.github.jmchilton.blend4j;
2 |
3 | import java.io.File;
4 | import java.io.FileInputStream;
5 | import java.io.IOException;
6 | import java.util.Properties;
7 |
8 | public class Config {
9 | public static Properties loadBlendProperties() {
10 | final Properties properties = new Properties();
11 | final File blendPropertiesFile = getBlendPropertiesFile();
12 | if(blendPropertiesFile != null) {
13 | FileInputStream fileInputStream = null;
14 | try {
15 | fileInputStream = new FileInputStream(blendPropertiesFile);
16 | properties.load(fileInputStream);
17 | } catch(IOException e) {
18 | e.printStackTrace();
19 | } finally {
20 | try {
21 | if(fileInputStream != null) {
22 | fileInputStream.close();
23 | }
24 | } catch(IOException e) {
25 | e.printStackTrace();
26 | }
27 | }
28 | }
29 | return properties;
30 | }
31 |
32 | private static File getBlendPropertiesFile() {
33 | final String homeDir = System.getProperty("user.home");
34 | File blendPropertiesFile = new File(homeDir, ".blend.properties");
35 | if(!blendPropertiesFile.exists()) {
36 | blendPropertiesFile = null;
37 | }
38 | return blendPropertiesFile;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/com/github/jmchilton/blend4j/exceptions/ApiException.java:
--------------------------------------------------------------------------------
1 | package com.github.jmchilton.blend4j.exceptions;
2 |
3 | /**
4 | * Base class for all API, communication, or serialization related
5 | * exceptions in blend4j. The idea is to provide an consistent interface
6 | * and shield dependent projects from having to have explicit source code
7 | * dependencies on Jersey and Jackson.
8 | *
9 | */
10 | public class ApiException extends RuntimeException {
11 |
12 | public ApiException() {
13 | super();
14 | }
15 |
16 | public ApiException(final Exception exception) {
17 | super(exception);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/github/jmchilton/blend4j/exceptions/ResponseException.java:
--------------------------------------------------------------------------------
1 | package com.github.jmchilton.blend4j.exceptions;
2 |
3 | import com.github.jmchilton.blend4j.util.MoreObjects;
4 | import com.sun.jersey.api.client.ClientResponse;
5 |
6 | public class ResponseException extends ApiException {
7 | private final Integer statusCode;
8 | private final String rawResponse;
9 |
10 | public ResponseException(final ClientResponse clientResponse) {
11 | super();
12 | this.statusCode = clientResponse.getStatus();
13 | this.rawResponse = clientResponse.getEntity(String.class);
14 | }
15 |
16 | protected MoreObjects.ToStringHelper toStringHelper() {
17 | return MoreObjects
18 | .toStringHelper(getClass())
19 | .add("status", statusCode)
20 | .add("responseBody", rawResponse);
21 |
22 | }
23 |
24 | @Override
25 | public String toString() {
26 | return toStringHelper().toString();
27 | }
28 |
29 | public String getResponseBody() {
30 | return rawResponse;
31 | }
32 |
33 | public Integer getStatusCode() {
34 | return statusCode;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/github/jmchilton/blend4j/exceptions/SerializationException.java:
--------------------------------------------------------------------------------
1 | package com.github.jmchilton.blend4j.exceptions;
2 |
3 | public class SerializationException extends ApiException {
4 |
5 | public SerializationException() {
6 | }
7 |
8 | public SerializationException(Exception exception) {
9 | super(exception);
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/github/jmchilton/blend4j/galaxy/Client.java:
--------------------------------------------------------------------------------
1 | package com.github.jmchilton.blend4j.galaxy;
2 |
3 | import com.github.jmchilton.blend4j.BaseClient;
4 | import com.github.jmchilton.blend4j.exceptions.ResponseException;
5 | import com.github.jmchilton.blend4j.galaxy.beans.HasGalaxyUrl;
6 | import com.sun.jersey.api.client.ClientResponse;
7 |
8 | class Client extends BaseClient {
9 | private final GalaxyInstanceImpl galaxyInstance;
10 |
11 | Client(final GalaxyInstanceImpl galaxyInstance, final String module) {
12 | super(galaxyInstance.getWebResource(), module);
13 | this.galaxyInstance = galaxyInstance;
14 | }
15 |
16 | @Override
17 | protected ResponseException buildResponseException(final ClientResponse clientResponse) {
18 | final ResponseException exception = new GalaxyResponseException(clientResponse);
19 | return exception;
20 | }
21 |
22 | GalaxyInstance getGalaxyInstance() {
23 | return galaxyInstance;
24 | }
25 |
26 | protected T setGalaxyUrl(final T bean) {
27 | bean.setGalaxyUrl(galaxyInstance.getGalaxyUrl());
28 | bean.setApiKey(galaxyInstance.getApiKey());
29 | return bean;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/github/jmchilton/blend4j/galaxy/ConfigurationClient.java:
--------------------------------------------------------------------------------
1 | package com.github.jmchilton.blend4j.galaxy;
2 |
3 | import java.util.Map;
4 |
5 | public interface ConfigurationClient {
6 |
7 | Map getRawConfiguration();
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/com/github/jmchilton/blend4j/galaxy/ConfigurationClientImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.jmchilton.blend4j.galaxy;
2 |
3 | import java.util.Map;
4 | import org.codehaus.jackson.type.TypeReference;
5 |
6 | class ConfigurationClientImpl extends Client implements ConfigurationClient {
7 |
8 | ConfigurationClientImpl(GalaxyInstanceImpl galaxyInstance) {
9 | super(galaxyInstance, "configuration");
10 | }
11 |
12 | public Map getRawConfiguration() {
13 | final String json = getJson(getWebResource());
14 | return readJson(json, new TypeReference