├── .gitignore ├── .mvn └── maven.config ├── .project ├── .settings ├── org.eclipse.core.resources.prefs └── org.eclipse.core.runtime.prefs ├── Jenkinsfile ├── LICENSE ├── LICENSE_HEADER ├── README.md ├── distribution-templates ├── pom.xml └── src │ ├── main │ └── resources │ │ ├── LICENSE │ │ └── assemblies │ │ └── tomcat-distribution.xml │ └── server │ ├── assembly │ └── tomcat-master.xml │ └── resources │ ├── catalina.policy │ ├── favicon.ico │ ├── rsb.bat │ ├── rsb.sh │ ├── tomcat-users.xml │ └── webapps │ └── log4j2.xml ├── it-rpooli ├── pom.xml └── src │ └── config │ └── rconfig.properties ├── kubernetesPod.yaml ├── pom.xml ├── rsb-ldap └── pom.xml └── rsb ├── .classpath ├── .gitignore ├── .project ├── .settings ├── org.eclipse.core.resources.prefs ├── org.eclipse.core.runtime.prefs ├── org.eclipse.jdt.core.prefs └── org.eclipse.jdt.ui.prefs ├── LICENSE ├── enunciate.xml ├── pom.xml └── src ├── it ├── config │ ├── rsb-it-soapui-project.xml │ └── rsb-it-soapui-settings.xml ├── java │ └── eu │ │ └── openanalytics │ │ └── rsb │ │ ├── AbstractITCase.java │ │ ├── ConfiguredDirectoryDepositITCase.java │ │ ├── DirectoryDepositITCase.java │ │ ├── EmailDepositITCase.java │ │ ├── RestAdminITCase.java │ │ ├── RestJobsITCase.java │ │ ├── RestMiscITCase.java │ │ ├── RestProcessITCase.java │ │ ├── SoapMtomITCase.java │ │ └── SuiteITCase.java └── resources │ ├── log4j.xml │ ├── override-web.xml │ └── rsb-configuration-it.json ├── main ├── java │ └── eu │ │ └── openanalytics │ │ └── rsb │ │ ├── Constants.java │ │ ├── Util.java │ │ ├── component │ │ ├── AbstractComponent.java │ │ ├── AbstractComponentWithCatalog.java │ │ ├── AbstractResource.java │ │ ├── AdminResource.java │ │ ├── DataDirectoriesResource.java │ │ ├── DirectoryDepositHandler.java │ │ ├── DlqHandler.java │ │ ├── EmailDepositHandler.java │ │ ├── HandlerUtils.java │ │ ├── JobProcessor.java │ │ ├── JobsResource.java │ │ ├── ProcessResource.java │ │ ├── RestResultProcessor.java │ │ ├── ResultResource.java │ │ ├── ResultsResource.java │ │ ├── SoapMtomJobHandler.java │ │ ├── SystemHealthResource.java │ │ └── package-info.java │ │ ├── config │ │ ├── BootstrapConfigurationServletContextListener.java │ │ ├── Configuration.java │ │ ├── ConfigurationFactory.java │ │ ├── PersistedConfiguration.java │ │ ├── PersistedConfigurationAdapter.java │ │ ├── RServiEnvironmentServletContextListener.java │ │ ├── RServiPoolConfig.java │ │ └── SpringContextEventListener.java │ │ ├── data │ │ ├── CatalogManager.java │ │ ├── FileCatalogManager.java │ │ ├── FileResultStore.java │ │ ├── PersistedResult.java │ │ ├── ResultStore.java │ │ ├── SecureResultStore.java │ │ └── SecureResultStoreAdapter.java │ │ ├── jaxrs │ │ ├── AccessDeniedExceptionMapper.java │ │ ├── IllegalArgumentExceptionMapper.java │ │ ├── ThrowableExceptionMapper.java │ │ └── WebApplicationExceptionMapper.java │ │ ├── message │ │ ├── AbstractFunctionCallJob.java │ │ ├── AbstractFunctionCallResult.java │ │ ├── AbstractJob.java │ │ ├── AbstractResult.java │ │ ├── AbstractWorkItem.java │ │ ├── IllegalJobDataException.java │ │ ├── JmsMessageDispatcher.java │ │ ├── Job.java │ │ ├── JsonFunctionCallJob.java │ │ ├── JsonFunctionCallResult.java │ │ ├── MessageDispatcher.java │ │ ├── MultiFilesJob.java │ │ ├── MultiFilesResult.java │ │ ├── Result.java │ │ ├── WorkItem.java │ │ ├── XmlFunctionCallJob.java │ │ └── XmlFunctionCallResult.java │ │ ├── rservi │ │ ├── CircularRServiUriSelector.java │ │ ├── DefaultRServiPackageManager.java │ │ ├── ErrorableRServi.java │ │ ├── RServiInstanceProvider.java │ │ ├── RServiPackageManager.java │ │ ├── RServiUriSelector.java │ │ └── RmiRServiInstanceProvider.java │ │ ├── security │ │ ├── ApplicationPermissionEvaluator.java │ │ ├── IdentifiedUserDetailsService.java │ │ ├── JmxSecurityAuthenticator.java │ │ ├── SecurableMx4JHttpAdaptor.java │ │ └── X509AuthenticationFilter.java │ │ ├── si │ │ ├── BasicFileLocker.java │ │ ├── HeaderSettingMessageSourceWrapper.java │ │ └── MinimumAgeFileListFilter.java │ │ └── stats │ │ ├── JobStatisticsHandler.java │ │ ├── JobStatisticsHandlerFactory.java │ │ ├── NoopJobStatisticsHandler.java │ │ └── RedisJobStatisticsHandler.java ├── resources │ ├── META-INF │ │ └── spring │ │ │ ├── activemq-beans.xml │ │ │ ├── core-beans.xml │ │ │ ├── cxf-beans.xml │ │ │ ├── integration-beans.xml │ │ │ ├── jms-beans.xml │ │ │ ├── jmx-beans.xml │ │ │ └── security-beans.xml │ ├── log4j2.xml │ ├── messages.properties │ ├── schemas │ │ ├── common.xsd │ │ ├── rest-types.xsd │ │ └── soap-types.xsd │ └── wsdl │ │ └── mtom-jobs.wsdl └── webapp │ ├── WEB-INF │ └── web.xml │ ├── admin │ └── file-browser.jsp │ ├── css │ ├── blackbird.css │ ├── blackbird_icons.png │ ├── blackbird_panel.png │ ├── images │ │ ├── open_analytics_logo.png │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ └── ui-icons_888888_256x240.png │ ├── jquery-ui-1.8.custom.css │ ├── jstree-classic │ │ ├── d.gif │ │ ├── d.png │ │ ├── dot_for_ie.gif │ │ ├── style.css │ │ └── throbber.gif │ ├── openid.css │ ├── rsb.css │ └── ui.panel.css │ ├── favicon.ico │ ├── fragments │ └── default-upload-form.html │ ├── images │ ├── delete.png │ ├── directory.png │ ├── download.gif │ ├── drive.png │ ├── failure.png │ ├── file.png │ ├── network.png │ ├── openid-providers-en.png │ └── success.gif │ ├── index.html │ ├── js │ ├── blackbird.js │ ├── date.js │ ├── jquery-3.7.1.min.js │ ├── jquery-ui-1.8.custom.min.js │ ├── jquery.MultiFile-1.47.js │ ├── jquery.ba-dotimeout.min.js │ ├── jquery.form-4.3.0.js │ ├── jquery.jstree-3.3.15.js │ ├── jquery.validate-1.19.5.min.js │ ├── openid-en-1.3.js │ ├── openid-jquery-1.3.js │ ├── rsb.js │ └── ui.panel.min.js │ ├── login.html │ ├── logout.html │ ├── openid.html │ └── rsb.html ├── site ├── enunciate │ ├── wsdocs.css │ └── wsdocs.xsl ├── resources │ ├── css │ │ └── site.css │ ├── favicon.ico │ ├── images │ │ ├── Rservice-diagram.png │ │ ├── job_workers_app_bias.png │ │ ├── job_workers_app_bias.svg │ │ ├── job_workers_default.png │ │ ├── job_workers_default.svg │ │ ├── openanalytics-logo.png │ │ ├── rsb-architecture.graphml │ │ ├── rsb-architecture.png │ │ └── wieni │ │ │ ├── banner-bg.png │ │ │ ├── banner.png │ │ │ ├── body-bg.png │ │ │ ├── content-bg.png │ │ │ ├── sidebar-bg.png │ │ │ └── sidebar-block.png │ └── js │ │ └── jquery-3.7.1.min.js ├── site.xml └── xdoc │ ├── admin.xml │ ├── api-specs.xml │ ├── architecture.xml │ ├── build.xml │ ├── ha.xml │ ├── index.xml │ ├── install.xml │ ├── scalability.xml │ ├── security.xml │ ├── stats.xml │ └── upgrade.xml └── test ├── java └── eu │ └── openanalytics │ └── rsb │ ├── UtilTestCase.java │ ├── component │ ├── AdminResourceTestCase.java │ ├── AuthenticatedResultResourceTestCase.java │ ├── DataDirectoriesResourceTestCase.java │ ├── DirectoryDepositHandlerTestCase.java │ ├── DlqHandlerTestCase.java │ ├── EmailDepositHandlerTestCase.java │ ├── JobProcessorTestCase.java │ ├── JobsResourceTestCase.java │ ├── ProcessResourceTestCase.java │ ├── RestResultProcessorTestCase.java │ ├── ResultResourceTestCase.java │ ├── ResultsResourceTestCase.java │ ├── SoapMtomJobHandlerTestCase.java │ └── SystemHealthResourceTestCase.java │ ├── config │ ├── BootstrapConfigurationServletContextListenerTestCase.java │ └── ConfigurationFactoryTestCase.java │ ├── jaxrs │ └── IllegalArgumentExceptionMapperTestCase.java │ ├── message │ ├── JmsMessageDispatcherTestCase.java │ ├── JsonFunctionCallJobTestCase.java │ ├── MessageSerializationTest.java │ └── XmlFunctionCallJobTestCase.java │ ├── rservi │ └── CircularRServiUriSelectorTestCase.java │ ├── security │ └── IdentifiedUserDetailsServiceTestCase.java │ ├── si │ ├── HeaderSettingMessageSourceWrapperTestCase.java │ └── MinimumAgeFileListFilterTestCase.java │ └── test │ ├── ComparisonFailureWithDetail.java │ └── TestUtils.java └── resources ├── data ├── fake-package.tar.gz ├── fake_data.dat ├── invalid-job-subdir.zip ├── r-job-catalog-ref.zip ├── r-job-data-only.zip ├── r-job-meta-required-lc.zip ├── r-job-meta-required.zip ├── r-job-sample.json ├── r-job-sample.xml ├── r-job-sample.zip ├── test-configuration.txt ├── test-email-response.txt ├── test.R ├── testSweave.R └── testSweave.Rnw ├── rsb-configuration-default.json ├── rsb-configuration-extended.json ├── rsb-configuration-full.json ├── rsb-configuration-minimal.json ├── rsb-configuration-pooling.json ├── rsb-configuration-redis.json ├── rsb-configuration.json └── sertest ├── MultiFilesJob-6.4-1.ser └── MultiFilesResult-6.4-1.ser /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Daether.checksums.algorithms=SHA-256,SHA-1,MD5 2 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | eu.openanalytics.rsb 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | String packageProfiles= 'javax-dependencies,ldap,tomcat-distribution'; 2 | 3 | pipeline { 4 | 5 | agent { 6 | kubernetes { 7 | yamlFile 'kubernetesPod.yaml' 8 | defaultContainer 'rpooli-build' 9 | } 10 | } 11 | 12 | options { 13 | authorizationMatrix(['hudson.model.Item.Build:rsb', 'hudson.model.Item.Read:rsb']) 14 | buildDiscarder(logRotator(numToKeepStr: '10')) 15 | } 16 | 17 | stages { 18 | 19 | stage('build + deploy artifacts') { 20 | steps { 21 | configFileProvider([configFile(fileId: 'maven-settings-rsb', variable: 'MAVEN_SETTINGS_RSB')]) { 22 | sh "mvn package deploy\ 23 | -P ${packageProfiles}\ 24 | --batch-mode -s $MAVEN_SETTINGS_RSB\ 25 | -Dmaven.test.failure.ignore=true" 26 | } 27 | } 28 | } 29 | 30 | stage('generate + deploy site') { 31 | steps { 32 | configFileProvider([configFile(fileId: 'maven-settings-rsb', variable: 'MAVEN_SETTINGS_RSB')]) { 33 | sh "mvn -f rsb/ site-deploy\ 34 | -P ${packageProfiles}\ 35 | --batch-mode -s $MAVEN_SETTINGS_RSB" 36 | } 37 | } 38 | } 39 | 40 | stage('run integration tests') { 41 | steps { 42 | sh "export JENKINS_NODE_COOKIE=dontKillMe R_HOME=/usr/lib/R &&\ 43 | mvn -f it-rpooli/ jetty:run-war\ 44 | --batch-mode > it-rpooli/jetty-rpooli.out 2>&1 &" 45 | sh "sleep 2 && curl --retry 60 --retry-delay 1 --retry-connrefused --output /dev/null\ 46 | http://127.0.0.1:8889/rpooli/" 47 | 48 | sh "mvn verify -P it,javax-dependencies\ 49 | --batch-mode\ 50 | -Dmaven.test.failure.ignore=true" 51 | 52 | sh "mvn -f it-rpooli/ jetty:stop\ 53 | --batch-mode" 54 | } 55 | } 56 | 57 | } 58 | 59 | post { 60 | always { 61 | archiveArtifacts( 62 | artifacts: '**/target/dependency-*.txt', 63 | fingerprint: true ) 64 | 65 | junit '**/target/surefire-reports/*.xml' 66 | junit '**/target/failsafe-reports/*.xml' 67 | archiveArtifacts artifacts: 'it-rpooli/*.out' 68 | } 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | R Service Bus 2 | 3 | Copyright (c) Copyright of Open Analytics NV, 2010-2023 4 | 5 | =========================================================================== 6 | 7 | This file is part of R Service Bus. 8 | 9 | R Service Bus is free software: you can redistribute it and/or modify 10 | it under the terms of the Apache License as published by 11 | The Apache Software Foundation, either version 2 of the License, or 12 | (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | Apache License for more details. 18 | 19 | You should have received a copy of the Apache License 20 | along with R Service Bus. If not, see . 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
 2 | ____________________________
 3 |     ____       __     ____  
 4 |     /    )   /    )   /   ) 
 5 | ---/___ /----\-------/__ /--
 6 |   /    |      \     /    )  
 7 | _/_____|__(____/___/____/___
 8 |                             
 9 | 
10 | 11 | # RSB (R Service Bus) 12 | 13 | Browse the [RSB online Documentation](https://rservicebus.io). 14 | 15 | #### Copyright (c) Copyright of Open Analytics NV, 2010-2023 16 | 17 | Licensed under the [Apache License 2.0](https://opensource.org/licenses/Apache-2.0) 18 | -------------------------------------------------------------------------------- /distribution-templates/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 28 | 4.0.0 29 | 30 | eu.openanalytics.rsb 31 | rsb-parent 32 | 6.9.1-SNAPSHOT 33 | 34 | 35 | rsb-distribution-templates 36 | 37 | R Service Bus - Distribution Templates 38 | 39 | 40 | true 41 | 42 | 43 | 44 | 45 | tomcat-distribution 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-dependency-plugin 51 | 52 | 53 | tomcat-dependencies 54 | process-sources 55 | 56 | unpack 57 | 58 | 59 | 60 | 61 | org.apache.tomcat 62 | tomcat 63 | ${tomcat.version} 64 | zip 65 | false 66 | ${project.build.directory}/ 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | org.apache.maven.plugins 75 | maven-assembly-plugin 76 | 77 | 78 | package 79 | 80 | single 81 | 82 | 83 | 84 | 85 | 86 | src/server/assembly/tomcat-master.xml 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /distribution-templates/src/main/resources/assemblies/tomcat-distribution.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 29 | 30 | tomcat-distribution 31 | 32 | zip 33 | 34 | 35 | 36 | ${project.build.directory}/tomcat-master 37 | 38 | / 39 | 40 | bin/*.sh 41 | 42 | 0644 43 | 44 | 45 | ${project.build.directory}/tomcat-master 46 | / 47 | 48 | bin/*.sh 49 | 50 | 0744 51 | 52 | 53 | ${project.build.directory}/rpooli 54 | /webapps/rpooli 55 | 56 | **/log4j2.xml 57 | 58 | 0644 59 | 60 | 61 | 62 | 63 | 64 | /webapps/rsb 65 | 66 | ${project.groupId}:${project.artifactId} 67 | 68 | true 69 | 70 | 71 | **/log4j2.xml 72 | 73 | 74 | 0644 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /distribution-templates/src/server/resources/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/distribution-templates/src/server/resources/favicon.ico -------------------------------------------------------------------------------- /distribution-templates/src/server/resources/rsb.bat: -------------------------------------------------------------------------------- 1 | @REM 2 | @REM R Service Bus 3 | @REM 4 | @REM Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | @REM 6 | @REM =========================================================================== 7 | @REM 8 | @REM This file is part of R Service Bus. 9 | @REM 10 | @REM R Service Bus is free software: you can redistribute it and/or modify 11 | @REM it under the terms of the Apache License as published by 12 | @REM The Apache Software Foundation, either version 2 of the License, or 13 | @REM (at your option) any later version. 14 | @REM 15 | @REM This program is distributed in the hope that it will be useful, 16 | @REM but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | @REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | @REM Apache License for more details. 19 | @REM 20 | @REM You should have received a copy of the Apache License 21 | @REM along with R Service Bus. If not, see . 22 | @REM 23 | @REM @author rsb.development@openanalytics.eu 24 | @REM 25 | 26 | if not "%R_HOME%" == "" goto okRHome 27 | echo "R_HOME not set" 28 | goto end 29 | 30 | :okRHome 31 | if not "%R_LIBS%" == "" goto okRLibs 32 | echo "R_LIBS not set" 33 | goto end 34 | 35 | :okRLibs 36 | echo Using R_HOME: "%R_HOME%" 37 | echo Using R_LIBS: "%R_LIBS%" 38 | 39 | set "CURRENT_DIR=%cd%" 40 | set "EXECUTABLE=%CURRENT_DIR%\startup.bat" 41 | call "%EXECUTABLE%" %CMD_LINE_ARGS% 42 | 43 | :end 44 | 45 | -------------------------------------------------------------------------------- /distribution-templates/src/server/resources/rsb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # R Service Bus 5 | # 6 | # Copyright (c) Copyright of Open Analytics NV, 2010-2023 7 | # 8 | # =========================================================================== 9 | # 10 | # This file is part of R Service Bus. 11 | # 12 | # R Service Bus is free software: you can redistribute it and/or modify 13 | # it under the terms of the Apache License as published by 14 | # The Apache Software Foundation, either version 2 of the License, or 15 | # (at your option) any later version. 16 | # 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # Apache License for more details. 21 | # 22 | # You should have received a copy of the Apache License 23 | # along with R Service Bus. If not, see . 24 | # 25 | # @author rsb.development@openanalytics.eu 26 | # 27 | 28 | # Check mandatory system properties 29 | if [ -z "$R_HOME" ]; then 30 | echo "R_HOME not set" 31 | exit 1 32 | fi 33 | 34 | if [ -z "$R_LIBS" ]; then 35 | echo "R_LIBS not set" 36 | exit 1 37 | fi 38 | 39 | echo "Using R_HOME: $R_HOME" 40 | echo "Using R_LIBS: $R_LIBS" 41 | 42 | PRGDIR=`dirname "$0"` 43 | RSB_WEBAPP_PATH="$PRGDIR"/../webapps/rsb 44 | 45 | # Copy security files from /etc/rsb 46 | SRC_FILE=/etc/rsb/security-beans.xml 47 | DST_FILE="$RSB_WEBAPP_PATH"/WEB-INF/classes/META-INF/spring 48 | if [ -f $SRC_FILE ] 49 | then 50 | echo "Copying $SRC_FILE to $DST_FILE" 51 | cp $SRC_FILE $DST_FILE 52 | fi 53 | 54 | SRC_FILE=/etc/rsb/web.xml 55 | DST_FILE="$RSB_WEBAPP_PATH"/WEB-INF 56 | if [ -f $SRC_FILE ] 57 | then 58 | echo "Copying $SRC_FILE to $DST_FILE" 59 | cp $SRC_FILE $DST_FILE 60 | fi 61 | 62 | # Start Tomcat 63 | exec "$PRGDIR"/startup.sh "$@" 64 | -------------------------------------------------------------------------------- /distribution-templates/src/server/resources/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /distribution-templates/src/server/resources/webapps/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /it-rpooli/src/config/rconfig.properties: -------------------------------------------------------------------------------- 1 | r_home.path=/usr/lib/R 2 | r_startup.snippet=library(RSBXml)\nlibrary(RSBJson) 3 | -------------------------------------------------------------------------------- /kubernetesPod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | labels: 5 | ci: rsb-public-build 6 | spec: 7 | containers: 8 | - name: rpooli-build 9 | image: registry.openanalytics.eu/openanalytics/rpooli-build:J-11_R-4.1 10 | resources: 11 | requests: 12 | memory: "2Gi" 13 | cpu: "1000m" 14 | limits: 15 | memory: "2Gi" 16 | cpu: "2000m" 17 | command: 18 | - cat 19 | tty: true 20 | -------------------------------------------------------------------------------- /rsb/.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 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /rsb/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /rsb/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | eu.openanalytics.rsb-rsb 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 | -------------------------------------------------------------------------------- /rsb/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/it/java=UTF-8 3 | encoding//src/it/resources=UTF-8 4 | encoding//src/main/java=UTF-8 5 | encoding//src/main/resources=UTF-8 6 | encoding//src/test/java=UTF-8 7 | encoding//src/test/resources=UTF-8 8 | encoding//target/generated-sources/cxf=UTF-8 9 | encoding//target/generated-sources/xjc=UTF-8 10 | encoding/=UTF-8 11 | -------------------------------------------------------------------------------- /rsb/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /rsb/enunciate.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 29 | 30 | R Service Bus API 31 | 32 | Open Analytics NV, 2010-2023 33 | 34 | 35 | 38 | 41 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /rsb/src/it/config/rsb-it-soapui-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | true 3 | true 4 | -------------------------------------------------------------------------------- /rsb/src/it/java/eu/openanalytics/rsb/ConfiguredDirectoryDepositITCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb; 25 | 26 | import java.io.IOException; 27 | 28 | import org.junit.Test; 29 | 30 | 31 | /** 32 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 33 | */ 34 | public class ConfiguredDirectoryDepositITCase extends DirectoryDepositITCase 35 | { 36 | @Override 37 | protected String getApplicationName() 38 | { 39 | return "lab2"; 40 | } 41 | 42 | @Override 43 | @Test 44 | public void dataOnlyZipDeposit() throws IOException, InterruptedException 45 | { 46 | doTestValidZipDeposit("r-job-data-only.zip"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /rsb/src/it/java/eu/openanalytics/rsb/SoapMtomITCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb; 25 | 26 | import static org.junit.Assert.assertTrue; 27 | 28 | import com.eviware.soapui.tools.SoapUITestCaseRunner; 29 | import org.junit.Test; 30 | 31 | 32 | /** 33 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 34 | */ 35 | public class SoapMtomITCase extends AbstractITCase { 36 | 37 | 38 | @Test 39 | public void soapMtomJobsApi() throws Exception { 40 | final SoapUITestCaseRunner runner= new SoapUITestCaseRunner("RSB SOAP MTOM Integration Tests"); 41 | runner.setSettingsFile("src/it/config/rsb-it-soapui-settings.xml"); 42 | runner.setProjectFile("src/it/config/rsb-it-soapui-project.xml"); 43 | runner.setGlobalProperties(new String[] { "rsb.soap.uri=" + RSB_BASE_URI + "/api/soap/mtom-jobs" }); 44 | assertTrue(runner.run()); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /rsb/src/it/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /rsb/src/it/resources/override-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 32 | 33 | rsbConfiguration 34 | rsb-configuration-it.json 35 | 36 | -------------------------------------------------------------------------------- /rsb/src/it/resources/rsb-configuration-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "catalogRootDirectory": "/tmp/.rsb/catalog", 3 | "activeMqWorkDirectory": "/tmp/.rsb/activemq", 4 | "defaultRserviPoolUri": "rmi://127.0.0.1/rpooli-pool", 5 | "jobTimeOut": 600000, 6 | "numberOfConcurrentJobWorkersPerQueue": 5, 7 | "resultsDirectory": "/tmp/.rsb/results", 8 | "depositEmailAccounts": [ 9 | { 10 | "accountURI":"imap://rsb-default:test@localhost:9143/INBOX", 11 | "applicationName": "lab1", 12 | "pollingPeriod": 5000 13 | }, 14 | { 15 | "accountURI":"pop3://rsb-pop3:test@localhost:9110/INBOX", 16 | "applicationName": "lab1", 17 | "pollingPeriod": 5000 18 | }, 19 | { 20 | "accountURI":"imap://rsb-conf:test@localhost:9143/INBOX", 21 | "applicationName": "lab2", 22 | "pollingPeriod": 5000, 23 | "jobConfigurationFileName": "test-configuration.txt" 24 | }, 25 | { 26 | "accountURI":"imap://rsb-resp:test@localhost:9143/INBOX", 27 | "applicationName": "lab3", 28 | "pollingPeriod": 5000, 29 | "responseFileName": "test-email-response.txt" 30 | } 31 | ], 32 | "depositRootDirectories": [ 33 | { 34 | "rootDirectory": "/tmp/.rsb/deposit/lab-equipment-1", 35 | "applicationName": "lab1", 36 | "pollingPeriod": 5000 37 | }, 38 | { 39 | "rootDirectory": "/tmp/.rsb/deposit/lab-equipment-2", 40 | "applicationName": "lab2", 41 | "pollingPeriod": 5000, 42 | "jobConfigurationFileName": "test-configuration.txt" 43 | } 44 | ], 45 | "smtpConfiguration": { 46 | "host": "localhost", "port": 9025, "username": "", "password": "" 47 | }, 48 | "dataDirectories" : ["/tmp"] 49 | } -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/component/AbstractComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.component; 25 | 26 | import javax.annotation.Resource; 27 | 28 | import org.apache.commons.logging.Log; 29 | import org.apache.commons.logging.LogFactory; 30 | import org.springframework.context.MessageSource; 31 | 32 | import eu.openanalytics.rsb.config.Configuration; 33 | import eu.openanalytics.rsb.message.MessageDispatcher; 34 | 35 | 36 | /** 37 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 38 | */ 39 | public abstract class AbstractComponent 40 | { 41 | private final Log logger = LogFactory.getLog(getClass()); 42 | 43 | @Resource 44 | private Configuration configuration; 45 | 46 | @Resource 47 | private MessageSource messages; 48 | 49 | @Resource 50 | private MessageDispatcher messageDispatcher; 51 | 52 | public void setMessageDispatcher(final MessageDispatcher messageDispatcher) 53 | { 54 | this.messageDispatcher = messageDispatcher; 55 | } 56 | 57 | public void setConfiguration(final Configuration configuration) 58 | { 59 | this.configuration = configuration; 60 | } 61 | 62 | public void setMessages(final MessageSource messages) 63 | { 64 | this.messages = messages; 65 | } 66 | 67 | protected Configuration getConfiguration() 68 | { 69 | return configuration; 70 | } 71 | 72 | protected MessageSource getMessages() 73 | { 74 | return messages; 75 | } 76 | 77 | protected Log getLogger() 78 | { 79 | return logger; 80 | } 81 | 82 | protected MessageDispatcher getMessageDispatcher() 83 | { 84 | return messageDispatcher; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/component/AbstractComponentWithCatalog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.component; 25 | 26 | import java.nio.file.Path; 27 | 28 | import javax.annotation.Resource; 29 | 30 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 31 | import org.eclipse.statet.jcommons.lang.Nullable; 32 | 33 | import eu.openanalytics.rsb.config.Configuration.CatalogSection; 34 | import eu.openanalytics.rsb.data.CatalogManager; 35 | 36 | 37 | /** 38 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 39 | */ 40 | @NonNullByDefault 41 | public abstract class AbstractComponentWithCatalog extends AbstractComponent { 42 | 43 | 44 | @Resource 45 | private CatalogManager catalogManager; 46 | 47 | 48 | protected AbstractComponentWithCatalog() { 49 | } 50 | 51 | 52 | public void setCatalogManager(final CatalogManager catalogManager) { 53 | this.catalogManager= catalogManager; 54 | } 55 | 56 | protected CatalogManager getCatalogManager() { 57 | return this.catalogManager; 58 | } 59 | 60 | protected Path getJobConfigurationFile(final @Nullable String applicationName, 61 | final String fileName) { 62 | return getCatalogManager().internalGetCatalogFile(CatalogSection.JOB_CONFIGURATIONS, 63 | applicationName, fileName ); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/component/AbstractResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.component; 25 | 26 | import java.security.Principal; 27 | 28 | import javax.ws.rs.core.Context; 29 | import javax.ws.rs.core.SecurityContext; 30 | 31 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 32 | import org.eclipse.statet.jcommons.lang.Nullable; 33 | 34 | import eu.openanalytics.rsb.security.ApplicationPermissionEvaluator; 35 | 36 | 37 | /** 38 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 39 | */ 40 | @NonNullByDefault 41 | public abstract class AbstractResource extends AbstractComponentWithCatalog { 42 | 43 | 44 | @Context 45 | private @Nullable SecurityContext securityContext; 46 | 47 | 48 | // exposed for unit testing 49 | void setSecurityContext(final SecurityContext securityContext) { 50 | this.securityContext= securityContext; 51 | } 52 | 53 | 54 | protected String getUserName() { 55 | final var securityContext= this.securityContext; 56 | final Principal user; 57 | return (securityContext != null && (user= securityContext.getUserPrincipal()) != null) ? 58 | user.getName() : 59 | ApplicationPermissionEvaluator.NO_AUTHENTICATED_USERNAME; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/component/HandlerUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.component; 25 | 26 | import static org.eclipse.statet.jcommons.lang.ObjectUtils.nonNullElse; 27 | 28 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 29 | import org.eclipse.statet.jcommons.status.ErrorStatus; 30 | import org.eclipse.statet.jcommons.status.StatusException; 31 | 32 | import eu.openanalytics.rsb.Constants; 33 | import eu.openanalytics.rsb.message.IllegalJobDataException; 34 | 35 | 36 | @NonNullByDefault 37 | class HandlerUtils { 38 | 39 | 40 | public static Exception handleJobError(final AbstractComponent handler, 41 | final Exception e) { 42 | if (e instanceof IllegalJobDataException) { 43 | return e; 44 | } 45 | handler.getLogger().info("An error occured while processing the job.", e); 46 | return new StatusException(new ErrorStatus(Constants.BUNDLE_ID, 47 | String.format("An error occured while processing the job: %1$s", 48 | nonNullElse(e.getMessage(), "") ), 49 | e )); 50 | } 51 | 52 | 53 | private HandlerUtils() { 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/config/RServiEnvironmentServletContextListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.config; 25 | 26 | import javax.servlet.ServletContextEvent; 27 | import javax.servlet.ServletContextListener; 28 | 29 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 30 | import org.eclipse.statet.jcommons.runtime.BasicAppEnvironment; 31 | import org.eclipse.statet.jcommons.runtime.CommonsRuntime; 32 | import org.eclipse.statet.jcommons.runtime.bundle.Bundles; 33 | import org.eclipse.statet.jcommons.status.StatusException; 34 | import org.eclipse.statet.jcommons.status.util.ACommonsLoggingStatusLogger; 35 | 36 | import org.eclipse.statet.rj.server.RjsComConfig; 37 | import org.eclipse.statet.rj.server.client.RClientGraphicDummyFactory; 38 | 39 | import eu.openanalytics.rsb.Constants; 40 | 41 | 42 | /** 43 | * Handles the RServi runtime environment. 44 | * 45 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 46 | */ 47 | @NonNullByDefault 48 | public class RServiEnvironmentServletContextListener extends BasicAppEnvironment 49 | implements ServletContextListener 50 | { 51 | 52 | public RServiEnvironmentServletContextListener() throws StatusException 53 | { 54 | super(Constants.BUNDLE_ID, new ACommonsLoggingStatusLogger(), Bundles.createResolver()); 55 | } 56 | 57 | 58 | @Override 59 | public void contextInitialized(final ServletContextEvent sce) 60 | { 61 | CommonsRuntime.init(this); 62 | 63 | RjsComConfig.setProperty("rj.servi.graphicFactory", new RClientGraphicDummyFactory()); 64 | } 65 | 66 | @Override 67 | public void contextDestroyed(final ServletContextEvent sce) 68 | { 69 | onAppStopping(); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/config/SpringContextEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.config; 25 | 26 | import java.io.IOException; 27 | 28 | import javax.annotation.Resource; 29 | 30 | import mx4j.tools.adaptor.http.HttpAdaptor; 31 | import org.apache.commons.logging.Log; 32 | import org.apache.commons.logging.LogFactory; 33 | import org.springframework.context.ApplicationListener; 34 | import org.springframework.context.event.ContextRefreshedEvent; 35 | 36 | 37 | /** 38 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 39 | */ 40 | public class SpringContextEventListener implements ApplicationListener 41 | { 42 | private static final Log LOGGER = LogFactory.getLog(SpringContextEventListener.class); 43 | 44 | private static final String SPLASH = "\n\n____________________________\n" 45 | + " ____ __ ____\n" + " / ) / ) / )\n" 46 | + "---/___ /----\\-------/__ /--\n" 47 | + " / | \\ / )\n" 48 | + "_/_____|__(____/___/____/___\n\n"; 49 | 50 | @Resource 51 | private HttpAdaptor httpAdaptor; 52 | 53 | /** 54 | * Perform post init operations. 55 | */ 56 | @Override 57 | public void onApplicationEvent(final ContextRefreshedEvent event) 58 | { 59 | try 60 | { 61 | httpAdaptor.start(); 62 | } 63 | catch (final IOException ioe) 64 | { 65 | LOGGER.error("Failed to start MX4J HTTP adaptor", ioe); 66 | } 67 | 68 | // who doesn't like ASCII art? 69 | LOGGER.info(SPLASH); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/data/CatalogManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.data; 25 | 26 | import java.io.IOException; 27 | import java.io.InputStream; 28 | import java.nio.file.Path; 29 | import java.util.List; 30 | import java.util.Map; 31 | 32 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 33 | import org.eclipse.statet.jcommons.lang.Nullable; 34 | 35 | import org.apache.commons.lang3.tuple.Pair; 36 | 37 | import eu.openanalytics.rsb.config.Configuration.CatalogSection; 38 | 39 | 40 | /** 41 | * The RSB catalog. The applicationName argument are mandatory if the catalog runs in 42 | * application-aware mode. 43 | * 44 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 45 | */ 46 | @NonNullByDefault 47 | public interface CatalogManager { 48 | 49 | 50 | Map>> getCatalog( 51 | @Nullable String applicationName); 52 | 53 | 54 | Path getCatalogFile(CatalogSection catalogSection, 55 | @Nullable String applicationName, 56 | String fileName); 57 | 58 | /** 59 | * This must only be called when it's impossible to have a security context (ie after going 60 | * through JMS) 61 | */ 62 | Path internalGetCatalogFile(CatalogSection catalogSection, 63 | @Nullable String applicationName, 64 | String fileName); 65 | 66 | static final class PutCatalogFileResult { 67 | 68 | public static enum ChangeType { 69 | CREATED, UPDATED; 70 | } 71 | 72 | private final ChangeType changeType; 73 | 74 | private final Path path; 75 | 76 | public PutCatalogFileResult(final ChangeType changeType, final Path path) { 77 | this.changeType= changeType; 78 | this.path= path; 79 | } 80 | 81 | public ChangeType getChangeType() { 82 | return this.changeType; 83 | } 84 | 85 | public Path getPath() { 86 | return this.path; 87 | } 88 | 89 | } 90 | 91 | PutCatalogFileResult putCatalogFile(CatalogSection catalogSection, 92 | @Nullable String applicationName, 93 | String fileName, InputStream in) throws IOException; 94 | 95 | } 96 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/data/PersistedResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.data; 25 | 26 | import java.io.IOException; 27 | import java.io.InputStream; 28 | import java.util.GregorianCalendar; 29 | import java.util.UUID; 30 | 31 | import javax.activation.MimeType; 32 | 33 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 34 | import org.eclipse.statet.jcommons.lang.Nullable; 35 | 36 | import org.apache.commons.lang3.builder.ToStringBuilder; 37 | import org.apache.commons.lang3.builder.ToStringStyle; 38 | 39 | 40 | /** 41 | * Defines what a result store should persist for job result. 42 | * 43 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 44 | */ 45 | @NonNullByDefault 46 | public abstract class PersistedResult { 47 | 48 | 49 | private final String applicationName; 50 | private final @Nullable String userName; 51 | private final UUID jobId; 52 | private final GregorianCalendar resultTime; 53 | private final boolean success; 54 | private final MimeType mimeType; 55 | 56 | public PersistedResult(final String applicationName, 57 | final @Nullable String userName, final UUID jobId, 58 | final GregorianCalendar resultTime, 59 | final boolean success, 60 | final MimeType mimeType) { 61 | this.applicationName= applicationName; 62 | this.userName= userName; 63 | this.jobId= jobId; 64 | this.resultTime= resultTime; 65 | this.success= success; 66 | this.mimeType= mimeType; 67 | } 68 | 69 | 70 | public String getApplicationName() { 71 | return this.applicationName; 72 | } 73 | 74 | public @Nullable String getUserName() { 75 | return this.userName; 76 | } 77 | 78 | public UUID getJobId() { 79 | return this.jobId; 80 | } 81 | 82 | public GregorianCalendar getResultTime() { 83 | return this.resultTime; 84 | } 85 | 86 | public boolean isSuccess() { 87 | return this.success; 88 | } 89 | 90 | public MimeType getMimeType() { 91 | return this.mimeType; 92 | } 93 | 94 | 95 | public abstract long getDataLength() throws IOException; 96 | 97 | public abstract InputStream getData() throws IOException; 98 | 99 | 100 | @Override 101 | public String toString() { 102 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/data/ResultStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.data; 25 | 26 | import java.io.IOException; 27 | import java.util.Collection; 28 | import java.util.UUID; 29 | 30 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 31 | import org.eclipse.statet.jcommons.lang.Nullable; 32 | 33 | 34 | /** 35 | * Defines a result store. 36 | * 37 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 38 | */ 39 | @NonNullByDefault 40 | public interface ResultStore { 41 | 42 | 43 | void store(PersistedResult result) throws IOException; 44 | 45 | 46 | boolean deleteByApplicationNameAndJobId(String applicationName, 47 | UUID jobId) 48 | throws IOException; 49 | 50 | /** 51 | * @return an empty collection if no result was found. 52 | */ 53 | Collection findByApplicationName(String applicationName); 54 | 55 | /** 56 | * @return null if no result was found. 57 | */ 58 | @Nullable PersistedResult findByApplicationNameAndJobId(String applicationName, 59 | UUID jobId ); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/data/SecureResultStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.data; 25 | 26 | import java.io.IOException; 27 | import java.util.Collection; 28 | import java.util.UUID; 29 | 30 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 31 | import org.eclipse.statet.jcommons.lang.Nullable; 32 | 33 | 34 | /** 35 | * Defines a username-aware result store. 36 | * 37 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 38 | */ 39 | @NonNullByDefault 40 | public interface SecureResultStore extends ResultStore { 41 | 42 | 43 | boolean deleteByApplicationNameAndJobId(String applicationName, 44 | @Nullable String userName, UUID jobId) 45 | throws IOException; 46 | 47 | /** 48 | * @return an empty collection if no result was found. 49 | */ 50 | Collection findByApplicationName(String applicationName, 51 | @Nullable String userName ); 52 | 53 | /** 54 | * @return null if no result was found. 55 | */ 56 | @Nullable PersistedResult findByApplicationNameAndJobId(String applicationName, 57 | @Nullable String userName, UUID jobId ); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/jaxrs/AccessDeniedExceptionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.jaxrs; 25 | 26 | import javax.ws.rs.core.MediaType; 27 | import javax.ws.rs.core.Response; 28 | import javax.ws.rs.core.Response.Status; 29 | import javax.ws.rs.ext.ExceptionMapper; 30 | 31 | import org.springframework.security.access.AccessDeniedException; 32 | 33 | 34 | /** 35 | * Converts {@link AccessDeniedException} into FORBIDDEN HTTP responses. 36 | * 37 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 38 | */ 39 | public class AccessDeniedExceptionMapper implements ExceptionMapper 40 | { 41 | @Override 42 | public Response toResponse(final AccessDeniedException ade) 43 | { 44 | return Response.status(Status.FORBIDDEN).type(MediaType.TEXT_PLAIN).entity(ade.getMessage()).build(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/jaxrs/IllegalArgumentExceptionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.jaxrs; 25 | 26 | import javax.ws.rs.core.MediaType; 27 | import javax.ws.rs.core.Response; 28 | import javax.ws.rs.core.Response.Status; 29 | import javax.ws.rs.core.Response.Status.Family; 30 | import javax.ws.rs.core.Response.StatusType; 31 | import javax.ws.rs.ext.ExceptionMapper; 32 | 33 | 34 | /** 35 | * Converts {@link IllegalArgumentException} into BAD_REQUEST HTTP responses. 36 | * 37 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 38 | */ 39 | public class IllegalArgumentExceptionMapper implements ExceptionMapper 40 | { 41 | private final static class BadRequestStatus implements StatusType 42 | { 43 | private final String reasonPhrase; 44 | 45 | private BadRequestStatus(final String reasonPhrase) 46 | { 47 | this.reasonPhrase = reasonPhrase; 48 | } 49 | 50 | @Override 51 | public int getStatusCode() 52 | { 53 | return Status.BAD_REQUEST.getStatusCode(); 54 | } 55 | 56 | @Override 57 | public Family getFamily() 58 | { 59 | return Status.BAD_REQUEST.getFamily(); 60 | } 61 | 62 | @Override 63 | public String getReasonPhrase() 64 | { 65 | return reasonPhrase; 66 | } 67 | } 68 | 69 | @Override 70 | public Response toResponse(final IllegalArgumentException iae) 71 | { 72 | final BadRequestStatus status = new BadRequestStatus("Bad request - " + iae.getMessage()); 73 | // JAX-RS doesn't seem to propagate the reason phrase to the ultimate HTTP 74 | // response status 75 | // line, hence add it to the response body too 76 | return Response.status(status).type(MediaType.TEXT_PLAIN).entity(status.getReasonPhrase()).build(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/jaxrs/ThrowableExceptionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.jaxrs; 25 | 26 | import javax.ws.rs.core.MediaType; 27 | import javax.ws.rs.core.Response; 28 | import javax.ws.rs.core.Response.Status; 29 | import javax.ws.rs.ext.ExceptionMapper; 30 | 31 | import org.apache.commons.logging.Log; 32 | import org.apache.commons.logging.LogFactory; 33 | 34 | 35 | /** 36 | * Converts {@link Throwable} into HTTP responses. 37 | * 38 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 39 | */ 40 | public class ThrowableExceptionMapper implements ExceptionMapper 41 | { 42 | private static final Log LOGGER = LogFactory.getLog(ThrowableExceptionMapper.class); 43 | 44 | @Override 45 | public Response toResponse(final Throwable t) 46 | { 47 | LOGGER.error(t.getMessage(), t); 48 | 49 | return Response.status(Status.INTERNAL_SERVER_ERROR) 50 | .type(MediaType.TEXT_PLAIN) 51 | .entity(t.getMessage()) 52 | .build(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/jaxrs/WebApplicationExceptionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.jaxrs; 25 | 26 | import javax.ws.rs.WebApplicationException; 27 | import javax.ws.rs.core.Response; 28 | import javax.ws.rs.ext.ExceptionMapper; 29 | 30 | 31 | /** 32 | * Converts {@link WebApplicationException} into HTTP responses. 33 | * 34 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 35 | */ 36 | public class WebApplicationExceptionMapper implements ExceptionMapper 37 | { 38 | @Override 39 | public Response toResponse(final WebApplicationException wae) 40 | { 41 | return wae.getResponse(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/AbstractFunctionCallJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.io.IOException; 27 | import java.util.Collections; 28 | import java.util.GregorianCalendar; 29 | import java.util.UUID; 30 | 31 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 32 | import org.eclipse.statet.jcommons.lang.Nullable; 33 | 34 | 35 | /** 36 | * Represents a RSB job that consists in calling a unary function on R. 37 | * 38 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 39 | */ 40 | @NonNullByDefault 41 | public abstract class AbstractFunctionCallJob extends AbstractJob { 42 | 43 | private static final long serialVersionUID= 1L; 44 | 45 | 46 | private final String argument; 47 | 48 | 49 | @SuppressWarnings("unchecked") 50 | public AbstractFunctionCallJob(final Source source, final String applicationName, 51 | final @Nullable String userName, final UUID jobId, 52 | final GregorianCalendar submissionTime, 53 | final String argument) { 54 | // function call jobs and results have no meta 55 | super(source, applicationName, userName, jobId, submissionTime, Collections.EMPTY_MAP); 56 | this.argument= argument; 57 | } 58 | 59 | @Override 60 | protected void releaseResources() { 61 | // NOOP 62 | } 63 | 64 | 65 | public abstract String getFunctionName(); 66 | 67 | public String getArgument() { 68 | return this.argument; 69 | } 70 | 71 | 72 | public abstract AbstractResult buildSuccessResult(String result) throws IOException; 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/AbstractFunctionCallResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.util.Collections; 27 | import java.util.GregorianCalendar; 28 | import java.util.UUID; 29 | 30 | import javax.activation.MimeType; 31 | 32 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 33 | import org.eclipse.statet.jcommons.lang.Nullable; 34 | 35 | 36 | /** 37 | * Represents the result of a {@link AbstractFunctionCallJob}. 38 | * 39 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 40 | */ 41 | @NonNullByDefault 42 | public abstract class AbstractFunctionCallResult extends AbstractResult { 43 | 44 | private static final long serialVersionUID= 1L; 45 | 46 | 47 | private final String result; 48 | 49 | 50 | @SuppressWarnings("unchecked") 51 | public AbstractFunctionCallResult(final Source source, final String applicationName, 52 | final @Nullable String userName, final UUID jobId, 53 | final GregorianCalendar submissionTime, 54 | final boolean success, final String result) { 55 | // function call jobs and results have no meta 56 | super(source, applicationName, userName, jobId, submissionTime, Collections.EMPTY_MAP, success); 57 | this.result= result; 58 | } 59 | 60 | @Override 61 | protected void releaseResources() { 62 | // NOOP 63 | } 64 | 65 | 66 | public abstract MimeType getMimeType(); 67 | 68 | @Override 69 | public String getPayload() { 70 | return this.result; 71 | } 72 | 73 | public String getResultFileName() { 74 | final String resultFileExtension= (isSuccess() ? "" : "err.") + getMimeType().getSubType(); 75 | return getJobId() + "." + resultFileExtension; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/AbstractJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.io.IOException; 27 | import java.io.Serializable; 28 | import java.util.GregorianCalendar; 29 | import java.util.Map; 30 | import java.util.UUID; 31 | 32 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 33 | import org.eclipse.statet.jcommons.lang.Nullable; 34 | 35 | import org.springframework.context.MessageSource; 36 | 37 | import eu.openanalytics.rsb.Util; 38 | import eu.openanalytics.rsb.rest.types.ErrorResult; 39 | 40 | 41 | /** 42 | * Represents a generic RSB job. 43 | * 44 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 45 | */ 46 | @NonNullByDefault 47 | public abstract class AbstractJob extends AbstractWorkItem implements Job { 48 | 49 | private static final long serialVersionUID= 1L; 50 | 51 | 52 | public AbstractJob(final Source source, final String applicationName, 53 | final @Nullable String userName, final UUID jobId, 54 | final GregorianCalendar submissionTime, 55 | final Map meta) { 56 | super(source, applicationName, userName, jobId, submissionTime, meta); 57 | } 58 | 59 | 60 | @Override 61 | public String getType() { 62 | return getClass().getSimpleName(); 63 | } 64 | 65 | 66 | public abstract AbstractResult buildErrorResult(Throwable t, MessageSource messageSource) 67 | throws IOException; 68 | 69 | /** 70 | * Builds an {@link ErrorResult} for a job whose processing has failed. 71 | * 72 | * @param job 73 | * @param error 74 | * @return 75 | */ 76 | public static ErrorResult buildJobProcessingErrorResult(final AbstractJob job, 77 | final Throwable error) { 78 | final ErrorResult errorResult= Util.REST_OBJECT_FACTORY.createErrorResult(); 79 | errorResult.setApplicationName(job.getApplicationName()); 80 | errorResult.setJobId(job.getJobId().toString()); 81 | errorResult.setSubmissionTime(Util.convertToXmlDate(job.getSubmissionTime())); 82 | errorResult.setErrorMessage(error.getMessage()); 83 | return errorResult; 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/AbstractResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.io.IOException; 27 | import java.io.Serializable; 28 | import java.util.GregorianCalendar; 29 | import java.util.Map; 30 | import java.util.UUID; 31 | 32 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 33 | import org.eclipse.statet.jcommons.lang.Nullable; 34 | 35 | 36 | /** 37 | * Represents the result of a {@link AbstractJob}. 38 | * 39 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 40 | */ 41 | @NonNullByDefault 42 | public abstract class AbstractResult extends AbstractWorkItem implements Result { 43 | 44 | private static final long serialVersionUID= 1L; 45 | 46 | 47 | private final boolean success; 48 | 49 | 50 | public AbstractResult(final Source source, final String applicationName, 51 | final @Nullable String userName, final UUID jobId, 52 | final GregorianCalendar submissionTime, 53 | final Map meta, final boolean success) { 54 | super(source, applicationName, userName, jobId, submissionTime, meta); 55 | this.success= success; 56 | } 57 | 58 | 59 | @Override 60 | public boolean isSuccess() { 61 | return this.success; 62 | } 63 | 64 | @Override 65 | public abstract T getPayload() throws IOException; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/IllegalJobDataException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | 27 | public class IllegalJobDataException extends Exception { 28 | 29 | private static final long serialVersionUID= 1L; 30 | 31 | 32 | public IllegalJobDataException(final String message) { 33 | super(message); 34 | } 35 | 36 | public IllegalJobDataException(final String message, final Throwable cause) { 37 | super(message, cause); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/Job.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 27 | 28 | 29 | /** 30 | * RSB job definition. 31 | * 32 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 33 | */ 34 | @NonNullByDefault 35 | public interface Job extends WorkItem { 36 | 37 | 38 | String getType(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/JsonFunctionCallJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.util.GregorianCalendar; 27 | import java.util.UUID; 28 | 29 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 30 | 31 | import org.springframework.context.MessageSource; 32 | 33 | import eu.openanalytics.rsb.Util; 34 | 35 | 36 | /** 37 | * Represents a RSB job that consists in calling the RSBJsonService function on R. 38 | * 39 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 40 | */ 41 | @NonNullByDefault 42 | public class JsonFunctionCallJob extends AbstractFunctionCallJob { 43 | 44 | private static final long serialVersionUID= 1L; 45 | 46 | 47 | public JsonFunctionCallJob(final Source source, final String applicationName, 48 | final String userName, final UUID jobId, 49 | final GregorianCalendar submissionTime, 50 | final String argument) { 51 | super(source, applicationName, userName, jobId, submissionTime, argument); 52 | } 53 | 54 | 55 | @Override 56 | public String getFunctionName() { 57 | return "RSBJsonService"; 58 | } 59 | 60 | 61 | @Override 62 | public JsonFunctionCallResult buildSuccessResult(final String result) { 63 | // R response is JSON already, no conversion needed 64 | return buildResult(true, result); 65 | } 66 | 67 | @Override 68 | public JsonFunctionCallResult buildErrorResult(final Throwable error, final MessageSource messageSource) { 69 | return buildResult(false, Util.toJson(AbstractJob.buildJobProcessingErrorResult(this, error))); 70 | } 71 | 72 | private JsonFunctionCallResult buildResult(final boolean success, final String result) { 73 | return new JsonFunctionCallResult(getSource(), getApplicationName(), 74 | getUserName(), getJobId(), getSubmissionTime(), 75 | success, result ); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/JsonFunctionCallResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.util.GregorianCalendar; 27 | import java.util.UUID; 28 | 29 | import javax.activation.MimeType; 30 | 31 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 32 | import org.eclipse.statet.jcommons.lang.Nullable; 33 | 34 | import eu.openanalytics.rsb.Constants; 35 | 36 | 37 | /** 38 | * Represents the result of a {@link JsonFunctionCallJob}. 39 | * 40 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 41 | */ 42 | @NonNullByDefault 43 | public class JsonFunctionCallResult extends AbstractFunctionCallResult { 44 | 45 | private static final long serialVersionUID= 1L; 46 | 47 | 48 | public JsonFunctionCallResult(final Source source, final String applicationName, 49 | final @Nullable String userName, final UUID jobId, 50 | final GregorianCalendar submissionTime, 51 | final boolean success, final String result) { 52 | super(source, applicationName, userName, jobId, submissionTime, success, result); 53 | } 54 | 55 | 56 | @Override 57 | public MimeType getMimeType() { 58 | return Constants.JSON_MIME_TYPE; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/MessageDispatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 27 | 28 | 29 | /** 30 | * Defines a Job and Result message dispatcher. 31 | * 32 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 33 | */ 34 | @NonNullByDefault 35 | public interface MessageDispatcher { 36 | 37 | 38 | /** 39 | * Dispatches an {@link AbstractJob}. 40 | * 41 | * @param job 42 | */ 43 | void dispatch(AbstractJob job); 44 | 45 | /** 46 | * Dispatches an {@link AbstractResult}. 47 | * 48 | * @param result 49 | */ 50 | void dispatch(AbstractResult result); 51 | 52 | /** 53 | * Dispatches an {@link AbstractJob} and waits for an {@link AbstractResult}. 54 | * 55 | * @param job 56 | * @return 57 | */ 58 | > T process(AbstractJob job); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.io.IOException; 27 | 28 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 29 | 30 | 31 | /** 32 | * RSB job definition. 33 | * 34 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 35 | */ 36 | @NonNullByDefault 37 | public interface Result extends WorkItem { 38 | 39 | 40 | boolean isSuccess(); 41 | 42 | T getPayload() throws IOException; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/WorkItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.io.Serializable; 27 | import java.util.GregorianCalendar; 28 | import java.util.Map; 29 | import java.util.UUID; 30 | 31 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 32 | import org.eclipse.statet.jcommons.lang.Nullable; 33 | 34 | import eu.openanalytics.rsb.message.AbstractWorkItem.Source; 35 | 36 | 37 | /** 38 | * RSB work item definition. 39 | * 40 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 41 | */ 42 | @NonNullByDefault 43 | public interface WorkItem { 44 | 45 | 46 | Source getSource(); 47 | 48 | String getApplicationName(); 49 | 50 | @Nullable String getUserName(); 51 | 52 | UUID getJobId(); 53 | 54 | GregorianCalendar getSubmissionTime(); 55 | 56 | int getPriority(); 57 | 58 | String getErrorMessageId(); 59 | 60 | String getAbortMessageId(); 61 | 62 | 63 | Map getMeta(); 64 | 65 | } 66 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/XmlFunctionCallJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.util.GregorianCalendar; 27 | import java.util.UUID; 28 | 29 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 30 | import org.eclipse.statet.jcommons.lang.Nullable; 31 | 32 | import org.springframework.context.MessageSource; 33 | 34 | import eu.openanalytics.rsb.Util; 35 | 36 | 37 | /** 38 | * Represents a RSB job that consists in calling the RSBXmlService function on R. 39 | * 40 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 41 | */ 42 | @NonNullByDefault 43 | public class XmlFunctionCallJob extends AbstractFunctionCallJob { 44 | 45 | private static final long serialVersionUID= 1L; 46 | 47 | 48 | public XmlFunctionCallJob(final Source source, final String applicationName, 49 | final @Nullable String userName, final UUID jobId, 50 | final GregorianCalendar submissionTime, 51 | final String argument) { 52 | super(source, applicationName, userName, jobId, submissionTime, argument); 53 | } 54 | 55 | 56 | @Override 57 | public String getFunctionName() { 58 | return "RSBXmlService"; 59 | } 60 | 61 | 62 | @Override 63 | public XmlFunctionCallResult buildSuccessResult(final String result) { 64 | // R response is JSON already, no conversion needed 65 | return buildResult(true, result); 66 | } 67 | 68 | @Override 69 | public XmlFunctionCallResult buildErrorResult(final Throwable error, final MessageSource messageSource) { 70 | return buildResult(false, Util.toXml(AbstractJob.buildJobProcessingErrorResult(this, error))); 71 | } 72 | 73 | private XmlFunctionCallResult buildResult(final boolean success, final String result) { 74 | return new XmlFunctionCallResult(getSource(), getApplicationName(), 75 | getUserName(), getJobId(), getSubmissionTime(), 76 | success, result ); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/message/XmlFunctionCallResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import java.util.GregorianCalendar; 27 | import java.util.UUID; 28 | 29 | import javax.activation.MimeType; 30 | 31 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 32 | import org.eclipse.statet.jcommons.lang.Nullable; 33 | 34 | import eu.openanalytics.rsb.Constants; 35 | 36 | 37 | /** 38 | * Represents the result of a {@link XmlFunctionCallJob}. 39 | * 40 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 41 | */ 42 | @NonNullByDefault 43 | public class XmlFunctionCallResult extends AbstractFunctionCallResult { 44 | 45 | private static final long serialVersionUID= 1L; 46 | 47 | 48 | public XmlFunctionCallResult(final Source source, final String applicationName, 49 | final @Nullable String userName, final UUID jobId, 50 | final GregorianCalendar submissionTime, 51 | final boolean success, final String result) { 52 | super(source, applicationName, userName, jobId, submissionTime, success, result); 53 | } 54 | 55 | 56 | @Override 57 | public MimeType getMimeType() { 58 | return Constants.XML_MIME_TYPE; 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/rservi/DefaultRServiPackageManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.rservi; 25 | 26 | import java.nio.file.Path; 27 | 28 | import javax.annotation.Resource; 29 | 30 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 31 | 32 | import org.eclipse.statet.rj.servi.RServi; 33 | import org.eclipse.statet.rj.services.util.RPkgInstallation; 34 | 35 | import org.apache.commons.logging.Log; 36 | import org.apache.commons.logging.LogFactory; 37 | import org.springframework.stereotype.Component; 38 | 39 | import eu.openanalytics.rsb.Constants; 40 | import eu.openanalytics.rsb.rservi.RServiInstanceProvider.PoolingStrategy; 41 | 42 | 43 | /** 44 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 45 | */ 46 | @Component 47 | @NonNullByDefault 48 | public class DefaultRServiPackageManager implements RServiPackageManager { 49 | 50 | 51 | private static final Log LOGGER= LogFactory.getLog(DefaultRServiPackageManager.class); 52 | 53 | 54 | @Resource 55 | private RServiInstanceProvider rServiInstanceProvider; 56 | 57 | 58 | @Override 59 | public void install(final Path packageSourceFile, final String rServiPoolUri) throws Exception { 60 | RServi rServiInstance= null; 61 | try { 62 | rServiInstance= this.rServiInstanceProvider.getRServiInstance(rServiPoolUri, 63 | Constants.RSERVI_CLIENT_ID, PoolingStrategy.NEVER); 64 | new RPkgInstallation(packageSourceFile).install(rServiInstance, null); 65 | } 66 | finally { 67 | if (rServiInstance != null) { 68 | try { 69 | rServiInstance.close(); 70 | } 71 | catch (final Exception e) { 72 | LOGGER.warn("Failed to close RServi instance: " + rServiInstance, e); 73 | } 74 | } 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/rservi/ErrorableRServi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.rservi; 25 | 26 | import org.eclipse.statet.rj.servi.RServi; 27 | 28 | 29 | /** 30 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 31 | */ 32 | public interface ErrorableRServi extends RServi 33 | { 34 | void resetError(); 35 | 36 | void markError(); 37 | 38 | boolean hasError(); 39 | } 40 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/rservi/RServiInstanceProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.rservi; 25 | 26 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 27 | 28 | import org.eclipse.statet.rj.servi.RServi; 29 | 30 | 31 | /** 32 | * Defines a RServi connection provider. 33 | * 34 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 35 | */ 36 | @NonNullByDefault 37 | public interface RServiInstanceProvider { 38 | 39 | 40 | enum PoolingStrategy { 41 | NEVER, IF_POSSIBLE 42 | } 43 | 44 | RServi getRServiInstance(String address, String clientId, PoolingStrategy poolingStrategy) 45 | throws Exception; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/rservi/RServiPackageManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.rservi; 25 | 26 | import java.nio.file.Path; 27 | 28 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 29 | 30 | 31 | /** 32 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 33 | */ 34 | @NonNullByDefault 35 | public interface RServiPackageManager { 36 | 37 | 38 | void install(Path packageSourceFile, String rServiPoolUri) throws Exception; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/rservi/RServiUriSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.rservi; 25 | 26 | import java.net.URI; 27 | 28 | 29 | /** 30 | * Defines a strategy for selecting RServi URIs. 31 | * 32 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 33 | */ 34 | public interface RServiUriSelector 35 | { 36 | URI getUriForApplication(String applicationName); 37 | } 38 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/security/IdentifiedUserDetailsService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.security; 25 | 26 | import java.util.HashSet; 27 | import java.util.Set; 28 | 29 | import javax.annotation.PostConstruct; 30 | 31 | import org.apache.commons.lang3.StringUtils; 32 | import org.springframework.security.core.GrantedAuthority; 33 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 34 | import org.springframework.security.core.userdetails.User; 35 | import org.springframework.security.core.userdetails.UserDetails; 36 | import org.springframework.security.core.userdetails.UserDetailsService; 37 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 38 | 39 | import eu.openanalytics.rsb.Util; 40 | 41 | 42 | /** 43 | * A {@link UserDetailsService} that accepts any user presented to it, which makes it 44 | * usable in scenarios where it is enough to merely identify a user. 45 | * 46 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 47 | */ 48 | public class IdentifiedUserDetailsService implements UserDetailsService 49 | { 50 | private static final String NO_PASSWORD = StringUtils.EMPTY; 51 | 52 | private String configuredAuthorities; 53 | private Set grantedAuthorities; 54 | 55 | @PostConstruct 56 | public void initializeGrantedAuthorities() 57 | { 58 | grantedAuthorities = new HashSet<>(); 59 | 60 | if (StringUtils.isBlank(configuredAuthorities)) 61 | { 62 | return; 63 | } 64 | 65 | for (final String configuredAuthority : StringUtils.split(configuredAuthorities, ", ")) 66 | { 67 | final String strippedAuthority = StringUtils.stripToEmpty(configuredAuthority); 68 | if (StringUtils.isNotEmpty(strippedAuthority)) 69 | { 70 | grantedAuthorities.add(new SimpleGrantedAuthority(strippedAuthority)); 71 | } 72 | } 73 | } 74 | 75 | @Override 76 | public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException 77 | { 78 | return new User(Util.replaceNonWordChars(username, "_"), NO_PASSWORD, grantedAuthorities); 79 | } 80 | 81 | public void setConfiguredAuthorities(final String configuredAuthorities) 82 | { 83 | this.configuredAuthorities = configuredAuthorities; 84 | } 85 | 86 | public String getConfiguredAuthorities() 87 | { 88 | return configuredAuthorities; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/security/SecurableMx4JHttpAdaptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.security; 25 | 26 | import java.io.IOException; 27 | import java.security.GeneralSecurityException; 28 | 29 | import mx4j.tools.adaptor.http.HttpAdaptor; 30 | import org.apache.commons.lang3.StringUtils; 31 | import org.apache.commons.logging.Log; 32 | import org.apache.commons.logging.LogFactory; 33 | import org.apache.commons.ssl.OpenSSL; 34 | 35 | import eu.openanalytics.rsb.config.Configuration; 36 | import eu.openanalytics.rsb.config.Configuration.JmxConfiguration; 37 | 38 | 39 | /** 40 | * Sub-class of {@link HttpAdaptor} that reads security configuration from RSB configuration and 41 | * sets it on the adaptor. 42 | * 43 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 44 | */ 45 | public class SecurableMx4JHttpAdaptor extends HttpAdaptor 46 | { 47 | private static final Log LOGGER = LogFactory.getLog(SecurableMx4JHttpAdaptor.class); 48 | 49 | private static final String BASIC_AUTHENTICATION_METHOD = "basic"; 50 | 51 | private final String httpAuthenticationUsername, httpAuthenticationEncryptedPassword; 52 | 53 | public SecurableMx4JHttpAdaptor(final Configuration configuration) 54 | throws IOException, GeneralSecurityException 55 | { 56 | super(); 57 | 58 | final JmxConfiguration jmxConfiguration = configuration.getJmxConfiguration(); 59 | 60 | if (jmxConfiguration != null) 61 | { 62 | if (StringUtils.isNotBlank(jmxConfiguration.getHttpAuthenticationUsername())) 63 | { 64 | httpAuthenticationUsername = jmxConfiguration.getHttpAuthenticationUsername(); 65 | httpAuthenticationEncryptedPassword = jmxConfiguration.getHttpAuthenticationPassword(); 66 | 67 | // decrypt the configured password using the username as the decryption password 68 | final byte[] decryptedPasswordBytes = OpenSSL.decrypt("des3", 69 | httpAuthenticationUsername.toCharArray(), 70 | httpAuthenticationEncryptedPassword.getBytes("UTF-8")); 71 | 72 | addAuthorization(httpAuthenticationUsername, new String(decryptedPasswordBytes, "UTF-8")); 73 | 74 | setAuthenticationMethod(BASIC_AUTHENTICATION_METHOD); 75 | 76 | LOGGER.info("Basic authentication active"); 77 | return; 78 | } 79 | } 80 | 81 | httpAuthenticationUsername = null; 82 | httpAuthenticationEncryptedPassword = null; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/si/HeaderSettingMessageSourceWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.si; 25 | 26 | import org.springframework.integration.core.MessageSource; 27 | import org.springframework.integration.support.MessageBuilder; 28 | import org.springframework.messaging.Message; 29 | 30 | 31 | /** 32 | * A message source that wraps an existing one and adds an arbitrary header to the in-flight message. 33 | * 34 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 35 | */ 36 | public class HeaderSettingMessageSourceWrapper implements MessageSource { 37 | private final MessageSource wrappedMessageSource; 38 | private final String headerName; 39 | private final Object headerValue; 40 | 41 | public HeaderSettingMessageSourceWrapper(final MessageSource wrappedMessageSource, final String headerName, final Object headerValue) { 42 | this.wrappedMessageSource = wrappedMessageSource; 43 | this.headerName = headerName; 44 | this.headerValue = headerValue; 45 | } 46 | 47 | @Override 48 | public Message receive() { 49 | final Message receivedMessage = wrappedMessageSource.receive(); 50 | 51 | if (receivedMessage == null) { 52 | return null; 53 | } 54 | 55 | final MessageBuilder messageBuilder = MessageBuilder.fromMessage(receivedMessage).setHeader(headerName, headerValue); 56 | return messageBuilder.build(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/si/MinimumAgeFileListFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.si; 25 | 26 | import java.io.File; 27 | import java.io.IOException; 28 | import java.io.UncheckedIOException; 29 | import java.nio.file.Files; 30 | 31 | import org.springframework.integration.file.filters.AbstractFileListFilter; 32 | 33 | 34 | /** 35 | * Spring Integration file filter that selects only files of a certain age, preventing picking files 36 | * that are being written. 37 | * 38 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 39 | */ 40 | public class MinimumAgeFileListFilter extends AbstractFileListFilter { 41 | 42 | 43 | private int minimumAge; // in milliseconds 44 | 45 | 46 | public MinimumAgeFileListFilter() { 47 | } 48 | 49 | 50 | public void setMinimumAge(final int minimumAge) { 51 | this.minimumAge= minimumAge; 52 | } 53 | 54 | @Override 55 | public boolean accept(final File file) { 56 | try { 57 | final var path= file.toPath(); 58 | return (Files.exists(path) 59 | && Files.getLastModifiedTime(path).toMillis() < System.currentTimeMillis() - this.minimumAge); 60 | } 61 | catch (final IOException e) { 62 | throw new UncheckedIOException(e); 63 | } 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/stats/JobStatisticsHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.stats; 25 | 26 | import java.util.Calendar; 27 | import java.util.Map; 28 | 29 | import eu.openanalytics.rsb.message.Job; 30 | 31 | 32 | /** 33 | * Defines a handler for RSB job statistics. 34 | * 35 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 36 | */ 37 | public interface JobStatisticsHandler 38 | { 39 | void setConfiguration(Map configuration); 40 | 41 | void initialize(); 42 | 43 | void destroy(); 44 | 45 | void storeJobStatistics(Job job, 46 | Calendar jobCompletionTime, 47 | long millisecondsSpentProcessing, 48 | String rServiAddress); 49 | } 50 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/stats/JobStatisticsHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.stats; 25 | 26 | import java.util.Map; 27 | 28 | import org.springframework.beans.BeanUtils; 29 | 30 | 31 | /** 32 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 33 | */ 34 | public abstract class JobStatisticsHandlerFactory { 35 | 36 | private JobStatisticsHandlerFactory() { 37 | throw new UnsupportedOperationException("do not instantiate"); 38 | } 39 | 40 | public static JobStatisticsHandler create(final Class clazz, final Map configuration) { 41 | if (clazz == null) { 42 | return NoopJobStatisticsHandler.INSTANCE; 43 | } 44 | 45 | final JobStatisticsHandler jobStatisticsHandler = BeanUtils.instantiateClass(clazz); 46 | jobStatisticsHandler.setConfiguration(configuration); 47 | return jobStatisticsHandler; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /rsb/src/main/java/eu/openanalytics/rsb/stats/NoopJobStatisticsHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.stats; 25 | 26 | import java.util.Calendar; 27 | import java.util.Map; 28 | 29 | import eu.openanalytics.rsb.message.Job; 30 | 31 | 32 | /** 33 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 34 | */ 35 | public class NoopJobStatisticsHandler implements JobStatisticsHandler 36 | { 37 | public final static NoopJobStatisticsHandler INSTANCE = new NoopJobStatisticsHandler(); 38 | 39 | private NoopJobStatisticsHandler() 40 | { 41 | // use singleton 42 | } 43 | 44 | @Override 45 | public void storeJobStatistics(final Job job, 46 | final Calendar jobCompletionTime, 47 | final long millisecondsSpentProcessing, 48 | final String rServiAddress) 49 | { 50 | // NOOP 51 | } 52 | 53 | @Override 54 | public void setConfiguration(final Map configuration) 55 | { 56 | // NOOP 57 | } 58 | 59 | @Override 60 | public void initialize() 61 | { 62 | // NOOP 63 | } 64 | 65 | @Override 66 | public void destroy() 67 | { 68 | // NOOP 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /rsb/src/main/resources/META-INF/spring/activemq-beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 29 | 30 | 33 | 34 | 39 | 40 | 43 | 44 | 53 | 54 | 59 | 60 | 63 | 64 | 67 | 68 | 69 | 70 | 71 | 72 | eu.openanalytics.rsb.message 73 | java.util 74 | java.net 75 | java.io 76 | sun.util.calendar 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /rsb/src/main/resources/META-INF/spring/core-beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 35 | 36 | 37 | 39 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /rsb/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /rsb/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | # 2 | # R Service Bus 3 | # 4 | # Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | # 6 | # =========================================================================== 7 | # 8 | # This file is part of R Service Bus. 9 | # 10 | # R Service Bus is free software: you can redistribute it and/or modify 11 | # it under the terms of the Apache License as published by 12 | # The Apache Software Foundation, either version 2 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # Apache License for more details. 19 | # 20 | # You should have received a copy of the Apache License 21 | # along with R Service Bus. If not, see . 22 | # 23 | job.error=The job Id $job.jobId$ submitted on $job.submissionTime.time$ resulted in an error.\nPlease find the detailed error message below:\n\n$throwable.message$ 24 | directory.job.error=The job $job.meta.originalFilename$ you submitted to folder $job.meta.inboxDirectory$ on $job.submissionTime.time$ resulted in an error.\nPlease find the detailed error message below:\n\n$throwable.message$ 25 | email.job.error=The job you e-mailed to $job.meta.emailAddressee$ on $job.submissionTime.time$ resulted in an error.\nPlease find the detailed error message below:\n\n$throwable.message$ 26 | 27 | job.abort=The job Id $job.jobId$ submitted on $job.submissionTime.time$ could not be delivered to an RServi node for processing. The RSB administrator has been notified and will take up the issue. 28 | directory.job.abort=The job $job.meta.originalFilename$ you submitted to folder $job.meta.inboxDirectory$ on $job.submissionTime.time$ could not be delivered to an RServi node for processing.\nThe RSB administrator has been notified and will take up the issue. 29 | email.job.abort=The job you e-mailed to $job.meta.emailAddressee$ on $job.submissionTime.time$ could not be delivered to an RServi node for processing.\nThe RSB administrator has been notified and will take up the issue. 30 | 31 | result.abort=Permanent failure when attempting to deliver result for job Id $result.jobId$ submitted on $result.submissionTime.time$. Abandoning its delivery and leaving it in local temporary directory for analysis. 32 | 33 | email.result.body=Please find your results attached hereto.\nRSB -------------------------------------------------------------------------------- /rsb/src/main/resources/schemas/common.xsd: -------------------------------------------------------------------------------- 1 | 2 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /rsb/src/main/resources/schemas/soap-types.xsd: -------------------------------------------------------------------------------- 1 | 2 | 26 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 54 | 56 | 57 | 58 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /rsb/src/main/resources/wsdl/mtom-jobs.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 26 | 30 | 31 | 32 | 34 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | R Service Bus 7 | 8 | 9 | rsbConfiguration 10 | rsb-configuration.json 11 | 12 | 13 | 14 | contextConfigLocation 15 | classpath:META-INF/spring/*-beans.xml 16 | 17 | 18 | 19 | eu.openanalytics.rsb.config.BootstrapConfigurationServletContextListener 20 | 21 | 22 | 23 | org.springframework.web.context.ContextLoaderListener 24 | 25 | 26 | 27 | eu.openanalytics.rsb.config.RServiEnvironmentServletContextListener 28 | 29 | 30 | 31 | springSecurityFilterChain 32 | org.springframework.web.filter.DelegatingFilterProxy 33 | 34 | 35 | 41 | 42 | 43 | CxfServlet 44 | org.apache.cxf.transport.servlet.CXFServlet 45 | 1 46 | 47 | 48 | CxfServlet 49 | /api/* 50 | 51 | 52 | 53 | 54 | *.html 55 | UTF-8 56 | text/html; charset=UTF-8 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/blackbird_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/blackbird_icons.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/blackbird_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/blackbird_panel.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/open_analytics_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/open_analytics_logo.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/jstree-classic/d.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/jstree-classic/d.gif -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/jstree-classic/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/jstree-classic/d.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/jstree-classic/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/jstree-classic/dot_for_ie.gif -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/jstree-classic/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/css/jstree-classic/throbber.gif -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/openid.css: -------------------------------------------------------------------------------- 1 | /* 2 | Simple OpenID Plugin 3 | http://code.google.com/p/openid-selector/ 4 | 5 | This code is licensed under the New BSD License. 6 | */ 7 | 8 | #openid_form { 9 | width: 580px; 10 | } 11 | 12 | #openid_form legend { 13 | font-weight: bold; 14 | } 15 | 16 | #openid_choice { 17 | display: none; 18 | } 19 | 20 | #openid_input_area { 21 | clear: both; 22 | padding: 10px; 23 | } 24 | 25 | #openid_btns, #openid_btns br { 26 | clear: both; 27 | } 28 | 29 | #openid_highlight { 30 | padding: 3px; 31 | background-color: #FFFCC9; 32 | float: left; 33 | } 34 | 35 | .openid_large_btn { 36 | width: 100px; 37 | height: 60px; 38 | /* fix for IE 6 only: http://en.wikipedia.org/wiki/CSS_filter#Underscore_hack */ 39 | _width: 102px; 40 | _height: 62px; 41 | 42 | border: 1px solid #DDD; 43 | margin: 3px; 44 | float: left; 45 | } 46 | 47 | .openid_small_btn { 48 | width: 24px; 49 | height: 24px; 50 | /* fix for IE 6 only: http://en.wikipedia.org/wiki/CSS_filter#Underscore_hack */ 51 | _width: 26px; 52 | _height: 26px; 53 | 54 | border: 1px solid #DDD; 55 | margin: 3px; 56 | float: left; 57 | } 58 | 59 | a.openid_large_btn:focus { 60 | outline: none; 61 | } 62 | 63 | a.openid_large_btn:focus { 64 | -moz-outline-style: none; 65 | } 66 | 67 | .openid_selected { 68 | border: 4px solid #DDD; 69 | } -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/rsb.css: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | * 23 | */ 24 | 25 | html, body { 26 | font-size: 12px; 27 | font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; 28 | padding:0; 29 | margin:0; 30 | } 31 | 32 | .box { margin: 1em } 33 | .navPanel { margin: 0 0.5em 0.5em 0.5em; } 34 | .centralPanel { margin-bottom: 1em; } 35 | .fakeLink{ color:navy; cursor:pointer; } 36 | 37 | label { width: 10em; float: left; } 38 | label.error { float: none; color: red; padding-left: .5em; vertical-align: top; } 39 | p { clear: both; } 40 | .submit { margin-left: 12em; } 41 | .footer { color:#888; text-align: center; font-size: 10px; } 42 | 43 | a.footer:link { color: #444; text-decoration: none; } 44 | a.footer:active { color: #444; text-decoration: none; } 45 | a.footer:visited { color: #444; text-decoration: none; } 46 | a.footer:hover { color: #111; text-decoration: underline; } 47 | 48 | table { 49 | text-align: center; 50 | font-size: 12px; 51 | font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; 52 | background: #c0c0c0; 53 | } 54 | 55 | table thead tr, 56 | table tfoot tr { 57 | background: #c0c0c0; 58 | } 59 | 60 | table tbody tr { 61 | background: #f0f0f0; 62 | } 63 | .highlighted { 64 | background-color: #ffffcc; 65 | } 66 | 67 | td, th { 68 | border: 1px solid white; 69 | } 70 | 71 | #desktop { background-color:#eee; padding:1.5em; padding-bottom:3em; color:#444; } 72 | 73 | #container{ 74 | margin:0; padding:0; 75 | } 76 | 77 | #lCenter{ 78 | padding:1em; 79 | padding-top:0; 80 | overflow:hidden; 81 | } 82 | 83 | #lLeft{ 84 | float: left; 85 | } 86 | 87 | #lRight{ 88 | float: right; 89 | } 90 | 91 | .alignRight { 92 | float: right; 93 | position:relative; 94 | } 95 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/css/ui.panel.css: -------------------------------------------------------------------------------- 1 | /* Panel 2 | ----------------------------------*/ 3 | .ui-panel {text-align:left;z-index:1;} 4 | .ui-panel-header {margin:0;padding:0;width:100%;} 5 | .ui-panel-header .ui-icon {border:0;float:left;margin-top:0.2em;} 6 | .ui-panel-title {margin:0.3em 0;} 7 | .ui-panel-title-text {margin-left:0.3em;} 8 | .ui-panel-title-text,.ui-panel .ui-icon {cursor:pointer;} 9 | .ui-panel-rightbox {float:right;} 10 | .ui-panel-rightbox .ui-icon {margin-right:0.1em;} 11 | .ui-panel-controls {float:left;margin:0.2em 0.7em 0 0;} 12 | .ui-panel-content {padding:0;width:100%;border-top:0;} 13 | .ui-panel-content-text {padding:0.7em 0.4em;} 14 | .ui-panel-clps-pnl {float:left;padding:0.1em 0.25em 0.3em;position:relative;top:-0.1em;} 15 | .ui-panel-vtitle {overflow:hidden;position:relative;white-space:nowrap;} 16 | .ui-panel-vtext {display:block;} 17 | .ui-panel-vtext-ie {bottom:1.5em;filter:flipv() fliph();left:0.2em;position:absolute;writing-mode:tb-rl;} -------------------------------------------------------------------------------- /rsb/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /rsb/src/main/webapp/fragments/default-upload-form.html: -------------------------------------------------------------------------------- 1 | <%-- 2 | R Service Bus 3 | 4 | Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | 6 | =========================================================================== 7 | 8 | This file is part of R Service Bus. 9 | 10 | R Service Bus is free software: you can redistribute it and/or modify 11 | it under the terms of the Apache License as published by 12 | The Apache Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | Apache License for more details. 19 | 20 | You should have received a copy of the Apache License 21 | along with R Service Bus. If not, see . 22 | 23 | @author rsb.development@openanalytics.eu 24 | --%> 25 | 26 |

27 | 28 | 29 |

30 |
31 |

Job Submission

32 |
33 |

34 | 35 |
36 |

Optional Parameters

37 |
38 |

39 |

40 |
41 |
42 | 43 | 44 |
45 |
46 | 47 | 50 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/delete.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/directory.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/download.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/download.gif -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/drive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/drive.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/failure.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/file.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/network.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/openid-providers-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/openid-providers-en.png -------------------------------------------------------------------------------- /rsb/src/main/webapp/images/success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/main/webapp/images/success.gif -------------------------------------------------------------------------------- /rsb/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | <%-- 2 | R Service Bus 3 | 4 | Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | 6 | =========================================================================== 7 | 8 | This file is part of R Service Bus. 9 | 10 | R Service Bus is free software: you can redistribute it and/or modify 11 | it under the terms of the Apache License as published by 12 | The Apache Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | Apache License for more details. 19 | 20 | You should have received a copy of the Apache License 21 | along with R Service Bus. If not, see . 22 | 23 | @author rsb.development@openanalytics.eu 24 | --%> 25 | <% 26 | response.sendRedirect("rsb.html"); 27 | %> 28 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/js/jquery.ba-dotimeout.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery doTimeout: Like setTimeout, but better! - v1.0 - 3/3/2010 3 | * http://benalman.com/projects/jquery-dotimeout-plugin/ 4 | * 5 | * Copyright (c) 2010 "Cowboy" Ben Alman 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://benalman.com/about/license/ 8 | */ 9 | (function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var f=d.call(arguments),e=b.apply(this,[c+f[0]].concat(f));return typeof f[0]==="number"||typeof f[1]==="number"?this:e};function b(l){var m=this,h,k={},g=l?$.fn:$,n=arguments,i=4,f=n[1],j=n[2],p=n[3];if(typeof f!=="string"){i--;f=l=0;j=n[1];p=n[2]}if(l){h=m.eq(0);h.data(l,k=h.data(l)||{})}else{if(f){k=a[f]||(a[f]={})}}k.id&&clearTimeout(k.id);delete k.id;function e(){if(l){h.removeData(l)}else{if(f){delete a[f]}}}function o(){k.id=setTimeout(function(){k.fn()},j)}if(p){k.fn=function(q){if(typeof p==="string"){p=g[p]}p.apply(m,d.call(n,i))===true&&!q?o():e()};o()}else{if(k.fn){j===undefined?e():k.fn(j===false);return true}else{e()}}}})(jQuery); -------------------------------------------------------------------------------- /rsb/src/main/webapp/js/openid-en-1.3.js: -------------------------------------------------------------------------------- 1 | /* 2 | Simple OpenID Plugin 3 | http://code.google.com/p/openid-selector/ 4 | 5 | This code is licensed under the New BSD License. 6 | */ 7 | 8 | var providers_large = { 9 | google : { 10 | name : 'Google', 11 | url : 'https://www.google.com/accounts/o8/id' 12 | }, 13 | yahoo : { 14 | name : 'Yahoo', 15 | url : 'http://me.yahoo.com/' 16 | }, 17 | aol : { 18 | name : 'AOL', 19 | label : 'Enter your AOL screenname.', 20 | url : 'http://openid.aol.com/{username}' 21 | }, 22 | myopenid : { 23 | name : 'MyOpenID', 24 | label : 'Enter your MyOpenID username.', 25 | url : 'http://{username}.myopenid.com/' 26 | }, 27 | openid : { 28 | name : 'OpenID', 29 | label : 'Enter your OpenID.', 30 | url : null 31 | } 32 | }; 33 | 34 | var providers_small = { 35 | livejournal : { 36 | name : 'LiveJournal', 37 | label : 'Enter your Livejournal username.', 38 | url : 'http://{username}.livejournal.com/' 39 | }, 40 | /* flickr: { 41 | name: 'Flickr', 42 | label: 'Enter your Flickr username.', 43 | url: 'http://flickr.com/{username}/' 44 | }, */ 45 | /* technorati: { 46 | name: 'Technorati', 47 | label: 'Enter your Technorati username.', 48 | url: 'http://technorati.com/people/technorati/{username}/' 49 | }, */ 50 | wordpress : { 51 | name : 'Wordpress', 52 | label : 'Enter your Wordpress.com username.', 53 | url : 'http://{username}.wordpress.com/' 54 | }, 55 | blogger : { 56 | name : 'Blogger', 57 | label : 'Your Blogger account', 58 | url : 'http://{username}.blogspot.com/' 59 | }, 60 | verisign : { 61 | name : 'Verisign', 62 | label : 'Your Verisign username', 63 | url : 'http://{username}.pip.verisignlabs.com/' 64 | }, 65 | /* vidoop: { 66 | name: 'Vidoop', 67 | label: 'Your Vidoop username', 68 | url: 'http://{username}.myvidoop.com/' 69 | }, */ 70 | /* launchpad: { 71 | name: 'Launchpad', 72 | label: 'Your Launchpad username', 73 | url: 'https://launchpad.net/~{username}' 74 | }, */ 75 | claimid : { 76 | name : 'ClaimID', 77 | label : 'Your ClaimID username', 78 | url : 'http://claimid.com/{username}' 79 | }, 80 | clickpass : { 81 | name : 'ClickPass', 82 | label : 'Enter your ClickPass username', 83 | url : 'http://clickpass.com/public/{username}' 84 | }, 85 | google_profile : { 86 | name : 'Google Profile', 87 | label : 'Enter your Google Profile username', 88 | url : 'http://www.google.com/profiles/{username}' 89 | } 90 | }; 91 | 92 | openid.locale = 'en'; 93 | openid.sprite = 'en'; // reused in german& japan localization 94 | openid.demo_text = 'In client demo mode. Normally would have submitted OpenID:'; 95 | openid.signin_text = 'Sign-In'; 96 | openid.image_title = 'log in with {provider}'; 97 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/login.html: -------------------------------------------------------------------------------- 1 | <%-- 2 | R Service Bus 3 | 4 | Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | 6 | =========================================================================== 7 | 8 | This file is part of R Service Bus. 9 | 10 | R Service Bus is free software: you can redistribute it and/or modify 11 | it under the terms of the Apache License as published by 12 | The Apache Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | Apache License for more details. 19 | 20 | You should have received a copy of the Apache License 21 | along with R Service Bus. If not, see . 22 | 23 | @author rsb.development@openanalytics.eu 24 | --%> 25 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 26 | 27 | 28 | 29 | RSB - Login 30 | 31 | 32 | 33 | 34 | 35 | 36 |
    37 |

     RSB - R Service Bus

    38 | 39 | 40 | Your login attempt was not successful, try again.
    41 |
    42 | Reason: .
    43 |
    44 | 45 |
    46 |
    47 | Sign-in to use RSB 48 |
    49 | 50 | 51 |
    52 |
    53 | 54 | 55 |
    56 | 57 |
    58 | 59 |
    60 |
    61 |
    62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/logout.html: -------------------------------------------------------------------------------- 1 | <%-- 2 | R Service Bus 3 | 4 | Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | 6 | =========================================================================== 7 | 8 | This file is part of R Service Bus. 9 | 10 | R Service Bus is free software: you can redistribute it and/or modify 11 | it under the terms of the Apache License as published by 12 | The Apache Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | Apache License for more details. 19 | 20 | You should have received a copy of the Apache License 21 | along with R Service Bus. If not, see . 22 | 23 | @author rsb.development@openanalytics.eu 24 | --%> 25 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 26 | 27 | 28 | 29 | RSB - Logout 30 | 31 | 32 | 33 | 34 | 35 | 36 |
    37 |

     RSB - R Service Bus

    38 | 39 |

    You have been logged out. You should close your browser for security reasons.

    40 | 41 |

    Log in RSB again.

    42 |
43 | 44 | -------------------------------------------------------------------------------- /rsb/src/main/webapp/openid.html: -------------------------------------------------------------------------------- 1 | <%-- 2 | R Service Bus 3 | 4 | Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | 6 | =========================================================================== 7 | 8 | This file is part of R Service Bus. 9 | 10 | R Service Bus is free software: you can redistribute it and/or modify 11 | it under the terms of the Apache License as published by 12 | The Apache Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | Apache License for more details. 19 | 20 | You should have received a copy of the Apache License 21 | along with R Service Bus. If not, see . 22 | 23 | @author rsb.development@openanalytics.eu 24 | --%> 25 | <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> 26 | 27 | 28 | 29 | RSB - OpenID Login 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 44 | 45 |
    46 |

     RSB - R Service Bus

    47 | 48 | 49 | Your login attempt was not successful, try 50 | again.
    51 |
    52 | Reason: .
    53 |
    54 | 55 |
    57 | 58 | 59 |
    60 | Sign-in to use RSB 61 | 62 |
    63 |

    Please click your account provider:

    64 |
    65 | 66 |
    67 | 68 |
    69 | 70 | 71 |
    72 | 81 |
    82 |
    83 |
84 | 85 | -------------------------------------------------------------------------------- /rsb/src/site/resources/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/favicon.ico -------------------------------------------------------------------------------- /rsb/src/site/resources/images/Rservice-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/Rservice-diagram.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/job_workers_app_bias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/job_workers_app_bias.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/job_workers_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/job_workers_default.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/openanalytics-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/openanalytics-logo.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/rsb-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/rsb-architecture.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/wieni/banner-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/wieni/banner-bg.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/wieni/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/wieni/banner.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/wieni/body-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/wieni/body-bg.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/wieni/content-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/wieni/content-bg.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/wieni/sidebar-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/wieni/sidebar-bg.png -------------------------------------------------------------------------------- /rsb/src/site/resources/images/wieni/sidebar-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/site/resources/images/wieni/sidebar-block.png -------------------------------------------------------------------------------- /rsb/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /rsb/src/site/xdoc/admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 30 | 31 | Administration 32 | RSB Development 34 | 35 | 36 |
37 | 38 |

RSB exposes MBeans accessible with JMX locally and over RMI.

39 |

By default, the remote process URI is: service:jmx:rmi://127.0.0.1:9098/jndi/rmi://localhost:9099/myconnector

40 |
41 | 42 |

All the MBeans are also accessible over HTTP

43 |

By default, the (browsable) HTTP URL is: http://localhost:8889

44 |
45 |
46 | 47 |
-------------------------------------------------------------------------------- /rsb/src/site/xdoc/api-specs.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 28 | 29 | XSDs & WSDL 30 | RSB Development 31 | 32 | 33 |
34 | 39 |
40 |
41 | 44 |
45 | 46 |
-------------------------------------------------------------------------------- /rsb/src/site/xdoc/ha.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 28 | 29 | Reliability / HA 30 | RSB Development 31 | 32 | 33 |
34 |

Because it uses JMS queues internally and consumes messages 35 | transactionally, RSB exhibits a reliable behavior as far as guaranteed 36 | job processing and result delivery (up to the HTTP, email or file system 37 | interaction) are concerned.

38 |

In order to roll-out a highly available deployment, several instances 39 | of RSB running in parallel must be deployed. The following must be 40 | considered:

41 |
    42 |
  • RSB polls email resources: refer to this discussion for more information.

  • 43 |
  • The REST API supports network level load balancing natively: nothing 44 | particular must be done to run RSB behind an HTTP load balancer. The 45 | job URIs generated by the REST API are built by using the host name of 46 | the incoming request, which guarantees that these URIs are respectful 47 | of any network-level indirection mechanism that could exist in front 48 | of RSB.

  • 49 |
  • Each RSB node embeds a JMS provider: if an RSB node is down, all the 50 | jobs pending processing or the results pending delivery will not be 51 | accessible until the node is restarted. To be truly highly-available, 52 | the embedded JMS providers should be replaced with an external 53 | highly-available JMS provider to which all RSB nodes would connect. If 54 | this is pursued, keep in mind the following drawback (described here): 55 | RSB uses the local file system for handling multi-file jobs.

  • 56 |
57 |
58 | 59 |
-------------------------------------------------------------------------------- /rsb/src/site/xdoc/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 28 | 29 | R Service Bus 30 | RSB Development 31 | 32 | 33 |

RSB (R Service Bus) is a communication middleware and work manager for R statistic analysis jobs.

34 | 35 | 36 |
-------------------------------------------------------------------------------- /rsb/src/site/xdoc/stats.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 28 | 29 | Usage Statistics 30 | RSB Development 31 | 32 | 33 |
34 |

35 | RSB can report usage statistics on a 36 | pluggable datastore 37 | , like Redis. 38 |

39 |

The reported usage information consists in this data:

40 |
    41 |
  • UTC Timestamp
  • 42 |
  • Application Name
  • 43 |
  • Job ID
  • 44 |
  • R Servi Address
  • 45 |
  • Time Spent (in milliseconds)
  • 46 |
47 | 48 |

When stored in Redis, the RSB usage statistics are laid out this way: 49 |

50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
Key NameCollection TypeData TypeDescription
rsb:stats:applicationsSETStringUnique application names.
rsb:stats:${applicationName}:monthstampsSETStringUnique "monthstamps" (like: 2011-01).
rsb:stats:${applicationName}:${monthstamp}LISTJSON StringRSB usage information.
80 |

This allows navigation and retrieval per application and time in 81 | order to produce usage reports.

82 |
83 |
84 | 85 |
-------------------------------------------------------------------------------- /rsb/src/site/xdoc/upgrade.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 28 | 29 | Upgrading 30 | RSB Development 31 | 32 | 33 |
34 | 35 |
    36 |
  • 37 | The JobStatisticsHandler has been modified in a non backwards compatible fashion. 38 | The change is trivial: the storeJobStatistics method now takes a Job interface as a parameter from which the application name and job ID, previously passed as distinct arguments, can be retrieved. 39 |
  • 40 |
41 |
42 |
43 | 44 |
-------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/config/ConfigurationFactoryTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.config; 25 | 26 | import static org.hamcrest.CoreMatchers.is; 27 | import static org.junit.Assert.assertThat; 28 | 29 | import java.io.IOException; 30 | import java.util.Set; 31 | 32 | import org.junit.Test; 33 | 34 | 35 | /** 36 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 37 | */ 38 | public class ConfigurationFactoryTestCase 39 | { 40 | 41 | private static final String[] TEST_JSON_CONFIGURATIONS = {"rsb-configuration.json", 42 | "rsb-configuration-minimal.json", "rsb-configuration-redis.json", "rsb-configuration-pooling.json", 43 | "rsb-configuration-extended.json", "rsb-configuration-full.json"}; 44 | 45 | // full config is expected to be invalid because of missing job configuration 46 | // file, response file and data 47 | // directories 48 | private static final boolean[] VALIDATION_RESULTS = {true, true, true, true, true, false}; 49 | 50 | @Test 51 | public void validateTestJsonConfigurations() throws IOException 52 | { 53 | int i = 0; 54 | for (final String configurationFile : TEST_JSON_CONFIGURATIONS) 55 | { 56 | final Set validationResult = ConfigurationFactory.validate(ConfigurationFactory.load(Thread.currentThread() 57 | .getContextClassLoader() 58 | .getResource(configurationFile))); 59 | 60 | assertThat(configurationFile + " yielded: " + validationResult, validationResult.isEmpty(), 61 | is(VALIDATION_RESULTS[i++])); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/jaxrs/IllegalArgumentExceptionMapperTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.jaxrs; 25 | 26 | import static org.hamcrest.CoreMatchers.is; 27 | import static org.hamcrest.Matchers.containsString; 28 | import static org.junit.Assert.assertThat; 29 | 30 | import javax.ws.rs.core.Response; 31 | import javax.ws.rs.core.Response.Status; 32 | 33 | import org.junit.Test; 34 | 35 | 36 | /** 37 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 38 | */ 39 | public class IllegalArgumentExceptionMapperTestCase 40 | { 41 | @Test 42 | public void toResponse() 43 | { 44 | final IllegalArgumentExceptionMapper iaeMapper = new IllegalArgumentExceptionMapper(); 45 | 46 | final Response response = iaeMapper.toResponse(new IllegalArgumentException("test_err")); 47 | assertThat(response.getStatus(), is(Status.BAD_REQUEST.getStatusCode())); 48 | assertThat(response.getEntity().toString(), containsString("test_err")); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/message/JsonFunctionCallJobTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import static org.hamcrest.CoreMatchers.is; 27 | import static org.hamcrest.CoreMatchers.notNullValue; 28 | import static org.junit.Assert.assertThat; 29 | 30 | import java.util.GregorianCalendar; 31 | import java.util.Map; 32 | import java.util.UUID; 33 | 34 | import org.junit.Before; 35 | import org.junit.Test; 36 | 37 | import eu.openanalytics.rsb.Util; 38 | import eu.openanalytics.rsb.message.AbstractWorkItem.Source; 39 | 40 | 41 | /** 42 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 43 | */ 44 | public class JsonFunctionCallJobTestCase 45 | { 46 | 47 | private JsonFunctionCallJob jsonFunctionCallJob; 48 | 49 | @Before 50 | public void prepareTest() 51 | { 52 | jsonFunctionCallJob = new JsonFunctionCallJob(Source.REST, "appName", null, UUID.randomUUID(), 53 | (GregorianCalendar) GregorianCalendar.getInstance(), "\\\"fake_job\\\""); 54 | } 55 | 56 | @Test 57 | public void getFunctionName() 58 | { 59 | assertThat(jsonFunctionCallJob.getFunctionName(), notNullValue()); 60 | } 61 | 62 | @Test 63 | public void buildSuccessResultString() 64 | { 65 | final JsonFunctionCallResult xmlFunctionCallResult = jsonFunctionCallJob.buildSuccessResult("\\\"fake_result\\\""); 66 | assertThat(xmlFunctionCallResult, notNullValue()); 67 | assertThat(xmlFunctionCallResult.isSuccess(), is(true)); 68 | } 69 | 70 | @Test 71 | public void buildErrorResultThrowable() throws Exception 72 | { 73 | final JsonFunctionCallResult xmlFunctionCallResult = jsonFunctionCallJob.buildErrorResult( 74 | new RuntimeException("simulated error"), null); 75 | assertThat(xmlFunctionCallResult, notNullValue()); 76 | assertThat(xmlFunctionCallResult.isSuccess(), is(false)); 77 | assertThat(Util.fromJson(xmlFunctionCallResult.getPayload(), Map.class), notNullValue()); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/message/XmlFunctionCallJobTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.message; 25 | 26 | import static org.custommonkey.xmlunit.XMLAssert.assertXpathEvaluatesTo; 27 | import static org.hamcrest.CoreMatchers.is; 28 | import static org.hamcrest.CoreMatchers.notNullValue; 29 | import static org.junit.Assert.assertThat; 30 | 31 | import java.util.GregorianCalendar; 32 | import java.util.UUID; 33 | 34 | import org.junit.Before; 35 | import org.junit.Test; 36 | 37 | import eu.openanalytics.rsb.message.AbstractWorkItem.Source; 38 | 39 | 40 | /** 41 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 42 | */ 43 | public class XmlFunctionCallJobTestCase 44 | { 45 | 46 | private XmlFunctionCallJob xmlFunctionCallJob; 47 | 48 | @Before 49 | public void prepareTest() 50 | { 51 | xmlFunctionCallJob = new XmlFunctionCallJob(Source.REST, "app_name", null, UUID.randomUUID(), 52 | (GregorianCalendar) GregorianCalendar.getInstance(), ""); 53 | } 54 | 55 | @Test 56 | public void getFunctionName() 57 | { 58 | assertThat(xmlFunctionCallJob.getFunctionName(), notNullValue()); 59 | } 60 | 61 | @Test 62 | public void buildSuccessResultString() 63 | { 64 | final XmlFunctionCallResult xmlFunctionCallResult = xmlFunctionCallJob.buildSuccessResult(""); 65 | assertThat(xmlFunctionCallResult, notNullValue()); 66 | assertThat(xmlFunctionCallResult.isSuccess(), is(true)); 67 | } 68 | 69 | @Test 70 | public void buildErrorResultThrowable() throws Exception 71 | { 72 | final XmlFunctionCallResult xmlFunctionCallResult = xmlFunctionCallJob.buildErrorResult( 73 | new RuntimeException("simulated error"), null); 74 | assertThat(xmlFunctionCallResult, notNullValue()); 75 | assertThat(xmlFunctionCallResult.isSuccess(), is(false)); 76 | assertXpathEvaluatesTo("errorResult", "name(/node())", xmlFunctionCallResult.getPayload()); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/security/IdentifiedUserDetailsServiceTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.security; 25 | 26 | import static org.hamcrest.CoreMatchers.is; 27 | import static org.junit.Assert.assertThat; 28 | 29 | import org.junit.Before; 30 | import org.junit.Test; 31 | import org.springframework.security.core.userdetails.UserDetails; 32 | 33 | 34 | /** 35 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 36 | */ 37 | public class IdentifiedUserDetailsServiceTestCase 38 | { 39 | private static final String TEST_USER_NAME = "test_123"; 40 | private static final String TEST_RAW_USER_NAME = "test@123"; 41 | 42 | private IdentifiedUserDetailsService identifiedUserDetailsService; 43 | 44 | @Before 45 | public void setUp() 46 | { 47 | identifiedUserDetailsService = new IdentifiedUserDetailsService(); 48 | } 49 | 50 | @Test 51 | public void noGrantedAuthorities() 52 | { 53 | identifiedUserDetailsService.initializeGrantedAuthorities(); 54 | 55 | final UserDetails userDetails = identifiedUserDetailsService.loadUserByUsername(TEST_RAW_USER_NAME); 56 | 57 | assertThat(userDetails.getUsername(), is(TEST_USER_NAME)); 58 | assertThat(userDetails.getAuthorities().size(), is(0)); 59 | } 60 | 61 | @Test 62 | public void oneGrantedAuthorities() 63 | { 64 | identifiedUserDetailsService.setConfiguredAuthorities("auth1"); 65 | identifiedUserDetailsService.initializeGrantedAuthorities(); 66 | 67 | final UserDetails userDetails = identifiedUserDetailsService.loadUserByUsername(TEST_RAW_USER_NAME); 68 | 69 | assertThat(userDetails.getUsername(), is(TEST_USER_NAME)); 70 | assertThat(userDetails.getAuthorities().size(), is(1)); 71 | } 72 | 73 | @Test 74 | public void moreThanOneGrantedAuthorities() 75 | { 76 | identifiedUserDetailsService.setConfiguredAuthorities("auth1,auth2 auth3 , auth4"); 77 | identifiedUserDetailsService.initializeGrantedAuthorities(); 78 | 79 | final UserDetails userDetails = identifiedUserDetailsService.loadUserByUsername(TEST_RAW_USER_NAME); 80 | 81 | assertThat(userDetails.getUsername(), is(TEST_USER_NAME)); 82 | assertThat(userDetails.getAuthorities().size(), is(4)); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/si/HeaderSettingMessageSourceWrapperTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.si; 25 | 26 | import static org.hamcrest.CoreMatchers.is; 27 | import static org.hamcrest.CoreMatchers.nullValue; 28 | import static org.junit.Assert.assertThat; 29 | import static org.mockito.Mockito.when; 30 | 31 | import org.junit.Before; 32 | import org.junit.Test; 33 | import org.junit.runner.RunWith; 34 | import org.mockito.Mock; 35 | import org.mockito.runners.MockitoJUnitRunner; 36 | import org.springframework.integration.core.MessageSource; 37 | import org.springframework.integration.support.MessageBuilder; 38 | import org.springframework.messaging.Message; 39 | 40 | 41 | /** 42 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 43 | */ 44 | @RunWith(MockitoJUnitRunner.class) 45 | public class HeaderSettingMessageSourceWrapperTestCase { 46 | 47 | private static final String TEST_HEADER_NAME = "test-header-name"; 48 | private static final Object TEST_HEADER_VALUE = new Object(); 49 | 50 | @Mock 51 | private MessageSource wrappedMessageSource; 52 | 53 | private HeaderSettingMessageSourceWrapper headerSettingMessageSourceWrapper; 54 | 55 | @Before 56 | public void prepareWrapper() { 57 | headerSettingMessageSourceWrapper = new HeaderSettingMessageSourceWrapper<>(wrappedMessageSource, TEST_HEADER_NAME, 58 | TEST_HEADER_VALUE); 59 | } 60 | 61 | @Test 62 | public void receiveNotNull() { 63 | final String payload = "test-payload"; 64 | when(wrappedMessageSource.receive()).thenReturn(MessageBuilder.withPayload(payload).build()); 65 | 66 | final Message message = headerSettingMessageSourceWrapper.receive(); 67 | 68 | assertThat(message.getPayload(), is(payload)); 69 | assertThat(message.getHeaders().get(TEST_HEADER_NAME), is(TEST_HEADER_VALUE)); 70 | } 71 | 72 | @Test 73 | public void receiveNull() { 74 | when(wrappedMessageSource.receive()).thenReturn(null); 75 | 76 | assertThat(headerSettingMessageSourceWrapper.receive(), is(nullValue())); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/si/MinimumAgeFileListFilterTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.si; 25 | 26 | import static org.hamcrest.CoreMatchers.is; 27 | import static org.junit.Assert.assertThat; 28 | 29 | import java.io.File; 30 | import java.io.IOException; 31 | 32 | import org.junit.Before; 33 | import org.junit.Test; 34 | 35 | 36 | /** 37 | * @author "Open Analytics <rsb.development@openanalytics.eu>" 38 | */ 39 | public class MinimumAgeFileListFilterTestCase { 40 | 41 | 42 | private File testFile; 43 | 44 | private MinimumAgeFileListFilter filter; 45 | 46 | 47 | public MinimumAgeFileListFilterTestCase() { 48 | } 49 | 50 | 51 | @Before 52 | public void prepareTest() throws IOException { 53 | this.filter= new MinimumAgeFileListFilter(); 54 | this.filter.setMinimumAge(10000); 55 | 56 | this.testFile= File.createTempFile("MinimumAgeFileListFilterTestCase", null); 57 | } 58 | 59 | @Test 60 | public void acceptFile() { 61 | this.testFile.setLastModified(0); 62 | assertThat(this.filter.accept(this.testFile), is(true)); 63 | } 64 | 65 | @Test 66 | public void rejectFile() { 67 | this.testFile.setLastModified(System.currentTimeMillis()); 68 | assertThat(this.filter.accept(this.testFile), is(false)); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/test/ComparisonFailureWithDetail.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.test; 25 | 26 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 27 | import org.eclipse.statet.jcommons.lang.Nullable; 28 | 29 | import junit.framework.ComparisonFailure; 30 | 31 | 32 | @NonNullByDefault 33 | public class ComparisonFailureWithDetail extends ComparisonFailure { 34 | 35 | 36 | private static final long serialVersionUID= 1L; 37 | 38 | 39 | private final @Nullable String detail; 40 | 41 | 42 | public ComparisonFailureWithDetail(final String message, 43 | final @Nullable String expected, final @Nullable String actual, 44 | final @Nullable String detail) { 45 | super(message, expected, actual); 46 | this.detail= detail; 47 | } 48 | 49 | 50 | @Override 51 | public String getMessage() { 52 | final String message= super.getMessage(); 53 | final String detail= this.detail; 54 | if (detail != null) { 55 | return message + "\n=== error detail: ===\n" + detail; 56 | } 57 | return message; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /rsb/src/test/java/eu/openanalytics/rsb/test/TestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * R Service Bus 3 | * 4 | * Copyright (c) Copyright of Open Analytics NV, 2010-2023 5 | * 6 | * =========================================================================== 7 | * 8 | * This file is part of R Service Bus. 9 | * 10 | * R Service Bus is free software: you can redistribute it and/or modify 11 | * it under the terms of the Apache License as published by 12 | * The Apache Software Foundation, either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * Apache License for more details. 19 | * 20 | * You should have received a copy of the Apache License 21 | * along with R Service Bus. If not, see . 22 | */ 23 | 24 | package eu.openanalytics.rsb.test; 25 | 26 | import static org.eclipse.statet.jcommons.lang.ObjectUtils.nonNullAssert; 27 | 28 | import java.io.IOException; 29 | import java.io.InputStream; 30 | import java.lang.StackWalker.StackFrame; 31 | import java.net.URISyntaxException; 32 | import java.nio.file.Files; 33 | import java.nio.file.Path; 34 | 35 | import org.eclipse.statet.jcommons.lang.NonNullByDefault; 36 | 37 | 38 | @NonNullByDefault 39 | public class TestUtils { 40 | 41 | 42 | private static final Path TEMP_DIRECTORY; 43 | private static final int RSB_PREFIX_LENGTH= "eu.openanalytics.rsb.".length(); 44 | static { 45 | try { 46 | TEMP_DIRECTORY= Files.createTempDirectory("rsb-test-"); 47 | } 48 | catch (final IOException e) { 49 | throw new RuntimeException(e); 50 | } 51 | } 52 | 53 | public static Path getTempDirectory() { 54 | return TEMP_DIRECTORY; 55 | } 56 | 57 | public static Path createTestDirectory() throws IOException { 58 | final StackFrame stackFrame= StackWalker.getInstance().walk((stream) -> stream.skip(1) 59 | .findFirst().get()); 60 | final String name= stackFrame.getClassName().substring(RSB_PREFIX_LENGTH) 61 | + '.' + stackFrame.getMethodName(); 62 | final Path directory= TEMP_DIRECTORY.resolve(name); 63 | 64 | Files.createDirectories(directory); 65 | 66 | return directory; 67 | } 68 | 69 | 70 | public static Path getTestDataFile(final String fileName) { 71 | try { 72 | final var loader= nonNullAssert(Thread.currentThread().getContextClassLoader()); 73 | return Path.of(loader.getResource("data/" + fileName).toURI()); 74 | } 75 | catch (final URISyntaxException e) { 76 | throw new RuntimeException(e); 77 | } 78 | } 79 | 80 | public static InputStream getTestDataStream(final String fileName) { 81 | final var loader= nonNullAssert(Thread.currentThread().getContextClassLoader()); 82 | return nonNullAssert(loader.getResourceAsStream("data/" + fileName)); 83 | } 84 | 85 | 86 | private TestUtils() { 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /rsb/src/test/resources/data/fake-package.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/data/fake-package.tar.gz -------------------------------------------------------------------------------- /rsb/src/test/resources/data/fake_data.dat: -------------------------------------------------------------------------------- 1 | a 2 | b 3 | c 4 | 5 | -------------------------------------------------------------------------------- /rsb/src/test/resources/data/invalid-job-subdir.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/data/invalid-job-subdir.zip -------------------------------------------------------------------------------- /rsb/src/test/resources/data/r-job-catalog-ref.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/data/r-job-catalog-ref.zip -------------------------------------------------------------------------------- /rsb/src/test/resources/data/r-job-data-only.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/data/r-job-data-only.zip -------------------------------------------------------------------------------- /rsb/src/test/resources/data/r-job-meta-required-lc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/data/r-job-meta-required-lc.zip -------------------------------------------------------------------------------- /rsb/src/test/resources/data/r-job-meta-required.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/data/r-job-meta-required.zip -------------------------------------------------------------------------------- /rsb/src/test/resources/data/r-job-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "RFunction": "allPossibleCombinations", 3 | "n": 5, 4 | "m": 2 5 | } 6 | -------------------------------------------------------------------------------- /rsb/src/test/resources/data/r-job-sample.xml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 27 | provideMeansAndPlotPerDosageGroup 28 | 29 | plotColorblue 30 | nrOfDimensions2 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 20.000 42 | 26 43 | 654487 44 | 578 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /rsb/src/test/resources/data/r-job-sample.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/data/r-job-sample.zip -------------------------------------------------------------------------------- /rsb/src/test/resources/data/test-configuration.txt: -------------------------------------------------------------------------------- 1 | rScript=test.R -------------------------------------------------------------------------------- /rsb/src/test/resources/data/test-email-response.txt: -------------------------------------------------------------------------------- 1 | TEST RESPONSE! -------------------------------------------------------------------------------- /rsb/src/test/resources/data/test.R: -------------------------------------------------------------------------------- 1 | pdf(file = "rnorm.pdf") 2 | plot(rnorm(234)) 3 | dev.off() 4 | -------------------------------------------------------------------------------- /rsb/src/test/resources/data/testSweave.R: -------------------------------------------------------------------------------- 1 | # Example Script to process a Sweave file 2 | # 3 | # Author: Tobias Verbeke 4 | ############################################################################### 5 | 6 | # process Sweave file in R 7 | Sweave("testSweave.Rnw") 8 | 9 | # compile .tex file into .pdf (using pdfLaTeX) 10 | library(tools) 11 | texi2dvi(file = "testSweave.tex", pdf = TRUE, clean = TRUE) 12 | 13 | # remove some more files that should not be part of output zip file 14 | figureFiles <- list.files(".", pattern = "testSweave-") 15 | unlink(c("testSweave.tex", figureFiles)) 16 | 17 | 18 | -------------------------------------------------------------------------------- /rsb/src/test/resources/data/testSweave.Rnw: -------------------------------------------------------------------------------- 1 | % 2 | \documentclass[a4paper]{article} 3 | \usepackage[OT1]{fontenc} 4 | \usepackage{Sweave} 5 | \begin{document} 6 | 7 | \title{Example Sweave Document} 8 | \author{Tobias Verbeke} 9 | 10 | \maketitle 11 | 12 | \section{Introduction} 13 | 14 | <>= 15 | model <- lm(dist ~ speed, data = cars) 16 | @ 17 | 18 | <>= 19 | plot(model, which = 1) 20 | @ 21 | 22 | 23 | 24 | \end{document} 25 | -------------------------------------------------------------------------------- /rsb/src/test/resources/rsb-configuration-default.json: -------------------------------------------------------------------------------- 1 | { 2 | "activeMqWorkDirectory" : "$RSB_HOME$/activemq", 3 | "applicationAwareCatalog" : false, 4 | "catalogRootDirectory" : "$RSB_HOME$/catalog", 5 | "checkHealthOnStart" : false, 6 | "defaultRserviPoolUri" : "rmi://127.0.0.1/rpooli-pool", 7 | "jobTimeOut" : 600000, 8 | "numberOfConcurrentJobWorkersPerQueue" : 5, 9 | "propagateSecurityContext" : false, 10 | "resultsDirectory" : "$RSB_HOME$/results", 11 | "smtpConfiguration" : { 12 | "host" : "localhost", 13 | "password" : "", 14 | "port" : 25, 15 | "username" : "" 16 | } 17 | } -------------------------------------------------------------------------------- /rsb/src/test/resources/rsb-configuration-minimal.json: -------------------------------------------------------------------------------- 1 | { 2 | "catalogRootDirectory": "/tmp/.rsb/catalog", 3 | "activeMqWorkDirectory": "/tmp/.rsb/activemq", 4 | "defaultRserviPoolUri": "rmi://127.0.0.1/rpooli-pool", 5 | "jobTimeOut": 600000, 6 | "numberOfConcurrentJobWorkersPerQueue": 5, 7 | "resultsDirectory": "/tmp/.rsb/results", 8 | "smtpConfiguration": { 9 | "host": "localhost", "port": 25, "username": "", "password": "" 10 | } 11 | } -------------------------------------------------------------------------------- /rsb/src/test/resources/rsb-configuration-pooling.json: -------------------------------------------------------------------------------- 1 | { 2 | "catalogRootDirectory": "/tmp/.rsb/catalog", 3 | "activeMqWorkDirectory": "/tmp/.rsb/activemq", 4 | "defaultRserviPoolUri": "rmi://127.0.0.1/rpooli-pool", 5 | "jobTimeOut": 600000, 6 | "numberOfConcurrentJobWorkersPerQueue": 5, 7 | "resultsDirectory": "/tmp/.rsb/results", 8 | "smtpConfiguration": { 9 | "host": "localhost", "port": 25, "username": "", "password": "" 10 | }, 11 | "jobStatisticsHandlerConfiguration" : { 12 | "className": "eu.openanalytics.rsb.stats.RedisJobStatisticsHandler", 13 | "parameters": { 14 | "host": "localhost", 15 | "port": 6379 16 | } 17 | }, 18 | "rServiClientPoolConfig" : { 19 | "maxActive" : 10, 20 | "maxIdle" : 8, 21 | "minIdle" : 5 22 | } 23 | } -------------------------------------------------------------------------------- /rsb/src/test/resources/rsb-configuration-redis.json: -------------------------------------------------------------------------------- 1 | { 2 | "catalogRootDirectory": "/tmp/.rsb/catalog", 3 | "activeMqWorkDirectory": "/tmp/.rsb/activemq", 4 | "defaultRserviPoolUri": "rmi://127.0.0.1/rpooli-pool", 5 | "jobTimeOut": 600000, 6 | "numberOfConcurrentJobWorkersPerQueue": 5, 7 | "resultsDirectory": "/tmp/.rsb/results", 8 | "smtpConfiguration": { 9 | "host": "localhost", "port": 25, "username": "", "password": "" 10 | }, 11 | "jobStatisticsHandlerConfiguration" : { 12 | "className": "eu.openanalytics.rsb.stats.RedisJobStatisticsHandler", 13 | "parameters": { 14 | "host": "localhost", 15 | "port": 6379 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /rsb/src/test/resources/rsb-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "catalogRootDirectory": "/tmp/.rsb/catalog", 3 | "activeMqWorkDirectory": "/tmp/.rsb/activemq", 4 | "defaultRserviPoolUri": "rmi://127.0.0.1/rpooli-pool", 5 | "jobTimeOut": 600000, 6 | "numberOfConcurrentJobWorkersPerQueue": 5, 7 | "resultsDirectory": "/tmp/.rsb/results", 8 | "depositRootDirectories": [ 9 | { 10 | "rootDirectory": "/tmp/.rsb/deposit/lab-equipment", 11 | "applicationName": "lab", 12 | "pollingPeriod": 10000 13 | } 14 | ], 15 | "smtpConfiguration": { 16 | "host": "localhost", "port": 25, "username": "", "password": "" 17 | } 18 | } -------------------------------------------------------------------------------- /rsb/src/test/resources/sertest/MultiFilesJob-6.4-1.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/sertest/MultiFilesJob-6.4-1.ser -------------------------------------------------------------------------------- /rsb/src/test/resources/sertest/MultiFilesResult-6.4-1.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openanalytics/RSB/2f3081aa5c295b01230c5b239ddaf7e11afe906f/rsb/src/test/resources/sertest/MultiFilesResult-6.4-1.ser --------------------------------------------------------------------------------