From: vasary.daniel Date: Tue, 4 May 2021 18:22:12 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=aa44edffb0b49173ef5169fdc6f23c52e7559507;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32223 --- diff --git a/server/-configuration/run-mediacube-server-hirtv.launch b/server/-configuration/run-mediacube-server-hirtv.launch index 423db869..a27365a6 100644 --- a/server/-configuration/run-mediacube-server-hirtv.launch +++ b/server/-configuration/run-mediacube-server-hirtv.launch @@ -36,6 +36,7 @@ + diff --git a/server/-configuration/run-mediacube-server-local.launch b/server/-configuration/run-mediacube-server-local.launch index 049fba25..ff249010 100644 --- a/server/-configuration/run-mediacube-server-local.launch +++ b/server/-configuration/run-mediacube-server-local.launch @@ -20,7 +20,7 @@ - + @@ -36,6 +36,7 @@ + diff --git a/server/-configuration/run-mediacube-server-mv.launch b/server/-configuration/run-mediacube-server-mv.launch index 2e8ba611..5e4df1ae 100644 --- a/server/-configuration/run-mediacube-server-mv.launch +++ b/server/-configuration/run-mediacube-server-mv.launch @@ -36,6 +36,7 @@ + diff --git a/server/-dependencies/jobengine.target b/server/-dependencies/jobengine.target index 61e35124..a5fdee1c 100644 --- a/server/-dependencies/jobengine.target +++ b/server/-dependencies/jobengine.target @@ -91,6 +91,7 @@ + win32 diff --git a/server/-dependencies/pom.xml b/server/-dependencies/pom.xml index 35500f6c..3ac7c4d0 100644 --- a/server/-dependencies/pom.xml +++ b/server/-dependencies/pom.xml @@ -98,7 +98,10 @@ org.eclipse.platform:org.eclipse.equinox.launcher:1.3.201 - net.java.dev.jna:jna:4.2.0 + net.java.dev.jna:jna:5.8.0 + + + net.java.dev.jna:jna-platform:5.8.0 io.humble:humble-video-all:0.2.1 diff --git a/server/-product/mediacube.product b/server/-product/mediacube.product index d5d522e3..d61a7e99 100644 --- a/server/-product/mediacube.product +++ b/server/-product/mediacube.product @@ -13,7 +13,6 @@ - @@ -37,6 +36,7 @@ + diff --git a/server/-product/pom.xml b/server/-product/pom.xml index 3a81fbec..cdc779fa 100644 --- a/server/-product/pom.xml +++ b/server/-product/pom.xml @@ -35,6 +35,7 @@ + diff --git a/server/-product/production/AMC/jobs/executors.xml b/server/-product/production/AMC/jobs/executors.xml index 17e61057..4e6b6822 100644 --- a/server/-product/production/AMC/jobs/executors.xml +++ b/server/-product/production/AMC/jobs/executors.xml @@ -1,5 +1,6 @@ + diff --git a/server/-product/production/AMC/jobs/schedules.json b/server/-product/production/AMC/jobs/schedules.json index 622f4da7..822c1905 100644 --- a/server/-product/production/AMC/jobs/schedules.json +++ b/server/-product/production/AMC/jobs/schedules.json @@ -1,5 +1,19 @@ {"joblist":[ { + "template": "sync-subtitles.xml", + "name" : "Feliratok szinkronizálása", + "parameters": [ + {"name": "sourceFolder", "value": "y:\\IBMS_Rundowns", "type": "java.lang.String"}, + { + "name": "filter", + "value": { + "fileName": ".*\\.(txt)$" + }, + "type": "com.ibm.nosql.json.api.BasicDBObject" + } + ] + }, + { "template": "server-status-report.xml", "name" : "MediaCube státusz", "active": true, diff --git a/server/-product/production/HIRTV/configuration/config.ini b/server/-product/production/HIRTV/configuration/config.ini deleted file mode 100644 index 702342e6..00000000 --- a/server/-product/production/HIRTV/configuration/config.ini +++ /dev/null @@ -1,9 +0,0 @@ -#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser -#Sun Apr 18 21:25:34 CEST 2021 -osgi.bundles=reference\:file\:cglib_2.2.2.jar@4,reference\:file\:com.fasterxml.jackson.core.jackson-annotations_2.4.5.jar@4,reference\:file\:com.fasterxml.jackson.core.jackson-core_2.4.5.jar@4,reference\:file\:com.fasterxml.jackson.core.jackson-databind_2.4.5.jar@4,reference\:file\:com.fasterxml.jackson.dataformat.jackson-dataformat-yaml_2.4.5.jar@4,reference\:file\:com.fasterxml.jackson.datatype.jackson-datatype-joda_2.4.5.jar@4,reference\:file\:com.fasterxml.jackson.jaxrs.jackson-jaxrs-base_2.4.5.jar@4,reference\:file\:com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider_2.4.5.jar@4,reference\:file\:com.fasterxml.jackson.module.jackson-module-jaxb-annotations_2.4.5.jar@4,reference\:file\:com.ibm.db2.jcc_1.4.0.jar@4,reference\:file\:com.ibm.nosql_4.19.26.jar@4,reference\:file\:com.microsoft.sqlserver.sqljdbc_6.0.8112.100.jar@4,reference\:file\:com.sun.jna_4.2.0.jar@4,reference\:file\:groovy_3.0.3.jar@4,reference\:file\:io.humble.video-arch-x86_64-pc-linux-gnu6_0.2.1.jar@4,reference\:file\:io.humble.video-arch-x86_64-w64-mingw32_0.2.1.jar@4,reference\:file\:io.humble.video-noarch_0.2.1.jar@4,reference\:file\:javax.annotation-api_1.2.0.jar@4,reference\:file\:javax.mail_1.5.0.b01.jar@4,reference\:file\:javax.servlet-api_3.1.0.jar@4,reference\:file\:javax.ws.rs-api_2.0.1.jar@4,reference\:file\:jcifs_1.3.17.jar@4,reference\:file\:joda-time_2.2.0.jar@4,reference\:file\:junit_4.12.0.jar@4,reference\:file\:org.apache.aries.spifly.dynamic.bundle_1.0.8.jar@4,reference\:file\:org.apache.aries.util_1.0.0.jar@4,reference\:file\:org.apache.commons.beanutils_1.8.3.jar@4,reference\:file\:org.apache.commons.collections_3.2.2.jar@4,reference\:file\:org.apache.commons.digester_3.2.0.jar@4,reference\:file\:org.apache.commons.io_2.6.0.jar@4,reference\:file\:org.apache.commons.lang_2.6.0.jar@4,reference\:file\:org.apache.commons.net_3.6.0.jar@4,reference\:file\:org.apache.felix.gogo.command_0.12.0.jar@4,reference\:file\:org.apache.felix.gogo.runtime_0.12.0.jar@4,reference\:file\:org.apache.felix.gogo.shell_0.12.0.jar@4,reference\:file\:org.apache.httpcomponents.httpclient_4.2.6.jar@4,reference\:file\:org.apache.httpcomponents.httpcore_4.2.5.jar@4,reference\:file\:org.apache.logging.log4j.api_2.8.2.jar@1\:start,reference\:file\:org.apache.logging.log4j.core_2.8.2.jar@4,reference\:file\:org.apache.logging.log4j.slf4j-impl_2.8.2.jar@4,reference\:file\:org.apache.servicemix.bundles.quartz_2.3.0.2.jar@4,reference\:file\:org.eclipse.equinox.common_3.8.0.v20160509-1230.jar@2\:start,reference\:file\:org.eclipse.equinox.console_1.1.200.v20150929-1405.jar@4,reference\:file\:org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar@1\:start,reference\:file\:org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar@4,reference\:file\:org.eclipse.equinox.util_1.0.500.v20130404-1337.jar@4,reference\:file\:org.eclipse.jetty.client_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.deploy_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.http_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.io_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.osgi.boot_9.3.9.v20160517.jar@4\:start,reference\:file\:org.eclipse.jetty.schemas_3.1.0.jar@4,reference\:file\:org.eclipse.jetty.security_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.server_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.servlet_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.util_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.webapp_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.websocket.api_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.websocket.client_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.websocket.common_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.websocket.server_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.websocket.servlet_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.jetty.xml_9.3.9.v20160517.jar@4,reference\:file\:org.eclipse.osgi.services_3.2.100.v20100503.jar@4,reference\:file\:org.hamcrest.core_1.3.0.jar@4,reference\:file\:org.jboss.resteasy.client_3.0.11.Final.jar@4,reference\:file\:org.jboss.resteasy.jaxb-provider_3.0.11.Final.jar@4,reference\:file\:org.jboss.resteasy.jaxrs_3.0.11.Final.jar@4,reference\:file\:org.jboss.resteasy.jaxrs-api_3.0.11.Final.jar@4,reference\:file\:org.jmock_2.6.0.jar@4,reference\:file\:org.jmock.junit4_2.6.0.jar@4,reference\:file\:org.mybatis.mybatis_3.5.2.jar@4,reference\:file\:org.objectweb.asm_5.0.1.jar@4,reference\:file\:org.objectweb.asm.commons_5.0.1.jar@4,reference\:file\:org.objectweb.asm.tree_5.0.1.jar@4,reference\:file\:org.omnifaces_3.4.1.jar@4,reference\:file\:slf4j.api_1.7.24.jar@4,reference\:file\:slf4j.simple_1.7.2.jar@4,reference\:file\:user.commons.log4j2_1.0.0.jar@4,reference\:file\:user.commons.zk_8.0.3.jar@4,reference\:file\:user.jobengine.osgi.commons_1.0.0.jar@4\:start,reference\:file\:user.jobengine.osgi.db_1.0.0.jar@4,reference\:file\:user.jobengine.osgi.server_1.0.0.jar@4,reference\:file\:user.jobengine.osgi.services_1.0.0.jar@4,reference\:file\:user.mediacube.gui_1.0.0.jar@4,reference\:file\:user.mediacube.metadata_1.0.0.jar@4,reference\:file\:user.tsm.client_1.2.0.jar@4 -equinox.use.ds=true -osgi.bundles.defaultStartLevel=4 -osgi.framework=file\:plugins/org.eclipse.osgi_3.11.2.v20161107-1947.jar -osgi.framework.extensions= -eclipse.p2.data.area=@config.dir/../p2 -eclipse.p2.profile=DefaultProfile diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveListBuilderStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveListBuilderStep.class deleted file mode 100644 index 05b95f19..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveListBuilderStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveListBuilderStep2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveListBuilderStep2.class deleted file mode 100644 index b34dbd0f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveListBuilderStep2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveMaterialSubmitStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveMaterialSubmitStep.class deleted file mode 100644 index 0f9078bb..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveMaterialSubmitStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveRecursive.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveRecursive.class deleted file mode 100644 index c02bb531..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ArchiveRecursive.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/AttachLowresStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/AttachLowresStep.class deleted file mode 100644 index fd423b8d..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/AttachLowresStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/BatchRetrieveForkStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/BatchRetrieveForkStep.class deleted file mode 100644 index 357fa1dd..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/BatchRetrieveForkStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CancelableStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CancelableStep.class deleted file mode 100644 index 90d63392..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CancelableStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckLOWRESIntegrity.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckLOWRESIntegrity.class deleted file mode 100644 index a6576529..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckLOWRESIntegrity.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.class deleted file mode 100644 index be17a96f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckTRAFFICMissingMaterialsStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckTRAFFICMissingMaterialsStep.class deleted file mode 100644 index d438d1de..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CheckTRAFFICMissingMaterialsStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CleanupMountedLocationStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CleanupMountedLocationStep$1.class deleted file mode 100644 index 1d1e69db..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CleanupMountedLocationStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CleanupMountedLocationStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CleanupMountedLocationStep.class deleted file mode 100644 index fe8f40f9..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CleanupMountedLocationStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/Cmd$IResponseCallback.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/Cmd$IResponseCallback.class deleted file mode 100644 index d6c7f28e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/Cmd$IResponseCallback.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/Cmd.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/Cmd.class deleted file mode 100644 index 4880b7d7..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/Cmd.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CopyForArchiveNEXIOMaterialsStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CopyForArchiveNEXIOMaterialsStep.class deleted file mode 100644 index 3396c88e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CopyForArchiveNEXIOMaterialsStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.class deleted file mode 100644 index 61da4ec2..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CreateArchiveItemStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CreateArchiveItemStep.class deleted file mode 100644 index 54de7ff7..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CreateArchiveItemStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CreateMissingLowresStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CreateMissingLowresStep.class deleted file mode 100644 index 34132c3c..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/CreateMissingLowresStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DeleteFileStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DeleteFileStep.class deleted file mode 100644 index 06b9d433..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DeleteFileStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DeleteNEXIOMaterialsStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DeleteNEXIOMaterialsStep.class deleted file mode 100644 index fd1a4854..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DeleteNEXIOMaterialsStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DetectMissingLengthStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DetectMissingLengthStep.class deleted file mode 100644 index aead1a6c..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DetectMissingLengthStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DirMXFValidatorStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DirMXFValidatorStep.class deleted file mode 100644 index 625fa0f0..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DirMXFValidatorStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep$1.class deleted file mode 100644 index 66b39299..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep$2.class deleted file mode 100644 index cb195e9e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep.class deleted file mode 100644 index f7985e70..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DownloadRecordingFromNexioStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DuplicateRemoverStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DuplicateRemoverStep.class deleted file mode 100644 index a01b7572..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/DuplicateRemoverStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/EscortFiles.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/EscortFiles.class deleted file mode 100644 index 181784cf..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/EscortFiles.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FFMpeg$IProgressChanged.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FFMpeg$IProgressChanged.class deleted file mode 100644 index fd39f9b3..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FFMpeg$IProgressChanged.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FFMpeg.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FFMpeg.class deleted file mode 100644 index d472219a..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FFMpeg.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FILEZILLA_AVIDTransferToStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FILEZILLA_AVIDTransferToStep.class deleted file mode 100644 index 4671e245..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FILEZILLA_AVIDTransferToStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FILEZILLA_PASARESTORETransferToStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FILEZILLA_PASARESTORETransferToStep.class deleted file mode 100644 index 23cf93f6..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FILEZILLA_PASARESTORETransferToStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FakeSpawnStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FakeSpawnStep.class deleted file mode 100644 index c9f262e5..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FakeSpawnStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FakeStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FakeStep.class deleted file mode 100644 index b2bb2d96..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FakeStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCleanupStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCleanupStep.class deleted file mode 100644 index 7900919b..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCleanupStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCopyStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCopyStep$1.class deleted file mode 100644 index 95108c25..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCopyStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCopyStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCopyStep.class deleted file mode 100644 index 4e958dc8..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileCopyStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileValidatorStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileValidatorStep.class deleted file mode 100644 index 8bc10b63..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/FileValidatorStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ForkDownloadStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ForkDownloadStep.class deleted file mode 100644 index 607d7a60..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ForkDownloadStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ForkUploadStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ForkUploadStep.class deleted file mode 100644 index 0ff19c4a..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ForkUploadStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/GenerateMorpheusMetadataStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/GenerateMorpheusMetadataStep.class deleted file mode 100644 index cc67ae7f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/GenerateMorpheusMetadataStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/GenericArchiveCheckerStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/GenericArchiveCheckerStep.class deleted file mode 100644 index 710ad195..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/GenericArchiveCheckerStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HLSProxyStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HLSProxyStep.class deleted file mode 100644 index 35644ba1..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HLSProxyStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HSMMigrateStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HSMMigrateStep$1.class deleted file mode 100644 index 7cde1b7b..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HSMMigrateStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HSMMigrateStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HSMMigrateStep.class deleted file mode 100644 index ccab870f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HSMMigrateStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HarrisMissingMaterialCheckerStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HarrisMissingMaterialCheckerStep.class deleted file mode 100644 index 1b320871..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/HarrisMissingMaterialCheckerStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ImportMORPHEUSMissingMaterialsStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ImportMORPHEUSMissingMaterialsStep.class deleted file mode 100644 index 09b45d83..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ImportMORPHEUSMissingMaterialsStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ImportStatisticsStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ImportStatisticsStep.class deleted file mode 100644 index 15944743..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ImportStatisticsStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ItemManagerExtensions.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ItemManagerExtensions.class deleted file mode 100644 index ebfd0800..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ItemManagerExtensions.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep$1.class deleted file mode 100644 index a2659d18..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep$2.class deleted file mode 100644 index 2477f6e9..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep.class deleted file mode 100644 index 0d9d9afb..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MVCancelableStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MXFCutterStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MXFCutterStep$1.class deleted file mode 100644 index 8e7c112e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MXFCutterStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MXFCutterStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MXFCutterStep.class deleted file mode 100644 index 4aab7e54..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MXFCutterStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MediaToolStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MediaToolStep.class deleted file mode 100644 index 0e59badb..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MediaToolStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MergeStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MergeStep.class deleted file mode 100644 index f86e9ffb..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MergeStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataPersisterStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataPersisterStep.class deleted file mode 100644 index c98b7061..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataPersisterStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataTransformStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataTransformStep.class deleted file mode 100644 index 0669fbac..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataTransformStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataType.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataType.class deleted file mode 100644 index ae205ad2..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataType.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataTypeDetector.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataTypeDetector.class deleted file mode 100644 index affbeb63..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/MetadataTypeDetector.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO1TransferFromStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO1TransferFromStep.class deleted file mode 100644 index f675d484..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO1TransferFromStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO1TransferToStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO1TransferToStep.class deleted file mode 100644 index ea985122..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO1TransferToStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO2TransferFromStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO2TransferFromStep.class deleted file mode 100644 index 50d71575..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO2TransferFromStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO2TransferToStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO2TransferToStep.class deleted file mode 100644 index 74c2751f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIO2TransferToStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIOArchiveCheckerStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIOArchiveCheckerStep.class deleted file mode 100644 index 5ca56df8..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIOArchiveCheckerStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIOMetadataPersisterStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIOMetadataPersisterStep.class deleted file mode 100644 index 1408b6d5..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/NEXIOMetadataPersisterStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OctopusDataMiner.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OctopusDataMiner.class deleted file mode 100644 index 53bffb1c..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OctopusDataMiner.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OctopusDataMinerStable.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OctopusDataMinerStable.class deleted file mode 100644 index 3c7df19e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OctopusDataMinerStable.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OutputPathAndNameSelectorStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OutputPathAndNameSelectorStep$1.class deleted file mode 100644 index a3fb35d7..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OutputPathAndNameSelectorStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OutputPathAndNameSelectorStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OutputPathAndNameSelectorStep.class deleted file mode 100644 index 9b481673..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/OutputPathAndNameSelectorStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PASAPOOLTransferToStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PASAPOOLTransferToStep.class deleted file mode 100644 index 59f03dc3..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PASAPOOLTransferToStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PBQuery$MMMedia.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PBQuery$MMMedia.class deleted file mode 100644 index 2ff535ca..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PBQuery$MMMedia.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PBQuery.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PBQuery.class deleted file mode 100644 index be1b6620..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PBQuery.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PeableBeachMissingMaterialCheckerStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PeableBeachMissingMaterialCheckerStep.class deleted file mode 100644 index 61ce8605..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PeableBeachMissingMaterialCheckerStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PlanAirExtensions.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PlanAirExtensions.class deleted file mode 100644 index 14c758d6..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/PlanAirExtensions.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ProjectCleanupMountedLocationStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ProjectCleanupMountedLocationStep$1.class deleted file mode 100644 index b5e7b7d3..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ProjectCleanupMountedLocationStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ProjectCleanupMountedLocationStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ProjectCleanupMountedLocationStep.class deleted file mode 100644 index 0b8f2011..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/ProjectCleanupMountedLocationStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RecordingsArchiveItemBuilderStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RecordingsArchiveItemBuilderStep$1.class deleted file mode 100644 index c47c1b1e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RecordingsArchiveItemBuilderStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RecordingsArchiveItemBuilderStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RecordingsArchiveItemBuilderStep.class deleted file mode 100644 index e5153d36..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RecordingsArchiveItemBuilderStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RegisterUserRestoreStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RegisterUserRestoreStep.class deleted file mode 100644 index 5d1fd6e8..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RegisterUserRestoreStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RegisterVODRestoreStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RegisterVODRestoreStep.class deleted file mode 100644 index 6126346a..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/RegisterVODRestoreStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SubmitChildStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SubmitChildStep.class deleted file mode 100644 index 3a5d29e3..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SubmitChildStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SubmitDownloadStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SubmitDownloadStep.class deleted file mode 100644 index 33a61c32..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SubmitDownloadStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncOCTOPUSDataStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncOCTOPUSDataStep$1.class deleted file mode 100644 index eaf15e07..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncOCTOPUSDataStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncOCTOPUSDataStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncOCTOPUSDataStep.class deleted file mode 100644 index ac9fbc4a..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncOCTOPUSDataStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncSubtitlesStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncSubtitlesStep$1.class deleted file mode 100644 index 42b74dbe..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncSubtitlesStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncSubtitlesStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncSubtitlesStep.class deleted file mode 100644 index 09486b21..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/SyncSubtitlesStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep$1.class deleted file mode 100644 index 909eb4dc..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep$2.class deleted file mode 100644 index 24d00465..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep.class deleted file mode 100644 index 0e4de202..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMBackupStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMExtendedRetrieveStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMExtendedRetrieveStep.class deleted file mode 100644 index b7d0cb55..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMExtendedRetrieveStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep$1.class deleted file mode 100644 index ee3c4df4..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep$2.class deleted file mode 100644 index f4a241ca..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep.class deleted file mode 100644 index 39181676..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRestoreStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRetrieveMissingMaterialStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRetrieveMissingMaterialStep.class deleted file mode 100644 index 6e36708b..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMRetrieveMissingMaterialStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep$1.class deleted file mode 100644 index eff6af14..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep$2.class deleted file mode 100644 index 81ee41c9..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep.class deleted file mode 100644 index a8dfdf4a..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSimpleRestoreStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep$1.class deleted file mode 100644 index b0a49261..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep$2.class deleted file mode 100644 index db83e3c1..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep.class deleted file mode 100644 index ff76fd3f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMSystemRestoreStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMTransferFromStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMTransferFromStep.class deleted file mode 100644 index c5717393..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMTransferFromStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMTransferToStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMTransferToStep.class deleted file mode 100644 index 6c2c9a64..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMTransferToStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep$1.class deleted file mode 100644 index 122f255e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep$2.class deleted file mode 100644 index 8fb31884..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep.class deleted file mode 100644 index d6a288aa..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TSMWriterStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TestForkCancelableStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TestForkCancelableStep.class deleted file mode 100644 index 23bbe998..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TestForkCancelableStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeFFAStranStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeFFAStranStep.class deleted file mode 100644 index e10bed4f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeFFAStranStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeSELENIOStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeSELENIOStep.class deleted file mode 100644 index 3cb014b7..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeSELENIOStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeStep.class deleted file mode 100644 index d5fef16d..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TranscodeStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferFromFTPStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferFromFTPStep.class deleted file mode 100644 index ae18b920..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferFromFTPStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferFromTSMStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferFromTSMStep.class deleted file mode 100644 index fb9bf99f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferFromTSMStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferStep.class deleted file mode 100644 index a137523e..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferToFTPStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferToFTPStep.class deleted file mode 100644 index db5c97f9..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/TransferToFTPStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UpdateGhostMediaDataStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UpdateGhostMediaDataStep.class deleted file mode 100644 index 92fbb786..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UpdateGhostMediaDataStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep$1.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep$1.class deleted file mode 100644 index 29776698..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep$1.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep$2.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep$2.class deleted file mode 100644 index 4e1d33a3..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep$2.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep.class deleted file mode 100644 index befef51f..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/UploadRecordingToNexioStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/VODTransferToStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/VODTransferToStep.class deleted file mode 100644 index 5cae8136..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/VODTransferToStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/WorkerKeepAliveStep.class b/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/WorkerKeepAliveStep.class deleted file mode 100644 index ab821825..00000000 Binary files a/server/-product/production/HIRTV/jobs/executors/user/jobengine/server/steps/WorkerKeepAliveStep.class and /dev/null differ diff --git a/server/-product/production/HIRTV/mediacube.bat b/server/-product/production/HIRTV/mediacube.bat deleted file mode 100644 index ae7a1d40..00000000 --- a/server/-product/production/HIRTV/mediacube.bat +++ /dev/null @@ -1,18 +0,0 @@ -@echo off -:CHCP 65001 log4j2 elszall tole -if exist tmp rmdir tmp /s /q -mkdir tmp -java ^ --Dorg.eclipse.epp.logging.aeri.skipReports=true ^ --Declipse.ignoreApp=true ^ --Dosgi.noShutdown=true ^ --Dlog4j.configurationFile=settings/log4j2.xml ^ --Djetty.home=settings ^ --Djetty.etc.config.urls=jetty.xml ^ --Djava.io.tmpdir=tmp ^ --Dfile.encoding=UTF-8 ^ --Dgosh.home=configuration ^ --jar plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar ^ --Xms512m ^ --Xmx1024m ^ --console diff --git a/server/-product/production/HIRTV/mediacube.sh b/server/-product/production/HIRTV/mediacube.sh index 95ea39eb..4f4c54d9 100644 --- a/server/-product/production/HIRTV/mediacube.sh +++ b/server/-product/production/HIRTV/mediacube.sh @@ -1,12 +1,12 @@ -cd /opt/mediacube +cd /opt/mediacube-new rm -fr tmp/* rm -fr configuration/org.eclipse.osgi -export DSMI_CONFIG=/opt/mediacube/settings/dsm.opt +export DSMI_CONFIG=/opt/mediacube-new/settings/dsm.opt export DSMI_DIR=/opt/tivoli/tsm/client/api/bin64 -export DSMI_LOG=/opt/mediacube/log +export DSMI_LOG=/opt/mediacube-new/log export DSM_DIR=/opt/tivoli/tsm/client/api/bin64 -export LD_LIBRARY_PATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64:/opt/mediacube +export LD_LIBRARY_PATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64:/opt/mediacube-new export LIBPATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64 export SHLIB_PATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64 export TZ=NFT-1DFT,M3.5.0,M10.5.0 @@ -15,7 +15,9 @@ java \ -Dorg.eclipse.epp.logging.aeri.skipReports=true \ -Declipse.ignoreApp=true \ -Dosgi.noShutdown=true \ --Dlog4j.configurationFile=configuration/log4j2.xml \ +-Dlog4j.configurationFile=settings/log4j2.xml \ +-Dorg.eclipse.jetty.LEVEL=INFO \ +-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog \ -Djetty.home=settings/jetty \ -Djetty.etc.config.urls=jetty.xml,jetty-ssl.xml,jetty-ssl-context.xml,jetty-http.xml,jetty-https.xml \ -Djava.io.tmpdir=tmp \ @@ -23,4 +25,5 @@ java \ -Xms1024m \ -Xmx4096m \ -consoleLog \ --console 5555 +-console 5556 +#nohup ./mediacube /dev/null & diff --git a/server/-product/production/HIRTV/settings/application.yaml b/server/-product/production/HIRTV/settings/application.yaml index 5fb68d8e..3d13d1ce 100644 --- a/server/-product/production/HIRTV/settings/application.yaml +++ b/server/-product/production/HIRTV/settings/application.yaml @@ -26,15 +26,15 @@ services: host: 10.10.1.55 collection-name: test_nexioclips use-mos-gateway: true - disabled: false + disabled: true octopus: api: address: http://10.10.1.11/api/v1 user: mama password: napocska - rundowns-collection-name: rundowns - stories-collection-name: stories - folders-collection-name: storyfolders + rundowns-collection-name: rundowns-test + stories-collection-name: stories1-test + folders-collection-name: storyfolders-test jobs: validate-transfers: false copy-buffer-size: 32768 diff --git a/server/-product/production/HIRTV/settings/jetty.xml b/server/-product/production/HIRTV/settings/jetty.xml deleted file mode 100644 index 5e47cacd..00000000 --- a/server/-product/production/HIRTV/settings/jetty.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/EscortFiles.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/EscortFiles.class deleted file mode 100644 index 181784cf..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/EscortFiles.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/ItemManagerExtensions.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/ItemManagerExtensions.class deleted file mode 100644 index ebfd0800..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/ItemManagerExtensions.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataType.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataType.class deleted file mode 100644 index ae205ad2..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataType.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector$MetadataType.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector$MetadataType.class deleted file mode 100644 index 488120ee..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector$MetadataType.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector.class deleted file mode 100644 index affbeb63..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$1.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$1.class deleted file mode 100644 index 77dd877a..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$1.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$2.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$2.class deleted file mode 100644 index a4332459..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$2.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep.class b/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep.class deleted file mode 100644 index 59569e09..00000000 Binary files a/server/-product/production/LOCAL/jobs/classes/user/jobengine/server/steps/TSMRestoreStep.class and /dev/null differ diff --git a/server/-product/production/LOCAL/jobs/executors.xml b/server/-product/production/LOCAL/jobs/executors.xml index 93765d4d..a54d3fd9 100644 --- a/server/-product/production/LOCAL/jobs/executors.xml +++ b/server/-product/production/LOCAL/jobs/executors.xml @@ -1,5 +1,11 @@ + + + + + + diff --git a/server/-product/production/LOCAL/jobs/schedules.json b/server/-product/production/LOCAL/jobs/schedules.json index 5c6e7c21..8cd52ff7 100644 --- a/server/-product/production/LOCAL/jobs/schedules.json +++ b/server/-product/production/LOCAL/jobs/schedules.json @@ -1,5 +1,24 @@ {"joblist":[ { + "template": "remote-transcode.xml", + "parameters": [ + {"name": "remoteServer", "value": "http://localhost:9080", "type": "java.lang.String"}, + {"name": "transcodeTemplate", "value": "create-proxy-ffmpeg.xml", "type": "java.lang.String"}, + {"name": "jobName", "value": "Create proxy (slave process)", "type": "java.lang.String"}, + {"name": "profileName", "value": "proxy", "type": "java.lang.String"}, + {"name": "tempStoreName", "value": "LOCAL", "type": "java.lang.String"}, + {"name": "tempStoreProtocol", "value": "LOCAL", "type": "java.lang.String"} + ] + }, + { + "template": "create-proxy-ffmpeg.xml", + "parameters": [ + {"name": "input", "value": "c:/_video/in.mxf", "type": "java.lang.String"}, + {"name": "output", "value": "c:/_video/out.mp4", "type": "java.lang.String"}, + {"name": "profile", "value": "proxy", "type": "java.lang.String"} + ] + }, + { "template": "sync-subtitles.xml", "parameters": [ {"name": "sourceFolder", "value": "/windows", "type": "java.lang.String"}, diff --git a/server/-product/production/LOCAL/jobs/steps/CancelableStep.java b/server/-product/production/LOCAL/jobs/steps/CancelableStep.java index bee93c64..11e27c7c 100644 --- a/server/-product/production/LOCAL/jobs/steps/CancelableStep.java +++ b/server/-product/production/LOCAL/jobs/steps/CancelableStep.java @@ -29,7 +29,7 @@ public class CancelableStep extends JobStep { for (int i = 0; i < count; i++) { if (getJobRuntime().isWaitingCancel()) break; - Thread.sleep(500); + Thread.sleep(1000); /* if (param==0) throw new Exception(); diff --git a/server/-product/production/LOCAL/jobs/steps/ExternalCommand.java b/server/-product/production/LOCAL/jobs/steps/ExternalCommand.java new file mode 100644 index 00000000..307f36d0 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/ExternalCommand.java @@ -0,0 +1,79 @@ +package user.jobengine.server.steps.shared; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ExternalCommand { + private static final Logger logger = LogManager.getLogger(); + private ExternalProfile profile; + + public ExternalCommand(ExternalProfile profile) { + this.profile = profile; + } + + public String execute(String input, String output, boolean firstResponse, IExternalCallback responseCallBack) throws Exception { + List arguments = getArguments(input, output); + List command = new ArrayList<>(); + command.add(profile.getExecutable()); + command.addAll(arguments); + + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command(command); + + String result = null; + try { + logger.info("Executing : {}", processBuilder.command()); + + Process process = processBuilder.start(); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { + String line = null; + while ((line = reader.readLine()) != null) { + logger.debug("Process response: {}", line); + if (responseCallBack != null) + responseCallBack.onResponse(line); + //System.out.println(line); + if (line != null && line.length() > 0) { + result = line; + if (firstResponse) + break; + } + } + int exitCode = process.waitFor(); + if (exitCode != 0) { + StringBuilder msg = new StringBuilder(); + try (BufferedReader errReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) { + String errline = null; + while ((errline = errReader.readLine()) != null) { + msg.append(errline); + } + } catch (Exception ex) { + } + + throw new Exception("Exited with error code : " + exitCode + ". " + msg); + } + } catch (Exception e) { + throw e; + } + } catch (Exception e) { + logger.error(e); + throw e; + } + + return result; + } + + private List getArguments(String input, String output) { + List result = new ArrayList<>(); + + profile.getArguments().forEach(i -> { + result.add(i.replace("%i", input).replace("%o", output)); + }); + return result; + } + +} \ No newline at end of file diff --git a/server/-product/production/LOCAL/jobs/steps/ExternalCommandExecutor.java b/server/-product/production/LOCAL/jobs/steps/ExternalCommandExecutor.java new file mode 100644 index 00000000..a34ff7f0 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/ExternalCommandExecutor.java @@ -0,0 +1,32 @@ +package user.jobengine.server.steps.shared; + +import user.commons.configuration.SystemConfiguration; + +public class ExternalCommandExecutor { + + public void execute(String profileName, String input, String output, IExternalCallback responseCallBack) throws Exception { + ExternalCommand externalCommand = getExternalCommand(profileName); + externalCommand.execute(input, output, false, responseCallBack); + } + + private ExternalCommand getExternalCommand(String profileName) throws Exception { + ExternalProfilesConfig config = SystemConfiguration.getInstance().load("settings/external-commands.yaml", ExternalProfilesConfig.class); + + if (config == null) + throw new Exception("Missing external-commands.yaml configuration"); + + ExternalProfile selectedProfile = null; + for (ExternalProfile profile : config.getProfiles()) { + if (profileName.equals(profile.getName())) { + selectedProfile = profile; + break; + } + } + + if (selectedProfile == null) + throw new Exception("Missing profile " + profileName + " in external-commands.yaml configuration"); + + return new ExternalCommand(selectedProfile); + } + +} diff --git a/server/-product/production/LOCAL/jobs/steps/ExternalProfile.java b/server/-product/production/LOCAL/jobs/steps/ExternalProfile.java new file mode 100644 index 00000000..68e22f4c --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/ExternalProfile.java @@ -0,0 +1,33 @@ +package user.jobengine.server.steps.shared; + +import java.util.List; + +public class ExternalProfile { + private String executable; + private String name; + private List arguments; + + public List getArguments() { + return arguments; + } + + public String getExecutable() { + return executable; + } + + public String getName() { + return name; + } + + public void setArguments(List arguments) { + this.arguments = arguments; + } + + public void setExecutable(String executable) { + this.executable = executable; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/server/-product/production/LOCAL/jobs/steps/ExternalProfilesConfig.java b/server/-product/production/LOCAL/jobs/steps/ExternalProfilesConfig.java new file mode 100644 index 00000000..7ef77291 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/ExternalProfilesConfig.java @@ -0,0 +1,15 @@ +package user.jobengine.server.steps.shared; + +import java.util.List; + +public class ExternalProfilesConfig { + private List profiles; + + public List getProfiles() { + return profiles; + } + + public void setProfiles(List profiles) { + this.profiles = profiles; + } +} \ No newline at end of file diff --git a/server/-product/production/LOCAL/jobs/steps/IExternalCallback.java b/server/-product/production/LOCAL/jobs/steps/IExternalCallback.java new file mode 100644 index 00000000..1e071913 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/IExternalCallback.java @@ -0,0 +1,5 @@ +package user.jobengine.server.steps.shared; + +public interface IExternalCallback { + void onResponse(String data); +} \ No newline at end of file diff --git a/server/-product/production/LOCAL/jobs/steps/MediaCubeClient.java b/server/-product/production/LOCAL/jobs/steps/MediaCubeClient.java new file mode 100644 index 00000000..840925e4 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/MediaCubeClient.java @@ -0,0 +1,77 @@ +package user.jobengine.server.steps; + +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation.Builder; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jboss.resteasy.client.jaxrs.ResteasyClient; +import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; +import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; +import org.jboss.resteasy.specimpl.MultivaluedMapImpl; + +import com.ibm.nosql.json.JSONUtil; +import com.ibm.nosql.json.api.BasicDBObject; + +public class MediaCubeClient { + private static Logger logger = LogManager.getLogger(); + private ResteasyWebTarget webTarget; + + public MediaCubeClient(String address) { + ResteasyClient client = new ResteasyClientBuilder().build(); + webTarget = client.target(address); + } + + BasicDBObject getDbObject(String json) { + BasicDBObject result = (BasicDBObject) JSONUtil.jsonToDbObject(json); + + if (result == null) + throw new NullPointerException("API Result is null!"); + + if (result.containsKey("exception")) { + BasicDBObject e = (BasicDBObject) result.get("exception"); + throw new RuntimeException(e.getString("message")); + } + //{"exception":{"message":"Invalid credentials.","publicName":"AuthenticationFailedException"}} + return result; + } + + public BasicDBObject getStatus(long jobId) { + MultivaluedMap vars = new MultivaluedMapImpl<>(); + vars.add("jobId", jobId); + Response response = query("services/rest/jobengine/jobstatus", vars).get(); + if (response.getStatus() != Status.OK.getStatusCode()) { + logger.error(response.readEntity(String.class)); + System.out.println(response.readEntity(String.class)); + return null; + } + String result = response.readEntity(String.class); + return getDbObject(result); + } + + private Builder query(String path, MultivaluedMap vars) { + ResteasyWebTarget target = webTarget.path(path).queryParams(vars); + Builder result = target.request(); + return result; + } + + public long startjob(String template, String name, BasicDBObject jobParams) throws Exception { + MultivaluedMap vars = new MultivaluedMapImpl<>(); + vars.add("template", template); + vars.add("name", name); + Response response = query("services/rest/jobengine/startjob", vars).post(Entity.entity(jobParams.toString(), MediaType.APPLICATION_JSON)); + + if (response.getStatus() != Status.OK.getStatusCode()) { + logger.error(response.readEntity(String.class)); + return 0; + } + + String resultObject = response.readEntity(String.class); + return Long.parseLong(resultObject); + } + +} diff --git a/server/-product/production/LOCAL/jobs/steps/PrepareRemoteTranscodeJobParametersStep.java b/server/-product/production/LOCAL/jobs/steps/PrepareRemoteTranscodeJobParametersStep.java new file mode 100644 index 00000000..37306e60 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/PrepareRemoteTranscodeJobParametersStep.java @@ -0,0 +1,20 @@ +package user.jobengine.server.steps; + +import java.nio.file.Paths; + +import com.ibm.nosql.json.api.BasicDBObject; + +public class PrepareRemoteTranscodeJobParametersStep extends JobStep { + @StepEntry + public Object[] execute(String profileName, String fileName) throws Exception { + String transcoderInputDir = "m:\"; + String transcoderOutputDir = "m:\"; + String outFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".mp4"; + BasicDBObject parameters = new BasicDBObject(); + parameters.put("profile", profileName); + parameters.put("input", Paths.get(transcoderInputDir, fileName)); + parameters.put("output", Paths.get(transcoderOutputDir, outFileName)); + return new Object[] { parameters }; + } + +} diff --git a/server/-product/production/LOCAL/jobs/steps/QueryMissingProxyMediaStep.java b/server/-product/production/LOCAL/jobs/steps/QueryMissingProxyMediaStep.java new file mode 100644 index 00000000..9e8d1949 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/QueryMissingProxyMediaStep.java @@ -0,0 +1,76 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; + +import user.commons.MediaCubeUndoMarker; +import user.commons.nosql.NoSQLUtils; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; + +public class QueryMissingProxyMediaStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute() throws Exception { + Object[] result = new Object[] { null }; + DB db = NoSQLUtils.getNoSQLDB(); + DBCollection collection = db.getCollection("missing_lowres"); + Media media = getFirstUntranscodedMedia(collection); + + try { + if (media == null) { + logger.info(new MediaCubeUndoMarker(getSessionMarker().getSessionID()), "Nincs feldolgozandó hiány."); + // throw new Exception("Nincs feldolgozandó hiány."); + cancel(); + return null; + } + + String name = media.getMediaFileRealName(); + collection.save(new BasicDBObject("name", name)); + logger.info(getSessionMarker(), "Processing mediaID: {}", media.getId()); + result[0] = media; + } catch (Exception e) { + logger.catching(e); + logger.error(getSessionMarker(), e.getMessage()); + throw e; + } finally { + setProgress(100); + } + return result; + } + + private Media getFirstUntranscodedMedia(DBCollection collection) { + Media[] result = new Media[] { null }; + //MV + String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS WHERE HOUSEID like 'M%' or HOUSEID like 'P%' or HOUSEID like 'R%' ORDER BY modified DESC"; + + //HTV + //String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS"; + IItemManager manager = getManager(); + manager.executeQuery(query, rs -> { + try { + long mediaId = rs.getLong(1); + Media media = manager.getMedia(mediaId); + //a nevgeneralas miatt az eredeti MediaFilesName nem jo, a pontos nev kell nekunk + String name = media.getMediaFileRealName(); + logger.info(getSessionMarker(), "Checking {}", name); + long existing = collection.find(new BasicDBObject("name", name)).count(); + if (existing > 0) { + logger.info(getSessionMarker(), "{} is on missing_lowres list", name); + return true; + } + + result[0] = media; + } catch (Exception e) { + logger.error(e); + } + return false; + }, null); + return result[0]; + } +} diff --git a/server/-product/production/LOCAL/jobs/steps/RemoteJobStep.java b/server/-product/production/LOCAL/jobs/steps/RemoteJobStep.java new file mode 100644 index 00000000..8e022f43 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/RemoteJobStep.java @@ -0,0 +1,43 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBObject; + +/* +import user.jobengine.server.steps.MediaCubeClient; +*/ +public class RemoteJobStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(String server, String template, String name, String profile) throws Exception { + try { + MediaCubeClient mc = new MediaCubeClient(server); + BasicDBObject params = new BasicDBObject(); + params.put("profile", profile); + params.put("input", "c:/_workspace/data/video/proba1.mxf"); + params.put("output", "c:/_video/proba1.mp4"); + + long jobId = mc.startjob(template, name, params); + logger.info(getMarker(), "Started {} on server {}", jobId, server); + while (true) { + BasicDBObject status = mc.getStatus(jobId); + if (status != null) + setProgress(status.getInt("progress")); + + String jobStatus = status.getString("status"); + if ("SUSPENDED".equals(jobStatus)) + throw new Exception(status.getString("description")); + + if ("FINISHED".equals(jobStatus)) + break; + } + + } catch (Exception e) { + throw e; + } + return new Object[] { null }; + } +} diff --git a/server/-product/production/LOCAL/jobs/steps/TranscodeFFMpegStep.java b/server/-product/production/LOCAL/jobs/steps/TranscodeFFMpegStep.java new file mode 100644 index 00000000..4033b8e3 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/steps/TranscodeFFMpegStep.java @@ -0,0 +1,52 @@ +package user.jobengine.server.steps; + +/* +import user.jobengine.server.steps.shared.IExternalCallback; +import user.jobengine.server.steps.shared.ExternalProfile; +import user.jobengine.server.steps.shared.ExternalProfilesConfig; +import user.jobengine.server.steps.shared.ExternalCommand; +import user.jobengine.server.steps.shared.ExternalCommandExecutor; + */ + +import java.nio.file.Paths; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.mediaarea.MediaArea; +import user.jobengine.server.steps.shared.ExternalCommandExecutor; +import user.jobengine.server.steps.shared.IExternalCallback; + +public class TranscodeFFMpegStep extends JobStep implements IExternalCallback { + private static final Logger logger = LogManager.getLogger(); + private long allFrameCount; + private long processedFrameCount; + + @StepEntry + public Object[] execute(String input, String output, String profile) throws Exception { + try { + MediaArea ma = new MediaArea(Paths.get(input)); + ma.process(); + allFrameCount = ma.getFrameCount(); + + ExternalCommandExecutor executor = new ExternalCommandExecutor(); + executor.execute(profile, input, output, this); + } catch (Exception e) { + logger.error(getMarker(), "Media information not available. System message: {}", e.getMessage()); + throw e; + } + return null; + } + + @Override + public void onResponse(String line) { + String[] values = line.split("="); + if ("frame".equals(values[0])) { + processedFrameCount = Integer.parseInt(values[1]); + int progress = (int) (processedFrameCount * 100 / allFrameCount); + if (progress > 0) + setProgress(progress); + } + } + +} diff --git a/server/-product/production/LOCAL/jobs/templates/create-proxy-ffmpeg.xml b/server/-product/production/LOCAL/jobs/templates/create-proxy-ffmpeg.xml new file mode 100644 index 00000000..acb2cb62 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/templates/create-proxy-ffmpeg.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/-product/production/LOCAL/jobs/templates/remote-transcode.xml b/server/-product/production/LOCAL/jobs/templates/remote-transcode.xml new file mode 100644 index 00000000..ce4c77b7 --- /dev/null +++ b/server/-product/production/LOCAL/jobs/templates/remote-transcode.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/-product/production/LOCAL/jobs/templates/template1.yaml b/server/-product/production/LOCAL/jobs/templates/template1.yaml deleted file mode 100644 index 4459b9fa..00000000 --- a/server/-product/production/LOCAL/jobs/templates/template1.yaml +++ /dev/null @@ -1,28 +0,0 @@ -jobtemplate: - multiInstance: true - useSessionLog: true - declarations: - parameters: - - name: param1 - type: java.lang.Integer - - name: param1 - type: java.lang.Integer - variables: - - name: var1 - type: java.lang.Integer - - name: var1 - type: java.lang.Integer - commands: - - type: Step1.java - weight: 1 - inputs: - - name: param1 - - name: param2 - outputs: - - name: var1 - - name: var2 - - type: StepS.java - weight: 1 - inputs: - - name: var1 - - name: var2 diff --git a/server/-product/production/LOCAL/mediacube.bat b/server/-product/production/LOCAL/mediacube.bat index 099f5aee..24a39d6c 100644 --- a/server/-product/production/LOCAL/mediacube.bat +++ b/server/-product/production/LOCAL/mediacube.bat @@ -11,7 +11,7 @@ java ^ -Djava.io.tmpdir=tmp ^ -Dfile.encoding=UTF-8 ^ -Dgosh.home=configuration ^ --jar plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar ^ +-jar ../../target/products/MediaCube/linux/gtk/x86_64/plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar ^ -Xms512m ^ -Xmx1024m ^ -console diff --git a/server/-product/production/LOCAL/settings/application-htv.yaml b/server/-product/production/LOCAL/settings/application-htv.yaml new file mode 100644 index 00000000..3dbde683 --- /dev/null +++ b/server/-product/production/LOCAL/settings/application-htv.yaml @@ -0,0 +1,57 @@ +datasource: + mediacube: +# url: jdbc:db2://10.11.1.90:50000/mc +# user: db2admin +# password: password + url: jdbc:db2://192.168.100.2:50000/mc + user: db2inst1 + password: password +# url: jdbc:db2://10.10.1.27:50000/mc +# user: db2admin +# password: password + external-indexer: false + simple-search: true + login-timeout: 3 + pool-size: 10 + mediacube-nosql: +# url: jdbc:db2://10.11.1.90:50000/mc +# user: db2admin +# password: password + url: jdbc:db2://192.168.100.2:50000/mc + user: db2inst1 + password: password +# url: jdbc:db2://10.10.1.27:50000/mc +# user: db2admin +# password: password + schema: test + login-timeout: 3 + hsm: + url: jdbc:db2://10.11.1.89:51500/tsmdb1 + user: tsminst1 + password: tsminst1 + planair: + url: jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis; + user: MAM + password: VDani +services: + ffmpeg: + execurable-location: /opt/ffmpeg/ffmpeg + mediacube: + proxy-root: /mediacube/data/lowres + nexio: +# host: 10.10.1.55 +# collection-name: nexioclips +# use-mos-gateway: true + disabled: true +jobs: + validate-transfers: false + copy-buffer-size: 32768 + scheduled-execution-disabled: true +tsm: + randomize-archives: false + delimiter: / + node-name: JOBENGINE + fs-name: /JOBENGINE + alternate-fs-name: /JOBENGINE + hl-name: /JOBENGINE + \ No newline at end of file diff --git a/server/-product/production/LOCAL/settings/application-local.yaml b/server/-product/production/LOCAL/settings/application-local.yaml new file mode 100644 index 00000000..8a94fef7 --- /dev/null +++ b/server/-product/production/LOCAL/settings/application-local.yaml @@ -0,0 +1,45 @@ +datasource: + mediacube: + url: jdbc:db2://10.11.1.90:50000/mc + user: db2admin + password: password + external-indexer: false + simple-search: true + login-timeout: 3 + pool-size: 10 + mediacube-nosql: + url: jdbc:db2://10.11.1.90:50000/mc + user: db2admin + password: password + schema: test + login-timeout: 3 + hsm: + url: jdbc:db2://10.11.1.89:51500/tsmdb1 + user: tsminst1 + password: tsminst1 + planair: + url: jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis; + user: MAM + password: VDani +services: + ffmpeg: + execurable-location: /opt/ffmpeg/ffmpeg + mediacube: + proxy-root: /mediacube/data/lowres + nexio: +# host: 10.10.1.55 +# collection-name: nexioclips +# use-mos-gateway: true + disabled: true +jobs: + validate-transfers: false + copy-buffer-size: 32768 + scheduled-execution-disabled: true +tsm: + randomize-archives: false + delimiter: / + node-name: JOBENGINE + fs-name: /JOBENGINE + alternate-fs-name: /JOBENGINE + hl-name: /JOBENGINE + \ No newline at end of file diff --git a/server/-product/production/LOCAL/settings/application.yaml b/server/-product/production/LOCAL/settings/application.yaml index d2573c76..8a94fef7 100644 --- a/server/-product/production/LOCAL/settings/application.yaml +++ b/server/-product/production/LOCAL/settings/application.yaml @@ -1,22 +1,16 @@ datasource: mediacube: - url: jdbc:db2://192.168.100.2:50000/mc - user: db2inst1 + url: jdbc:db2://10.11.1.90:50000/mc + user: db2admin password: password -# url: jdbc:db2://10.10.1.27:50000/mc -# user: db2admin -# password: password external-indexer: false simple-search: true login-timeout: 3 pool-size: 10 mediacube-nosql: - url: jdbc:db2://192.168.100.2:50000/mc - user: db2inst1 + url: jdbc:db2://10.11.1.90:50000/mc + user: db2admin password: password -# url: jdbc:db2://10.10.1.27:50000/mc -# user: db2admin -# password: password schema: test login-timeout: 3 hsm: @@ -33,9 +27,9 @@ services: mediacube: proxy-root: /mediacube/data/lowres nexio: - host: 10.10.1.55 - collection-name: nexioclips - use-mos-gateway: true +# host: 10.10.1.55 +# collection-name: nexioclips +# use-mos-gateway: true disabled: true jobs: validate-transfers: false diff --git a/server/-product/production/LOCAL/settings/external-commands.yaml b/server/-product/production/LOCAL/settings/external-commands.yaml new file mode 100644 index 00000000..5fc2f7e8 --- /dev/null +++ b/server/-product/production/LOCAL/settings/external-commands.yaml @@ -0,0 +1,27 @@ +profiles: +- + name: proxy + executable: /Programs/ffmpeg/bin/ffmpeg.exe + arguments: + - -y + - -v + - error + - -progress + - pipe:1 + - -i + - "%i" + - "%o" +- + name: length + executable: /Programs/ffmpeg/bin/ffprobe.exe + arguments: + - -v + - error + - -select_streams + - v:0 + - -show_entries + - stream=nb_frames + - -of + - default=noprint_wrappers=1:nokey=1 + - "%i" + \ No newline at end of file diff --git a/server/-product/production/LOCAL/settings/ffmpeg.yaml b/server/-product/production/LOCAL/settings/ffmpeg.yaml deleted file mode 100644 index 94a90ca5..00000000 --- a/server/-product/production/LOCAL/settings/ffmpeg.yaml +++ /dev/null @@ -1,14 +0,0 @@ -location: /Programs/ffmpeg/bin/ffmpeg.exe -default: - - -v panic - - -stats - - -y -profiles: -- name: profile1 - settings: - - setting1 - - setting2 -- name: profile2 - settings: - - setting3 - - setting4 diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/EscortFiles.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/EscortFiles.class deleted file mode 100644 index 181784cf..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/EscortFiles.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/ItemManagerExtensions.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/ItemManagerExtensions.class deleted file mode 100644 index ebfd0800..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/ItemManagerExtensions.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataType.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataType.class deleted file mode 100644 index ae205ad2..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataType.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector$MetadataType.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector$MetadataType.class deleted file mode 100644 index 488120ee..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector$MetadataType.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector.class deleted file mode 100644 index affbeb63..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/MetadataTypeDetector.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$1.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$1.class deleted file mode 100644 index 77dd877a..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$1.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$2.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$2.class deleted file mode 100644 index a4332459..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep$2.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep.class b/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep.class deleted file mode 100644 index 59569e09..00000000 Binary files a/server/-product/production/MEDIAVIVANTIS/jobs/classes/user/jobengine/server/steps/TSMRestoreStep.class and /dev/null differ diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/executors.xml b/server/-product/production/MEDIAVIVANTIS/jobs/executors.xml index 82fe6bf6..5ec9b71e 100644 --- a/server/-product/production/MEDIAVIVANTIS/jobs/executors.xml +++ b/server/-product/production/MEDIAVIVANTIS/jobs/executors.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/schedules.json b/server/-product/production/MEDIAVIVANTIS/jobs/schedules.json index fac78485..9167bcfe 100644 --- a/server/-product/production/MEDIAVIVANTIS/jobs/schedules.json +++ b/server/-product/production/MEDIAVIVANTIS/jobs/schedules.json @@ -1,5 +1,16 @@ {"joblist":[ { + "template": "remote-transcode.xml", + "parameters": [ + {"name": "remoteServer", "value": "http://10.11.1.111:9080", "type": "java.lang.String"}, + {"name": "transcodeTemplate", "value": "create-proxy-ffmpeg.xml", "type": "java.lang.String"}, + {"name": "jobName", "value": "Create proxy (slave process)", "type": "java.lang.String"}, + {"name": "profileName", "value": "proxy", "type": "java.lang.String"}, + {"name": "tempStoreName", "value": "LOCAL", "type": "java.lang.String"}, + {"name": "tempStoreProtocol", "value": "LOCAL", "type": "java.lang.String"} + ] + }, + { "template": "test-fork-cancelable.xml", "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] }, diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/EscortFiles.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/EscortFiles.java new file mode 100644 index 00000000..077ce60d --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/EscortFiles.java @@ -0,0 +1,339 @@ +package user.jobengine.server.steps; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.PosixFilePermissions; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Set; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.net.ftp.FTPClient; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.message.Message; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.util.JSON; + +import user.commons.CalendarUtils; +import user.commons.MediaCubeMarker; +import user.commons.StoreUri; +import user.commons.remotestore.FtpDirectoryLister; + +public class EscortFiles { + private static final String RECORDTIMESTAMP = "RecordTimeStamp"; + private static final String MODIFIEDTIMESTAMP = "ModifiedTimeStamp"; + public static final String DOT_CATCHED = ".catched"; + public static final String DOT_JSON = ".json"; + private static final Logger logger = LogManager.getLogger(); + private static final String EXTENDEDAGENCY = "ExtendedAgency"; + private static final String EXTENDEDDESCRIPTION = "ExtendedDescription"; + private static final String KILLDATE = "KillDate"; + private static final String FORMAT_KILLDATE = "MM-dd-yyyy"; + private static final String EXTENDEDID = "extendedId"; + private static final String ID = "ID"; + private static final String KILLDATE_FILENAME = "%s.%s.killdate"; + private static final String FORMAT_KILLDATENAME = "yyyyMMdd"; + public static final String STATUSFOLDER = ".STATUS"; + public static final String CONFLICTFOLDER = ".CONFLICT"; + + public static String composeKillDate(int days) { + Calendar killDate = Calendar.getInstance(); + killDate.add(Calendar.DAY_OF_YEAR, days); + SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT_KILLDATENAME); + return dateFormat.format(killDate.getTime()); + } + /* + * + * 02-02-2018 TEST + * TEST AGENT AGENT + * + */ + + private static String composeKillDateFileName(String fileName, int days) { + return String.format(KILLDATE_FILENAME, fileName, composeKillDate(days)); + } + + public static void createCatchedFile(Path escortFile) throws IOException { + Path catchedFilePath = Paths.get(escortFile.toString() + DOT_CATCHED); + Files.createFile(catchedFilePath); + } + + public static void createFellow(String escortFile, String extension) throws IOException { + Files.copy(Paths.get(escortFile), Paths.get(escortFile + "." + extension)); + } + + /*** + * A media eleresi utjan alapjan a .STATUS almappaban letrehozza a .catch fajlt. + * + * @param mediaFile + * @throws IOException + */ + public static void createMediaCatch(Path mediaFile) throws IOException { + Path catchedFile = createMediaCathFilePath(mediaFile); + ensureUNCFolder(catchedFile.getParent()); + Files.createFile(catchedFile); + } + + private static Path createMediaCathFilePath(Path mediaFile) { + return Paths.get(mediaFile.getParent().toString(), STATUSFOLDER, mediaFile.getFileName() + DOT_CATCHED); + } + + public static void createMetadata(String filePath, String fileName, String metadata) throws IOException { + ensureUNCFolder(filePath, STATUSFOLDER); + String metadataFileName = fileName + DOT_JSON; + Path metadataPath = Paths.get(filePath, STATUSFOLDER, metadataFileName); + Files.write(metadataPath, metadata.getBytes()); + } + + public static boolean createMetadataIfNotExists(String filePath, String fileName, String metadata) throws IOException { + boolean result = false; + if (!EscortFiles.isMetadataExists(filePath, fileName)) { + EscortFiles.createMetadata(filePath, fileName, metadata); + result = true; + } + return result; + } + + public static void createMorpheusXML(String filePath, String fileName, String content) throws IOException { + ensureUNCFolder(filePath, STATUSFOLDER); + Path xmlPath = Paths.get(filePath, fileName); + if (Files.exists(xmlPath)) + throw new IOException(String.format("Az '%s' állomány már létezik.", xmlPath)); + Files.write(xmlPath, content.getBytes()); + } + + public static byte[] createNEXIODatesMeta(String fileName, Date recorded, Date modified) throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + DOMImplementation impl = db.getDOMImplementation(); + Document xmlDocument = impl.createDocument(null, null, null); + + Element root = xmlDocument.createElement(ID); + root.setAttribute(EXTENDEDID, fileName); + // 07-13-2020 (19:36:52) + // 05-18-2013 (18:52:24) + SimpleDateFormat df = new SimpleDateFormat("MM-dd-yyyy (HH:mm:ss)"); + root.appendChild(xmlDocument.createElement(MODIFIEDTIMESTAMP)).appendChild(xmlDocument.createTextNode(df.format(modified))); + root.appendChild(xmlDocument.createElement(RECORDTIMESTAMP)).appendChild(xmlDocument.createTextNode(df.format(recorded))); + xmlDocument.appendChild(root); + + return xmDocumentToString(xmlDocument); + } + + public static byte[] createNEXIOKillDateFile(String fileName, Date killDate, String description, String agency) throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + DOMImplementation impl = db.getDOMImplementation(); + Document xmlDocument = impl.createDocument(null, null, null); + + Element root = xmlDocument.createElement(ID); + root.setAttribute(EXTENDEDID, fileName); + if (killDate != null) { + String sKillDate = CalendarUtils.toString(CalendarUtils.createCalendar(killDate), FORMAT_KILLDATE); + root.appendChild(xmlDocument.createElement(KILLDATE)).appendChild(xmlDocument.createTextNode(sKillDate)); + } + + if (StringUtils.isNotBlank(description)) + root.appendChild(xmlDocument.createElement(EXTENDEDDESCRIPTION)).appendChild(xmlDocument.createTextNode(description)); + if (StringUtils.isNotBlank(agency)) + root.appendChild(xmlDocument.createElement(EXTENDEDAGENCY)).appendChild(xmlDocument.createTextNode(agency)); + xmlDocument.appendChild(root); + + return xmDocumentToString(xmlDocument); + } + + public static Document createNEXIOMeta(byte[] content) throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + DOMImplementation impl = db.getDOMImplementation(); + Document xmlDocument = null; + + try (InputStream is = new ByteArrayInputStream(content)) { + xmlDocument = db.parse(is); + } catch (Exception e) { + logger.catching(e); + } + + return xmlDocument; + } + + public static void createUNCKillDate(String filePath, String fileName, int days, Marker marker) throws IOException { + ensureUNCFolder(filePath, STATUSFOLDER); + String killDateFileName = composeKillDateFileName(fileName, days); + Path killDatePath = Paths.get(filePath, STATUSFOLDER, killDateFileName); + if (Files.exists(killDatePath)) + logger.warn(marker, "Az '{}' állomány már létezik.", killDatePath); + else + Files.createFile(killDatePath); + } + + @SuppressWarnings("unchecked") + public static T decode(Path escortFile) { + T result = null; + try { + byte[] bytes = Files.readAllBytes(escortFile); + String content = new String(bytes); + result = (T) JSON.parse(content); + } catch (Exception e) { + logger.error("Decode error. System message is: ", e.getMessage()); + } + return result; + } + + public static void ensureUNCFolder(Path filePath) throws IOException { + File folder = filePath.toFile(); + if (!folder.exists() || !folder.isDirectory()) { + Set perms = PosixFilePermissions.fromString("rwxrwxrwx"); + FileAttribute> attr = PosixFilePermissions.asFileAttribute(perms); + try { + Files.createDirectories(filePath, attr); + } catch (Exception e) { + // logger.catching(e); + try { + Files.createDirectories(filePath); + } catch (Exception e1) { + logger.catching(e); + throw e; + } + } + } + } + + public static void ensureUNCFolder(String filePath, String folderName) throws IOException { + Path statusPath = Paths.get(filePath, folderName); + ensureUNCFolder(statusPath); + } + + public static boolean isCatchedFileExists(Path escortFile) { + Path catchedFilePath = Paths.get(escortFile.toString() + DOT_CATCHED); + return catchedFilePath.toFile().exists(); + } + + /*** + * A media eleresi utjan alapjan a .STATUS almappaban vizsgalja .catch fajl letezeset. + * + * @param mediaFile + * @return + */ + public static boolean isMediaCatched(Path mediaFile) { + Path catchedFile = createMediaCathFilePath(mediaFile); + return catchedFile.toFile().exists(); + } + + public static boolean isMetadataExists(String filePath, String fileName) throws IOException { + boolean result = false; + String metadataFileName = fileName + DOT_JSON; + Path metadataPath = Paths.get(filePath, STATUSFOLDER, metadataFileName); + result = metadataPath.toFile().exists(); + return result; + } + + public static void notifyRecipient(Path escortFile, Logger logger, Message msg) { + if (escortFile.toFile().exists()) { + try { + BasicDBObject downloadable = EscortFiles.decode(escortFile); + String recipientKey = "recipient"; + if (downloadable.containsKey(recipientKey)) { + String recipient = downloadable.getString(recipientKey); + logger.info(new MediaCubeMarker(recipient, "MediaCube rendszerüzenet"), msg); + } + } catch (Exception e) { + logger.catching(e); + } + + } + } + + public static void remove(Path file) { + try { + file.toFile().delete(); + } catch (Exception e) { + logger.error("Unable to delete {}", file.toAbsolutePath().toString()); + } + } + + public static void removeCatchedFile(Path escortFile) { + remove(Paths.get(escortFile.toString() + DOT_CATCHED)); + } + + /*** + * A media eleresi utjan alapjan a .STATUS almappabol torli a .catch fajlt. + * + * @param mediaFile + * @throws IOException + */ + public static void removeMediaCatch(Path mediaFile) { + Path catchedFile = createMediaCathFilePath(mediaFile); + remove(catchedFile); + } + + public static void setNEXIOKillDate(int killDateDays, String targetFileName, String nexioAgency, StoreUri targetUri) throws Exception { + OutputStream outStream = null; + try { + FTPClient targetFTP = ((FtpDirectoryLister) targetUri.getLister()).connect(); + Calendar killDate = CalendarUtils.createCalendar(new Date()); + killDate.add(Calendar.DAY_OF_YEAR, killDateDays); + if (targetFileName.toLowerCase().contains(".mxf")) + targetFileName = targetFileName.substring(0, targetFileName.lastIndexOf('.')); + byte[] killDateFile = EscortFiles.createNEXIOKillDateFile(targetFileName, killDate.getTime(), null, nexioAgency); + String xml = targetFileName + ".xml"; + outStream = targetFTP.storeFileStream(xml); + if (outStream == null) { + throw new NullPointerException("Can not open: " + targetFileName.substring(0, targetFileName.lastIndexOf('.')) + ".xml" + " Reply:" + + targetFTP.getReplyString()); + } + outStream.write(killDateFile); + outStream.flush(); + } catch (Exception e) { + throw e; + } finally { + if (outStream != null) + outStream.close(); + targetUri.cleanUp(); + } + } + + private static byte[] xmDocumentToString(Document xmlDocument) + throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException, IOException, UnsupportedEncodingException { + DOMSource domSource = new DOMSource(xmlDocument); + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-16"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + StringWriter sw = new StringWriter(); + StreamResult sr = new StreamResult(sw); + transformer.transform(domSource, sr); + String result = sw.toString(); + sw.close(); + return result.getBytes("UTF-16"); + } +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalCommand.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalCommand.java new file mode 100644 index 00000000..307f36d0 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalCommand.java @@ -0,0 +1,79 @@ +package user.jobengine.server.steps.shared; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ExternalCommand { + private static final Logger logger = LogManager.getLogger(); + private ExternalProfile profile; + + public ExternalCommand(ExternalProfile profile) { + this.profile = profile; + } + + public String execute(String input, String output, boolean firstResponse, IExternalCallback responseCallBack) throws Exception { + List arguments = getArguments(input, output); + List command = new ArrayList<>(); + command.add(profile.getExecutable()); + command.addAll(arguments); + + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command(command); + + String result = null; + try { + logger.info("Executing : {}", processBuilder.command()); + + Process process = processBuilder.start(); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { + String line = null; + while ((line = reader.readLine()) != null) { + logger.debug("Process response: {}", line); + if (responseCallBack != null) + responseCallBack.onResponse(line); + //System.out.println(line); + if (line != null && line.length() > 0) { + result = line; + if (firstResponse) + break; + } + } + int exitCode = process.waitFor(); + if (exitCode != 0) { + StringBuilder msg = new StringBuilder(); + try (BufferedReader errReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) { + String errline = null; + while ((errline = errReader.readLine()) != null) { + msg.append(errline); + } + } catch (Exception ex) { + } + + throw new Exception("Exited with error code : " + exitCode + ". " + msg); + } + } catch (Exception e) { + throw e; + } + } catch (Exception e) { + logger.error(e); + throw e; + } + + return result; + } + + private List getArguments(String input, String output) { + List result = new ArrayList<>(); + + profile.getArguments().forEach(i -> { + result.add(i.replace("%i", input).replace("%o", output)); + }); + return result; + } + +} \ No newline at end of file diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalCommandExecutor.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalCommandExecutor.java new file mode 100644 index 00000000..a34ff7f0 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalCommandExecutor.java @@ -0,0 +1,32 @@ +package user.jobengine.server.steps.shared; + +import user.commons.configuration.SystemConfiguration; + +public class ExternalCommandExecutor { + + public void execute(String profileName, String input, String output, IExternalCallback responseCallBack) throws Exception { + ExternalCommand externalCommand = getExternalCommand(profileName); + externalCommand.execute(input, output, false, responseCallBack); + } + + private ExternalCommand getExternalCommand(String profileName) throws Exception { + ExternalProfilesConfig config = SystemConfiguration.getInstance().load("settings/external-commands.yaml", ExternalProfilesConfig.class); + + if (config == null) + throw new Exception("Missing external-commands.yaml configuration"); + + ExternalProfile selectedProfile = null; + for (ExternalProfile profile : config.getProfiles()) { + if (profileName.equals(profile.getName())) { + selectedProfile = profile; + break; + } + } + + if (selectedProfile == null) + throw new Exception("Missing profile " + profileName + " in external-commands.yaml configuration"); + + return new ExternalCommand(selectedProfile); + } + +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalProfile.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalProfile.java new file mode 100644 index 00000000..68e22f4c --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalProfile.java @@ -0,0 +1,33 @@ +package user.jobengine.server.steps.shared; + +import java.util.List; + +public class ExternalProfile { + private String executable; + private String name; + private List arguments; + + public List getArguments() { + return arguments; + } + + public String getExecutable() { + return executable; + } + + public String getName() { + return name; + } + + public void setArguments(List arguments) { + this.arguments = arguments; + } + + public void setExecutable(String executable) { + this.executable = executable; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalProfilesConfig.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalProfilesConfig.java new file mode 100644 index 00000000..7ef77291 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ExternalProfilesConfig.java @@ -0,0 +1,15 @@ +package user.jobengine.server.steps.shared; + +import java.util.List; + +public class ExternalProfilesConfig { + private List profiles; + + public List getProfiles() { + return profiles; + } + + public void setProfiles(List profiles) { + this.profiles = profiles; + } +} \ No newline at end of file diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/IExternalCallback.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/IExternalCallback.java new file mode 100644 index 00000000..1e071913 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/IExternalCallback.java @@ -0,0 +1,5 @@ +package user.jobengine.server.steps.shared; + +public interface IExternalCallback { + void onResponse(String data); +} \ No newline at end of file diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/ItemManagerExtensions.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ItemManagerExtensions.java new file mode 100644 index 00000000..bf807791 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/ItemManagerExtensions.java @@ -0,0 +1,58 @@ +package user.jobengine.server.steps; + +import com.ibm.nosql.json.api.BasicDBObject; + +import user.jobengine.db.IItemManager; +import user.jobengine.db.IResultSetConsumer; + +public class ItemManagerExtensions { + + public static BasicDBObject getArchiveInfo(IItemManager manager, long houseid) { + final BasicDBObject[] result = { null }; + StringBuilder query = new StringBuilder(); + query.append("select count(*) as count, sum(length) as duration FROM media"); + query.append(" "); + query.append(String.format("where houseid='%d' and itemtypeid = 82", houseid)); + query.append(" "); + query.append("group by houseid"); + IResultSetConsumer consumer = rs -> { + BasicDBObject o = new BasicDBObject(); + o.put("count", rs.getLong("count")); + o.put("duration", rs.getLong("duration")); + result[0] = o; + return false; + }; + manager.executeQuery(query.toString(), consumer, null); + return result[0]; + } + + public static long getExistingRundownMedia(IItemManager manager, String houseid) { + final long[] result = { 0 }; + final String[] idToCheck = { houseid }; + int pos = houseid.lastIndexOf("-"); + //a hivas a CopyForArchiveNEXIOMaterialsStep-bol is johet, ott meg nincs idobelyegezve a nev! + if (pos > 0 && houseid.length() - pos > 4) + idToCheck[0] = houseid.substring(0, pos); + MetadataType metadataType = MetadataTypeDetector.GuessMetadataType(idToCheck[0]); + if (metadataType == MetadataType.OctopusPlaceholder) { + StringBuilder query = new StringBuilder(); + query.append("select mediaid, mediafilehouseid, filename"); + query.append(" "); + query.append(String.format("from vw_rundown_items where mediafilehouseid like '%s%%'", idToCheck[0])); + query.append(" "); + query.append("order by filename, mediaid"); + IResultSetConsumer consumer = rs -> { + String fileName = rs.getString("filename"); + if (idToCheck[0].equals(fileName)) { + result[0] = rs.getLong("mediaid"); + return false; + } else + return true; + }; + manager.executeQuery(query.toString(), consumer, null); + } + + return result[0]; + } + +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/MediaCubeClient.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/MediaCubeClient.java new file mode 100644 index 00000000..840925e4 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/MediaCubeClient.java @@ -0,0 +1,77 @@ +package user.jobengine.server.steps; + +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation.Builder; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jboss.resteasy.client.jaxrs.ResteasyClient; +import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; +import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; +import org.jboss.resteasy.specimpl.MultivaluedMapImpl; + +import com.ibm.nosql.json.JSONUtil; +import com.ibm.nosql.json.api.BasicDBObject; + +public class MediaCubeClient { + private static Logger logger = LogManager.getLogger(); + private ResteasyWebTarget webTarget; + + public MediaCubeClient(String address) { + ResteasyClient client = new ResteasyClientBuilder().build(); + webTarget = client.target(address); + } + + BasicDBObject getDbObject(String json) { + BasicDBObject result = (BasicDBObject) JSONUtil.jsonToDbObject(json); + + if (result == null) + throw new NullPointerException("API Result is null!"); + + if (result.containsKey("exception")) { + BasicDBObject e = (BasicDBObject) result.get("exception"); + throw new RuntimeException(e.getString("message")); + } + //{"exception":{"message":"Invalid credentials.","publicName":"AuthenticationFailedException"}} + return result; + } + + public BasicDBObject getStatus(long jobId) { + MultivaluedMap vars = new MultivaluedMapImpl<>(); + vars.add("jobId", jobId); + Response response = query("services/rest/jobengine/jobstatus", vars).get(); + if (response.getStatus() != Status.OK.getStatusCode()) { + logger.error(response.readEntity(String.class)); + System.out.println(response.readEntity(String.class)); + return null; + } + String result = response.readEntity(String.class); + return getDbObject(result); + } + + private Builder query(String path, MultivaluedMap vars) { + ResteasyWebTarget target = webTarget.path(path).queryParams(vars); + Builder result = target.request(); + return result; + } + + public long startjob(String template, String name, BasicDBObject jobParams) throws Exception { + MultivaluedMap vars = new MultivaluedMapImpl<>(); + vars.add("template", template); + vars.add("name", name); + Response response = query("services/rest/jobengine/startjob", vars).post(Entity.entity(jobParams.toString(), MediaType.APPLICATION_JSON)); + + if (response.getStatus() != Status.OK.getStatusCode()) { + logger.error(response.readEntity(String.class)); + return 0; + } + + String resultObject = response.readEntity(String.class); + return Long.parseLong(resultObject); + } + +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/MetadataType.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/MetadataType.java new file mode 100644 index 00000000..12e166cc --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/MetadataType.java @@ -0,0 +1,5 @@ +package user.jobengine.server.steps; + +public enum MetadataType { + TrafficMaterial, TrafficPromo, TrafficAD, OctopusStory, OctopusPlaceholder, Generic +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/MetadataTypeDetector.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/MetadataTypeDetector.java new file mode 100644 index 00000000..0bb69923 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/MetadataTypeDetector.java @@ -0,0 +1,49 @@ +package user.jobengine.server.steps; + +import org.apache.commons.lang.StringUtils; + +public class MetadataTypeDetector { + + private static final String HYPHEN = "-"; + private static final String DOT = "."; + + private static final String REGEXP_TRAFFICMATERIALID = "^M{1}[0-9]{6}[A-Z]{1}$"; + private static final String REGEXP_TRAFFICADID = "^R{1}[0-9]{6}[A-Z]{1}$"; + private static final String REGEXP_TRAFFICPROMOID = "^P{1}[0-9]{6}[A-Z]{1}$"; + private static final String REGEXP_OCTOPUSSTORYID = "^[0-9]+$"; + private static final String REGEXP_OCTOPUSPLACEHOLDERID = "^[0-9]+_[0-9]+$"; + private static final String REGEXP_OCTOPUSPLACEHOLDERVERSIONEDID = "^[0-9]+_[0-9]+-[0-9]{3}$"; + + public static MetadataType GuessMetadataType(String id) { + if (StringUtils.isBlank(id)) + return MetadataType.Generic; + if (id.matches(REGEXP_TRAFFICMATERIALID)) + return MetadataType.TrafficMaterial; + if (id.matches(REGEXP_TRAFFICPROMOID)) + return MetadataType.TrafficPromo; + if (id.matches(REGEXP_TRAFFICADID)) + return MetadataType.TrafficAD; + if (id.matches(REGEXP_OCTOPUSSTORYID)) + return MetadataType.OctopusStory; + if (id.matches(REGEXP_OCTOPUSPLACEHOLDERID)) + return MetadataType.OctopusPlaceholder; + if (id.matches(REGEXP_OCTOPUSPLACEHOLDERVERSIONEDID)) + return MetadataType.OctopusPlaceholder; + return MetadataType.Generic; + } + + public static String truncateExtension(String name) { + String result = name; + if (result != null && result.contains(DOT)) + result = result.substring(0, result.lastIndexOf(DOT)); + return result; + } + + public static String truncateVersion(String name) { + String result = name; + if (result != null && result.contains(HYPHEN)) + result = result.split(HYPHEN)[0]; + return result; + } + +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/OutputPathAndNameSelectorStep.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/OutputPathAndNameSelectorStep.java index 7148df4c..6950babe 100644 --- a/server/-product/production/MEDIAVIVANTIS/jobs/steps/OutputPathAndNameSelectorStep.java +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/OutputPathAndNameSelectorStep.java @@ -18,6 +18,12 @@ import user.jobengine.db.ArchivedMedia; import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; +/* +package user.jobengine.server.steps.MetadataType; +package user.jobengine.server.steps.MetadataTypeDetector; +package user.jobengine.server.steps.EscortFiles; +*/ + public class OutputPathAndNameSelectorStep extends JobStep { private static final String TARGETNAMEPATTERN = "-ARCH-%s"; diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/PrepareMediaRestoreStep.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/PrepareMediaRestoreStep.java new file mode 100644 index 00000000..fd7d25ec --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/PrepareMediaRestoreStep.java @@ -0,0 +1,30 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; + +public class PrepareMediaRestoreStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(Media media, String mediaStoreProtocol, String tempStoreName, String tempStoreProtocol) throws Exception { + StoreUri mediaStoreUri = null; + for (MediaFile mediaFile : media.getMediaFiles()) { + if (mediaFile.getStore().isSystem() && !mediaFile.getStore().isLowres()) { + mediaStoreUri = mediaFile.getStore().getStoreUri(Enum.valueOf(RemoteStoreProtocol.class, mediaStoreProtocol)); + if (mediaStoreUri != null) + break; + } + } + + StoreUri tempStoreUri = getManager().getStoreUri(tempStoreName, Enum.valueOf(RemoteStoreProtocol.class, tempStoreProtocol)); + + return new Object[] { mediaStoreUri, tempStoreUri, media.getMediaFileRealName() }; + } + +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/PrepareRemoteTranscodeJobParametersStep.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/PrepareRemoteTranscodeJobParametersStep.java new file mode 100644 index 00000000..37306e60 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/PrepareRemoteTranscodeJobParametersStep.java @@ -0,0 +1,20 @@ +package user.jobengine.server.steps; + +import java.nio.file.Paths; + +import com.ibm.nosql.json.api.BasicDBObject; + +public class PrepareRemoteTranscodeJobParametersStep extends JobStep { + @StepEntry + public Object[] execute(String profileName, String fileName) throws Exception { + String transcoderInputDir = "m:\"; + String transcoderOutputDir = "m:\"; + String outFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".mp4"; + BasicDBObject parameters = new BasicDBObject(); + parameters.put("profile", profileName); + parameters.put("input", Paths.get(transcoderInputDir, fileName)); + parameters.put("output", Paths.get(transcoderOutputDir, outFileName)); + return new Object[] { parameters }; + } + +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/QueryMissingProxyMediaStep.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/QueryMissingProxyMediaStep.java new file mode 100644 index 00000000..9e8d1949 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/QueryMissingProxyMediaStep.java @@ -0,0 +1,76 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; + +import user.commons.MediaCubeUndoMarker; +import user.commons.nosql.NoSQLUtils; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; + +public class QueryMissingProxyMediaStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute() throws Exception { + Object[] result = new Object[] { null }; + DB db = NoSQLUtils.getNoSQLDB(); + DBCollection collection = db.getCollection("missing_lowres"); + Media media = getFirstUntranscodedMedia(collection); + + try { + if (media == null) { + logger.info(new MediaCubeUndoMarker(getSessionMarker().getSessionID()), "Nincs feldolgozandó hiány."); + // throw new Exception("Nincs feldolgozandó hiány."); + cancel(); + return null; + } + + String name = media.getMediaFileRealName(); + collection.save(new BasicDBObject("name", name)); + logger.info(getSessionMarker(), "Processing mediaID: {}", media.getId()); + result[0] = media; + } catch (Exception e) { + logger.catching(e); + logger.error(getSessionMarker(), e.getMessage()); + throw e; + } finally { + setProgress(100); + } + return result; + } + + private Media getFirstUntranscodedMedia(DBCollection collection) { + Media[] result = new Media[] { null }; + //MV + String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS WHERE HOUSEID like 'M%' or HOUSEID like 'P%' or HOUSEID like 'R%' ORDER BY modified DESC"; + + //HTV + //String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS"; + IItemManager manager = getManager(); + manager.executeQuery(query, rs -> { + try { + long mediaId = rs.getLong(1); + Media media = manager.getMedia(mediaId); + //a nevgeneralas miatt az eredeti MediaFilesName nem jo, a pontos nev kell nekunk + String name = media.getMediaFileRealName(); + logger.info(getSessionMarker(), "Checking {}", name); + long existing = collection.find(new BasicDBObject("name", name)).count(); + if (existing > 0) { + logger.info(getSessionMarker(), "{} is on missing_lowres list", name); + return true; + } + + result[0] = media; + } catch (Exception e) { + logger.error(e); + } + return false; + }, null); + return result[0]; + } +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/RemoteJobStep.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/RemoteJobStep.java new file mode 100644 index 00000000..8e022f43 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/RemoteJobStep.java @@ -0,0 +1,43 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBObject; + +/* +import user.jobengine.server.steps.MediaCubeClient; +*/ +public class RemoteJobStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(String server, String template, String name, String profile) throws Exception { + try { + MediaCubeClient mc = new MediaCubeClient(server); + BasicDBObject params = new BasicDBObject(); + params.put("profile", profile); + params.put("input", "c:/_workspace/data/video/proba1.mxf"); + params.put("output", "c:/_video/proba1.mp4"); + + long jobId = mc.startjob(template, name, params); + logger.info(getMarker(), "Started {} on server {}", jobId, server); + while (true) { + BasicDBObject status = mc.getStatus(jobId); + if (status != null) + setProgress(status.getInt("progress")); + + String jobStatus = status.getString("status"); + if ("SUSPENDED".equals(jobStatus)) + throw new Exception(status.getString("description")); + + if ("FINISHED".equals(jobStatus)) + break; + } + + } catch (Exception e) { + throw e; + } + return new Object[] { null }; + } +} diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/steps/TSMRestoreStep.java b/server/-product/production/MEDIAVIVANTIS/jobs/steps/TSMRestoreStep.java index 5b410055..6b40e3b7 100644 --- a/server/-product/production/MEDIAVIVANTIS/jobs/steps/TSMRestoreStep.java +++ b/server/-product/production/MEDIAVIVANTIS/jobs/steps/TSMRestoreStep.java @@ -2,7 +2,9 @@ package user.jobengine.server.steps; import java.io.IOException; import java.nio.file.Paths; +import java.text.Normalizer; import java.util.List; +import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; @@ -28,6 +30,8 @@ import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; public class TSMRestoreStep extends JobStep { + private static final String DOT = "."; + public static final Pattern DIACRITICS_AND_FRIENDS = Pattern.compile("[\\p{InCombiningDiacriticalMarks}\\p{IsLm}\\p{IsSk}]+"); private static final Logger logger = LogManager.getLogger(); private IItemManager manager; private StoreUri targetUri; @@ -60,6 +64,9 @@ public class TSMRestoreStep extends JobStep { marker = jobRuntime.getSessionMarker(); setAndCheck(mediaCubeMedia, targetPath, targetNamePattern, localRetrievePath, globalRetrievePath, jobEngine); String targetFileName = String.format(targetNamePattern, sourceFileName); + //20210129 + //targetFileName = getMaximizedFileName(mediaCubeMedia, targetFileName, 120); + Timecode timecode = new Timecode(mediaCubeMedia.getLength(), Type.PAL); try { String details = String.format("%s (%s)", sourceFileName, timecode.toString()); @@ -99,6 +106,24 @@ public class TSMRestoreStep extends JobStep { return null; } + private String getMaximizedFileName(Media mediaCubeMedia, String targetFileName, int limit) { + String name = targetFileName; + String extension = ""; + if (name.contains(DOT)) { + extension = DOT + name.substring(name.lastIndexOf(DOT) + 1); + name = name.substring(0, name.lastIndexOf(DOT)); + } + String typeName = Normalizer.normalize(mediaCubeMedia.getItemType().getName(), Normalizer.Form.NFD); + typeName = DIACRITICS_AND_FRIENDS.matcher(typeName).replaceAll(""); + typeName = typeName.replace(" ", "_"); + + int allowedSize = limit - typeName.length() - 1 - extension.length(); + if (name.length() > allowedSize) + name = name.substring(0, allowedSize); + + return String.format("%s_%s%s", name, typeName, extension); + } + private String getSourceFileName(Media mediaCubeMedia, Store store) { List mediaFiles = mediaCubeMedia.getMediaFiles(); if (mediaFiles == null) diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/templates/remote-transcode.xml b/server/-product/production/MEDIAVIVANTIS/jobs/templates/remote-transcode.xml new file mode 100644 index 00000000..ce4c77b7 --- /dev/null +++ b/server/-product/production/MEDIAVIVANTIS/jobs/templates/remote-transcode.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/-product/production/MEDIAVIVANTIS/jobs/templates/template1.yaml b/server/-product/production/MEDIAVIVANTIS/jobs/templates/template1.yaml deleted file mode 100644 index 4459b9fa..00000000 --- a/server/-product/production/MEDIAVIVANTIS/jobs/templates/template1.yaml +++ /dev/null @@ -1,28 +0,0 @@ -jobtemplate: - multiInstance: true - useSessionLog: true - declarations: - parameters: - - name: param1 - type: java.lang.Integer - - name: param1 - type: java.lang.Integer - variables: - - name: var1 - type: java.lang.Integer - - name: var1 - type: java.lang.Integer - commands: - - type: Step1.java - weight: 1 - inputs: - - name: param1 - - name: param2 - outputs: - - name: var1 - - name: var2 - - type: StepS.java - weight: 1 - inputs: - - name: var1 - - name: var2 diff --git a/server/-product/production/MEDIAVIVANTIS/settings/application.yaml b/server/-product/production/MEDIAVIVANTIS/settings/application.yaml index ffd0b6ff..a50dcc2c 100644 --- a/server/-product/production/MEDIAVIVANTIS/settings/application.yaml +++ b/server/-product/production/MEDIAVIVANTIS/settings/application.yaml @@ -22,15 +22,8 @@ datasource: user: MAM password: VDani services: - ffmpeg: - execurable-location: /opt/ffmpeg/ffmpeg mediacube: proxy-root: /mediacube/data/lowres - nexio: - host: 10.10.1.55 - collection-name: nexioclips - use-mos-gateway: true - disabled: true jobs: validate-transfers: false copy-buffer-size: 32768 diff --git a/server/hu.user.mediacube.executors.tests/META-INF/MANIFEST.MF b/server/hu.user.mediacube.executors.tests/META-INF/MANIFEST.MF index 35b0ee22..4bf9bf02 100644 --- a/server/hu.user.mediacube.executors.tests/META-INF/MANIFEST.MF +++ b/server/hu.user.mediacube.executors.tests/META-INF/MANIFEST.MF @@ -7,6 +7,8 @@ Fragment-Host: user.jobengine.executors;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.apache.commons.io.filefilter;version="2.2.0", org.apache.commons.io.output;version="2.2.0", + org.apache.commons.logging, + org.apache.commons.logging.impl, org.apache.ibatis.jdbc;version="3.5.2", org.codehaus.groovy.control;version="3.0.3", org.junit diff --git a/server/hu.user.mediacube.executors.tests/settings/external-commands.yaml b/server/hu.user.mediacube.executors.tests/settings/external-commands.yaml new file mode 100644 index 00000000..e8ffa173 --- /dev/null +++ b/server/hu.user.mediacube.executors.tests/settings/external-commands.yaml @@ -0,0 +1,27 @@ +profiles: +- + name: profile1 + executable: /Programs/ffmpeg/bin/ffmpeg.exe + arguments: + - -y + - -v + - error + - -progress + - pipe:1 + - -i + - "%i" + - "%o" +- + name: length + executable: /Programs/ffmpeg/bin/ffprobe.exe + arguments: + - -v + - error + - -select_streams + - v:0 + - -show_entries + - stream=nb_frames + - -of + - default=noprint_wrappers=1:nokey=1 + - "%i" + \ No newline at end of file diff --git a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java index 8bc9adad..63de728e 100644 --- a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java +++ b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java @@ -60,6 +60,7 @@ import user.commons.RemoteFile; import user.commons.StoreUri; import user.commons.configuration.IConfiguration; import user.commons.configuration.SystemConfiguration; +import user.commons.mediaarea.MediaArea; import user.commons.mediaarea.StreamKind; import user.commons.mediatool.Timecode; import user.commons.mediatool.Timecode.Type; @@ -70,7 +71,9 @@ import user.jobengine.db.Media; import user.jobengine.server.steps.ArchiveItem; import user.jobengine.server.steps.EscortFiles; import user.jobengine.server.steps.FFMpeg; +import user.jobengine.server.steps.MediaCubeClient; import user.jobengine.server.steps.TSMExtendedRetrieveStep; +import user.jobengine.server.steps.shared.ExternalCommandExecutor; public class SmallTests { class Pojo extends PojoRoot { @@ -1352,4 +1355,45 @@ public class SmallTests { } } + //MediaCube client + @Test + public void test999994() throws Exception { + MediaCubeClient mc = new MediaCubeClient("http://localhost:9080"); + BasicDBObject params = new BasicDBObject("param", 10L); + long jobId = mc.startjob("cancelable.xml", "Teszt job", params); + System.out.println("Started " + jobId); + while (true) { + BasicDBObject status = mc.getStatus(jobId); + String jobStatus = status.getString("status"); + System.out.println(jobStatus + ", " + status.getString("progress")); + Thread.sleep(1000); + if ("SUSPENDED".equals(jobStatus) || "FINISHED".equals(jobStatus)) + break; + } + } + + @Test + public void test999995() throws Exception { + long progress[] = { 0, 0 }; + System.setProperty("user.dir", "c:\\temp"); + System.setProperty("jna.library.path", "c:\\temp"); + System.setProperty("java.library.path", "c:\\temp"); + MediaArea ma = new MediaArea(Paths.get("c:\\_workspace\\data\\video\\1.mxf")); + System.out.println(ma.inform()); + ma.process(); + System.out.println(ma.getFrameCount()); + + ExternalCommandExecutor executor = new ExternalCommandExecutor(); + executor.execute("profile1", "c:\\_workspace\\data\\video\\1.mxf", "c:\\_video\\test1.mp4", e -> { + String[] values = e.split("="); + if ("frame".equals(values[0])) { + progress[1] = Integer.parseInt(values[1]); + + long p = (int) (progress[1] * 100) / progress[0]; + if (p > 0) + System.out.println(p); + } + }); + } + } diff --git a/server/hu.user.mediacube.executors.tests/tsmapi-1.1.dll b/server/hu.user.mediacube.executors.tests/tsmapi-1.1.dll deleted file mode 100644 index b92868b4..00000000 Binary files a/server/hu.user.mediacube.executors.tests/tsmapi-1.1.dll and /dev/null differ diff --git a/server/user.commons.zk/.classpath b/server/user.commons.zk/.classpath index b61f2a9c..c25c0cc7 100644 --- a/server/user.commons.zk/.classpath +++ b/server/user.commons.zk/.classpath @@ -1,5 +1,6 @@ + diff --git a/server/user.commons.zk/META-INF/MANIFEST.MF b/server/user.commons.zk/META-INF/MANIFEST.MF index 08a53386..834a04b2 100644 --- a/server/user.commons.zk/META-INF/MANIFEST.MF +++ b/server/user.commons.zk/META-INF/MANIFEST.MF @@ -45,7 +45,8 @@ Bundle-ClassPath: ., lib/zsoup.jar, lib/zul.jar, lib/zuti.jar, - lib/zweb.jar + lib/zweb.jar, + lib/datahandler-syntax-highlight-1.0.0.jar Export-Package: bsh, bsh.classpath, bsh.collection, diff --git a/server/user.commons.zk/build.properties b/server/user.commons.zk/build.properties index 355af5ae..4faffaf1 100644 --- a/server/user.commons.zk/build.properties +++ b/server/user.commons.zk/build.properties @@ -42,4 +42,5 @@ bin.includes = META-INF/,\ lib/zsoup.jar,\ lib/zul.jar,\ lib/zuti.jar,\ - lib/zweb.jar + lib/zweb.jar,\ + lib/datahandler-syntax-highlight-1.0.0.jar diff --git a/server/user.commons.zk/lib/datahandler-syntax-highlight-1.0.0.jar b/server/user.commons.zk/lib/datahandler-syntax-highlight-1.0.0.jar new file mode 100644 index 00000000..5d8c3fa6 Binary files /dev/null and b/server/user.commons.zk/lib/datahandler-syntax-highlight-1.0.0.jar differ diff --git a/server/user.jobengine.executors/.classpath b/server/user.jobengine.executors/.classpath index fcb22981..75e2a0ee 100644 --- a/server/user.jobengine.executors/.classpath +++ b/server/user.jobengine.executors/.classpath @@ -2,7 +2,6 @@ - diff --git a/server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/ArchiveListBuilderStep.java b/server/user.jobengine.executors/amc/user/jobengine/server/steps/ArchiveListBuilderStep.java similarity index 100% rename from server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/ArchiveListBuilderStep.java rename to server/user.jobengine.executors/amc/user/jobengine/server/steps/ArchiveListBuilderStep.java diff --git a/server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/ArchiveRecursive.java b/server/user.jobengine.executors/amc/user/jobengine/server/steps/ArchiveRecursive.java similarity index 100% rename from server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/ArchiveRecursive.java rename to server/user.jobengine.executors/amc/user/jobengine/server/steps/ArchiveRecursive.java diff --git a/server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/CreateMissingLowresStep.java b/server/user.jobengine.executors/amc/user/jobengine/server/steps/CreateMissingLowresStep.java similarity index 100% rename from server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/CreateMissingLowresStep.java rename to server/user.jobengine.executors/amc/user/jobengine/server/steps/CreateMissingLowresStep.java diff --git a/server/user.jobengine.executors/amc/user/jobengine/server/steps/FileValidatorStep.java b/server/user.jobengine.executors/amc/user/jobengine/server/steps/FileValidatorStep.java index 90d77f0d..178c38ed 100644 --- a/server/user.jobengine.executors/amc/user/jobengine/server/steps/FileValidatorStep.java +++ b/server/user.jobengine.executors/amc/user/jobengine/server/steps/FileValidatorStep.java @@ -106,18 +106,9 @@ public class FileValidatorStep extends JobStep { if (Math.abs(frames - expectedFrameNumber) > 3) { Message msg = new ParameterizedMessage("Validációs hiba miatt a {} fájl másolása nem lehetséges.", filePath.getFileName()); EscortFiles.notifyRecipient(Paths.get(escortFile), logger, msg); - - //200924 komment, mert a mar TSM-bol letoltott mozikat hagyjuk ott, a download irany ugyis felulir - //EscortFiles.remove(filePath); - //EscortFiles.remove(Paths.get(escortFile)); - - //200911 a kommentet kivettem, mert ezeket is torolni kell - EscortFiles.remove(Paths.get(escortFile + EscortFiles.DOT_CATCHED)); + getJobRuntime().setDisableRetry(true); throw new Exception("Length mismatch in " + filePath + ". Expected: " + expectedFrameNumber + ", found: " + frames); } - if (frames != expectedFrameNumber) - logger.warn(getSessionMarker(), "A {} fájl másolása lehetséges, de a képkockaszám nem egyezik. Várt: {}, aktuális: {}", - expectedFrameNumber, frames); } if (StringUtils.isNotBlank(exceptedColorSpace)) { diff --git a/server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/TSMSimpleRestoreStep.java b/server/user.jobengine.executors/amc/user/jobengine/server/steps/TSMSimpleRestoreStep.java similarity index 100% rename from server/user.jobengine.executors/mediavivantis/user/jobengine/server/steps/TSMSimpleRestoreStep.java rename to server/user.jobengine.executors/amc/user/jobengine/server/steps/TSMSimpleRestoreStep.java diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java index f20291fd..bf32a0e8 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java @@ -32,6 +32,7 @@ public class CancelableStep extends JobStep { for (int i = 0; i < count; i++) { if (getJobRuntime().isWaitingCancel()) break; + Thread.sleep(200); int progress = (i + 1) * 100 / count; setProgress(progress); diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java index 0cd2e364..6a1d37a1 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java @@ -27,8 +27,6 @@ import user.commons.RemoteFile; import user.commons.StoreUri; import user.commons.remotestore.RemoteStoreProtocol; import user.jobengine.db.Store; -import user.jobengine.server.IJobEngine; -import user.jobengine.server.IJobRuntime; public class CleanupMountedLocationStep extends JobStep implements FileVisitor { @@ -69,6 +67,7 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

killDateFiles) { Date killDate = null; @@ -83,7 +82,8 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

directoryStream = null; @@ -246,7 +246,7 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

0) { + if (!skipArchiveCheck && filePath.toFile().length() > 0) { if (!isArchived(filePath)) { logger.error(marker, "A(z) {} anyag törlésre van kijelölve, de nem található az archívumban.", filePath); return; diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/Cmd.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/Cmd.java index 96e23807..19506511 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/Cmd.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/Cmd.java @@ -11,7 +11,7 @@ import org.apache.logging.log4j.Logger; import user.commons.configuration.SystemConfiguration; public class Cmd { - interface IResponseCallback { + public interface IResponseCallback { void onResponse(String line); } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/EnsureProxyPathExistanceStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/EnsureProxyPathExistanceStep.java new file mode 100644 index 00000000..7c148216 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/EnsureProxyPathExistanceStep.java @@ -0,0 +1,23 @@ +package user.jobengine.server.steps; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; + +public class EnsureProxyPathExistanceStep extends JobStep { + @StepEntry + public Object[] execute(String tempStoreName, String tempStoreProtocol, String fileName) throws Exception { + StoreUri tempStoreUri = getManager().getStoreUri(tempStoreName, Enum.valueOf(RemoteStoreProtocol.class, tempStoreProtocol)); + Path webPath = Paths.get(tempStoreUri.toString(true)); + if (fileName.length() > 2) { + Path subdir = Paths.get(fileName.substring(0, 1), fileName.substring(1, 2), fileName.substring(2, 3)); + EscortFiles.ensureUNCFolder(webPath.toString(), subdir.toString()); + } else { + EscortFiles.ensureUNCFolder(webPath.toString(), fileName); + } + return new Object[] { null }; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/FFMpeg.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/FFMpeg.java index dfe0b04f..ae646308 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/FFMpeg.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/FFMpeg.java @@ -10,12 +10,10 @@ import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import com.ibm.nosql.json.api.BasicDBObject; - -import user.commons.configuration.SystemConfiguration; import user.commons.mediatool.MediaInfo; public class FFMpeg { + public interface IProgressChanged { void onProgressChanged(long progress); } @@ -137,8 +135,10 @@ public class FFMpeg { Files.write(Paths.get(output, "index.m3u8"), indexLines); } + + static public void withProfile(String input, String output, String profile, IProgressChanged progressCallback) throws Exception { - BasicDBObject config = SystemConfiguration.getInstance().load("ffmpeg.yaml", BasicDBObject.class); + StringBuilder sb = new StringBuilder(); sb.append("-v panic -stats -y") diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/IntegrationTestStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/IntegrationTestStep.java new file mode 100644 index 00000000..51bc6103 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/IntegrationTestStep.java @@ -0,0 +1,81 @@ +package user.jobengine.server.steps; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.CountDownLatch; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.ListUtils; +import user.jobengine.db.ArchivedMedia; +import user.jobengine.db.Item; +import user.jobengine.db.Media; + +public class IntegrationTestStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute() throws Exception { + try { + //test_cancelable(finishLatch); + ArchivedMedia archivedMedia = new ArchivedMedia(); + Media media = getManager().getMedia(15285); + Item item = getManager().getItem(media.getItemId()); + archivedMedia.setItem(item); + archivedMedia.setMedia(media); + test_retrieve_ondemand(archivedMedia); + Path output = Paths.get("/mediacube/data", archivedMedia.getMedia().getHouseId(), + archivedMedia.getMedia().getHouseId() + "-ARCH-" + archivedMedia.getMedia().getMediaFileRealName()); + if (!output.toFile().exists()) + throw new Exception("File not exists: " + output); + + test_delete_materials(output.getParent().toString()); + + if (output.toFile().exists()) + throw new Exception("File exists: " + output); + + } catch (Exception e) { + logger.info(e.getMessage()); + throw e; + } + return null; + } + + private void test_cancelable() throws Exception { + CountDownLatch finishLatch = new CountDownLatch(1); + getEngine().submit(null, e -> { + if (e.isRuntimeTerminated()) + finishLatch.countDown(); + }, "cancelable.xml", "Test cancelable", ListUtils.asMap("param", 1)); + finishLatch.await(); + } + + private void test_delete_materials(String source) throws Exception { + CountDownLatch finishLatch = new CountDownLatch(1); + getEngine().submit(null, e -> { + if (e.isRuntimeTerminated()) + finishLatch.countDown(); + }, "delete-materials.xml", "Test delete-materials", ListUtils.asMap("sourcePath", source, "skipArchiveCheck", true)); + finishLatch.await(); + } + + private void test_retrieve_ondemand(ArchivedMedia archivedMedia) throws Exception { + + CountDownLatch finishLatch = new CountDownLatch(1); + getEngine().submit(null, e -> { + if (e.isRuntimeTerminated()) + finishLatch.countDown(); + + }, "retrieve-ondemand.xml", "Test retrieve-ondemand", + ListUtils.asMap("globalRetrievePath", "file://10.11.1.100", "localRetrievePath", "/mediacube/data", "materialOutputFolder", "/", + "promoOutputFolder", "/", "advertisementOutputFolder", "/", "octopusOutputFolder", "/", "genericOutputFolder", "/", + "onlineOutputFolder", "/", "killDateDays", -1, "nexioAgency", "ARCHIVE_RESTORE", "nexioPort", 2098, "nexioUserName", "administrator", + "nexioPassword", "system", "archivedMedia", archivedMedia, "successRecipient", "vasary@elgekko.net", "houseId", + archivedMedia.getMedia().getHouseId(), "targetPathType", "0")); + + finishLatch.await(); + + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaCubeClient.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaCubeClient.java new file mode 100644 index 00000000..840925e4 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaCubeClient.java @@ -0,0 +1,77 @@ +package user.jobengine.server.steps; + +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation.Builder; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jboss.resteasy.client.jaxrs.ResteasyClient; +import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; +import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; +import org.jboss.resteasy.specimpl.MultivaluedMapImpl; + +import com.ibm.nosql.json.JSONUtil; +import com.ibm.nosql.json.api.BasicDBObject; + +public class MediaCubeClient { + private static Logger logger = LogManager.getLogger(); + private ResteasyWebTarget webTarget; + + public MediaCubeClient(String address) { + ResteasyClient client = new ResteasyClientBuilder().build(); + webTarget = client.target(address); + } + + BasicDBObject getDbObject(String json) { + BasicDBObject result = (BasicDBObject) JSONUtil.jsonToDbObject(json); + + if (result == null) + throw new NullPointerException("API Result is null!"); + + if (result.containsKey("exception")) { + BasicDBObject e = (BasicDBObject) result.get("exception"); + throw new RuntimeException(e.getString("message")); + } + //{"exception":{"message":"Invalid credentials.","publicName":"AuthenticationFailedException"}} + return result; + } + + public BasicDBObject getStatus(long jobId) { + MultivaluedMap vars = new MultivaluedMapImpl<>(); + vars.add("jobId", jobId); + Response response = query("services/rest/jobengine/jobstatus", vars).get(); + if (response.getStatus() != Status.OK.getStatusCode()) { + logger.error(response.readEntity(String.class)); + System.out.println(response.readEntity(String.class)); + return null; + } + String result = response.readEntity(String.class); + return getDbObject(result); + } + + private Builder query(String path, MultivaluedMap vars) { + ResteasyWebTarget target = webTarget.path(path).queryParams(vars); + Builder result = target.request(); + return result; + } + + public long startjob(String template, String name, BasicDBObject jobParams) throws Exception { + MultivaluedMap vars = new MultivaluedMapImpl<>(); + vars.add("template", template); + vars.add("name", name); + Response response = query("services/rest/jobengine/startjob", vars).post(Entity.entity(jobParams.toString(), MediaType.APPLICATION_JSON)); + + if (response.getStatus() != Status.OK.getStatusCode()) { + logger.error(response.readEntity(String.class)); + return 0; + } + + String resultObject = response.readEntity(String.class); + return Long.parseLong(resultObject); + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/PrepareMediaRestoreStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/PrepareMediaRestoreStep.java new file mode 100644 index 00000000..e9246724 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/PrepareMediaRestoreStep.java @@ -0,0 +1,32 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; + +public class PrepareMediaRestoreStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(Media media, String tempStoreName, String tempStoreProtocol) throws Exception { + StoreUri mediaStoreUri = null; + for (MediaFile mediaFile : media.getMediaFiles()) { + Store store = mediaFile.getStore(); + if (store.isSystem() && !store.isLowres()) { + mediaStoreUri = store.getStoreUri(RemoteStoreProtocol.TSM); + if (mediaStoreUri != null) + break; + } + } + + StoreUri tempStoreUri = getManager().getStoreUri(tempStoreName, Enum.valueOf(RemoteStoreProtocol.class, tempStoreProtocol)); + + return new Object[] { mediaStoreUri, tempStoreUri, media.getMediaFileRealName() }; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/PrepareRemoteTranscodeJobParametersStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/PrepareRemoteTranscodeJobParametersStep.java new file mode 100644 index 00000000..8fa6821e --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/PrepareRemoteTranscodeJobParametersStep.java @@ -0,0 +1,32 @@ +package user.jobengine.server.steps; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import com.ibm.nosql.json.api.BasicDBObject; + +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; + +public class PrepareRemoteTranscodeJobParametersStep extends JobStep { + @StepEntry + public Object[] execute(String profileName, String tempStoreName, String tempStoreProtocol, String fileName) throws Exception { + Path inputPath = Paths.get("m:/", fileName); + + StoreUri tempStoreUri = getManager().getStoreUri(tempStoreName, Enum.valueOf(RemoteStoreProtocol.class, tempStoreProtocol)); + String outFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".mp4"; + Path outputPath = null; + if (fileName.length() > 2) { + outputPath = Paths.get(tempStoreUri.toString(true), fileName.substring(0, 1), fileName.substring(1, 2), fileName.substring(2, 3), outFileName); + } else { + outputPath = Paths.get(tempStoreUri.toString(true), fileName, outFileName); + } + + BasicDBObject parameters = new BasicDBObject(); + parameters.put("profile", profileName); + parameters.put("input", inputPath.toString()); + parameters.put("output", outputPath.toString()); + return new Object[] { parameters }; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/QueryMissingProxyMediaStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/QueryMissingProxyMediaStep.java new file mode 100644 index 00000000..9e8d1949 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/QueryMissingProxyMediaStep.java @@ -0,0 +1,76 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; + +import user.commons.MediaCubeUndoMarker; +import user.commons.nosql.NoSQLUtils; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; + +public class QueryMissingProxyMediaStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute() throws Exception { + Object[] result = new Object[] { null }; + DB db = NoSQLUtils.getNoSQLDB(); + DBCollection collection = db.getCollection("missing_lowres"); + Media media = getFirstUntranscodedMedia(collection); + + try { + if (media == null) { + logger.info(new MediaCubeUndoMarker(getSessionMarker().getSessionID()), "Nincs feldolgozandó hiány."); + // throw new Exception("Nincs feldolgozandó hiány."); + cancel(); + return null; + } + + String name = media.getMediaFileRealName(); + collection.save(new BasicDBObject("name", name)); + logger.info(getSessionMarker(), "Processing mediaID: {}", media.getId()); + result[0] = media; + } catch (Exception e) { + logger.catching(e); + logger.error(getSessionMarker(), e.getMessage()); + throw e; + } finally { + setProgress(100); + } + return result; + } + + private Media getFirstUntranscodedMedia(DBCollection collection) { + Media[] result = new Media[] { null }; + //MV + String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS WHERE HOUSEID like 'M%' or HOUSEID like 'P%' or HOUSEID like 'R%' ORDER BY modified DESC"; + + //HTV + //String query = "SELECT mediaid FROM VW_MISSING_PROXY_IDS"; + IItemManager manager = getManager(); + manager.executeQuery(query, rs -> { + try { + long mediaId = rs.getLong(1); + Media media = manager.getMedia(mediaId); + //a nevgeneralas miatt az eredeti MediaFilesName nem jo, a pontos nev kell nekunk + String name = media.getMediaFileRealName(); + logger.info(getSessionMarker(), "Checking {}", name); + long existing = collection.find(new BasicDBObject("name", name)).count(); + if (existing > 0) { + logger.info(getSessionMarker(), "{} is on missing_lowres list", name); + return true; + } + + result[0] = media; + } catch (Exception e) { + logger.error(e); + } + return false; + }, null); + return result[0]; + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/RemoteJobStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/RemoteJobStep.java new file mode 100644 index 00000000..b215c27b --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/RemoteJobStep.java @@ -0,0 +1,40 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBObject; + +/* +import user.jobengine.server.steps.MediaCubeClient; +*/ +public class RemoteJobStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(String remoteServer, String template, String name, BasicDBObject remoteJobParameters) throws Exception { + try { + MediaCubeClient mc = new MediaCubeClient(remoteServer); + long jobId = mc.startjob(template, name, remoteJobParameters); + logger.info(getMarker(), "Started {} on server {}", jobId, remoteServer); + while (true) { + BasicDBObject status = mc.getStatus(jobId); + if (status != null) + setProgress(status.getInt("progress")); + + Thread.sleep(3000); + + String jobStatus = status.getString("status"); + if ("SUSPENDED".equals(jobStatus)) + throw new Exception(status.getString("description")); + + if ("FINISHED".equals(jobStatus)) + break; + } + + } catch (Exception e) { + throw e; + } + return new Object[] { null }; + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java index 28e66d3f..358e8827 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java @@ -23,6 +23,9 @@ public class TestForkCancelableStep extends JobStep { //jobEngine.submit(jobRuntime, null, CHILD_TEMPLATE, CHILD_TITLE, ListUtils.asMap("itemID", i)); // IJobRuntime runtime = jobEngine.submit(jobRuntime, null, CHILD_TEMPLATE, "JOB " + i, ListUtils.asMap("param", i)); IJobRuntime runtime = getEngine().submit(getJobRuntime(), e -> { + IJobRuntime r = (IJobRuntime) e.getSource(); + if (r.isDisableRetry()) + return; if (e.getStatus().equals(JobStatus.CANCELED) || e.getStatus().equals(JobStatus.SUSPENDED)) logger.info("Cleanup occured because status is {} {}", e.getStatus(), ((IJob) e.getSource()).getId()); }, CHILD_TEMPLATE, "JOB " + i, 0, IJobEngine.DEFAULT_OWNER, ListUtils.asMap("param", i)); diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFMpegStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFMpegStep.java new file mode 100644 index 00000000..7e4c3a1f --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFMpegStep.java @@ -0,0 +1,48 @@ +package user.jobengine.server.steps; + +import java.nio.file.Paths; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.mediaarea.MediaArea; +import user.jobengine.server.steps.shared.ExternalCommandExecutor; +import user.jobengine.server.steps.shared.IExternalCallback; + +/* +import user.jobengine.server.steps.shared.ExternalProfile; +import user.jobengine.server.steps.shared.ExternalProfilesConfig; + */ +public class TranscodeFFMpegStep extends JobStep implements IExternalCallback { + private static final Logger logger = LogManager.getLogger(); + private long allFrameCount; + private long processedFrameCount; + + @StepEntry + public Object[] execute(String input, String output, String profile) throws Exception { + try { + MediaArea ma = new MediaArea(Paths.get(input)); + ma.process(); + allFrameCount = ma.getFrameCount(); + + ExternalCommandExecutor executor = new ExternalCommandExecutor(); + executor.execute(profile, input, output, this); + } catch (Exception e) { + logger.error(getMarker(), "Media information not available. System message: {}", e.getMessage()); + throw e; + } + return null; + } + + @Override + public void onResponse(String line) { + String[] values = line.split("="); + if ("frame".equals(values[0])) { + processedFrameCount = Integer.parseInt(values[1]); + int progress = (int) (processedFrameCount * 100 / allFrameCount); + if (progress > 0) + setProgress(progress); + } + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalCommand.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalCommand.java new file mode 100644 index 00000000..307f36d0 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalCommand.java @@ -0,0 +1,79 @@ +package user.jobengine.server.steps.shared; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ExternalCommand { + private static final Logger logger = LogManager.getLogger(); + private ExternalProfile profile; + + public ExternalCommand(ExternalProfile profile) { + this.profile = profile; + } + + public String execute(String input, String output, boolean firstResponse, IExternalCallback responseCallBack) throws Exception { + List arguments = getArguments(input, output); + List command = new ArrayList<>(); + command.add(profile.getExecutable()); + command.addAll(arguments); + + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command(command); + + String result = null; + try { + logger.info("Executing : {}", processBuilder.command()); + + Process process = processBuilder.start(); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { + String line = null; + while ((line = reader.readLine()) != null) { + logger.debug("Process response: {}", line); + if (responseCallBack != null) + responseCallBack.onResponse(line); + //System.out.println(line); + if (line != null && line.length() > 0) { + result = line; + if (firstResponse) + break; + } + } + int exitCode = process.waitFor(); + if (exitCode != 0) { + StringBuilder msg = new StringBuilder(); + try (BufferedReader errReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) { + String errline = null; + while ((errline = errReader.readLine()) != null) { + msg.append(errline); + } + } catch (Exception ex) { + } + + throw new Exception("Exited with error code : " + exitCode + ". " + msg); + } + } catch (Exception e) { + throw e; + } + } catch (Exception e) { + logger.error(e); + throw e; + } + + return result; + } + + private List getArguments(String input, String output) { + List result = new ArrayList<>(); + + profile.getArguments().forEach(i -> { + result.add(i.replace("%i", input).replace("%o", output)); + }); + return result; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalCommandExecutor.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalCommandExecutor.java new file mode 100644 index 00000000..34512b96 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalCommandExecutor.java @@ -0,0 +1,39 @@ +package user.jobengine.server.steps.shared; + +import user.commons.configuration.SystemConfiguration; + +/* + package user.jobengine.server.steps.IExternalCallback; + package user.jobengine.server.steps.ExternalProfile; + package user.jobengine.server.steps.ExternalProfilesConfig; + package user.jobengine.server.steps.ExternalCommand; + + */ +public class ExternalCommandExecutor { + + public void execute(String profileName, String input, String output, IExternalCallback responseCallBack) throws Exception { + ExternalCommand externalCommand = getExternalCommand(profileName); + externalCommand.execute(input, output, false, responseCallBack); + } + + private ExternalCommand getExternalCommand(String profileName) throws Exception { + ExternalProfilesConfig config = SystemConfiguration.getInstance().load("settings/external-commands.yaml", ExternalProfilesConfig.class); + + if (config == null) + throw new Exception("Missing external-commands.yaml configuration"); + + ExternalProfile selectedProfile = null; + for (ExternalProfile profile : config.getProfiles()) { + if (profileName.equals(profile.getName())) { + selectedProfile = profile; + break; + } + } + + if (selectedProfile == null) + throw new Exception("Missing profile " + profileName + " in external-commands.yaml configuration"); + + return new ExternalCommand(selectedProfile); + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalProfile.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalProfile.java new file mode 100644 index 00000000..68e22f4c --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalProfile.java @@ -0,0 +1,33 @@ +package user.jobengine.server.steps.shared; + +import java.util.List; + +public class ExternalProfile { + private String executable; + private String name; + private List arguments; + + public List getArguments() { + return arguments; + } + + public String getExecutable() { + return executable; + } + + public String getName() { + return name; + } + + public void setArguments(List arguments) { + this.arguments = arguments; + } + + public void setExecutable(String executable) { + this.executable = executable; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalProfilesConfig.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalProfilesConfig.java new file mode 100644 index 00000000..7ef77291 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/ExternalProfilesConfig.java @@ -0,0 +1,15 @@ +package user.jobengine.server.steps.shared; + +import java.util.List; + +public class ExternalProfilesConfig { + private List profiles; + + public List getProfiles() { + return profiles; + } + + public void setProfiles(List profiles) { + this.profiles = profiles; + } +} \ No newline at end of file diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/IExternalCallback.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/IExternalCallback.java new file mode 100644 index 00000000..1e071913 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/shared/IExternalCallback.java @@ -0,0 +1,5 @@ +package user.jobengine.server.steps.shared; + +public interface IExternalCallback { + void onResponse(String data); +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/configuration/SystemConfiguration.java b/server/user.jobengine.osgi.commons/src/user/commons/configuration/SystemConfiguration.java index cd575a5c..7f9014e9 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/configuration/SystemConfiguration.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/configuration/SystemConfiguration.java @@ -91,7 +91,10 @@ public class SystemConfiguration implements IConfiguration { if (!result.getClass().isAssignableFrom(defValue.getClass())) throw new ClassCastException(result.getClass() + " ? " + defValue.getClass()); } catch (Exception e) { - logger.error("{} read error. {}", fqn, e.getMessage()); + if (e instanceof NullPointerException) + logger.warn("{} variable is not defined in configuration.", fqn); + else + logger.warn("{} read error. {}", fqn, e.getMessage()); result = defValue; } return result; diff --git a/server/user.jobengine.osgi.commons/src/user/commons/mediaarea/MediaArea.java b/server/user.jobengine.osgi.commons/src/user/commons/mediaarea/MediaArea.java index 1c8bdd96..b7aaed57 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/mediaarea/MediaArea.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/mediaarea/MediaArea.java @@ -8,6 +8,7 @@ public class MediaArea { private int height; private String displayAspect; private String formatProfile = ""; + private long frameCount; public MediaArea(Path filePath) { this.filePath = filePath; @@ -26,16 +27,31 @@ public class MediaArea { return height; } + public String inform() { + String result = null; + //auto closable + try (MediaInfo mi = new MediaInfo(filePath.toAbsolutePath().toString())) { + result = mi.inform(); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + return result; + } + public void process() { //auto closable try (MediaInfo mi = new MediaInfo(filePath.toAbsolutePath().toString())) { height = Integer.parseInt(mi.get(StreamKind.Video, 0, "Height")); displayAspect = mi.get(StreamKind.Video, 0, "DisplayAspectRatio/String"); formatProfile = mi.get(StreamKind.Video, 0, "Format_Profile").toUpperCase(); + frameCount = Integer.parseInt(mi.get(StreamKind.Video, 0, "FrameCount")); } catch (Exception ex) { throw new RuntimeException(ex); } } + public long getFrameCount() { + return frameCount; + } } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioAPI.java index fd2d114e..1910089b 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioAPI.java @@ -22,8 +22,13 @@ public class NexioAPI implements INexioAPI { @Override public NexioDispatcher getDispatcher() { - if (dispatcher == null) - dispatcher = new NexioDispatcher(); + try { + if (dispatcher == null) + dispatcher = new NexioDispatcher(); + + } catch (Exception e) { + logger.warn(e.getMessage()); + } return dispatcher; } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDispatcher.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDispatcher.java index 98097f88..fa3871d3 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDispatcher.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDispatcher.java @@ -43,10 +43,10 @@ public class NexioDispatcher implements ClipEventListener { private static final String EXTAGENCY = "extagency"; private static final String RECORDDATE = "recorddate"; private static final String LONGNAMEID = "longnameid"; - public static final String CLIP_COLLECTION_NAME = SystemConfiguration.getInstance().value("services.nexio.collection-name"); - private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host"); - private static boolean disabled = SystemConfiguration.getInstance().value("services.nexio.disabled", true); - private static boolean[] useMOSGateways = new boolean[] { SystemConfiguration.getInstance().value("services.nexio.use-mos-gateway") }; + public static String CLIP_COLLECTION_NAME; + private static String NEXIO_HOST; + private static boolean disabled; + private static boolean useMOSGateways; static private final byte[] GET_SPECIAL_ID_ATTRIBUTES_REQ = { (byte) 0xC8, (byte) 0x84 }; static private final char[] hexArray = "0123456789ABCDEF".toCharArray(); @@ -97,6 +97,12 @@ public class NexioDispatcher implements ClipEventListener { private MediaListener mediaListener; public NexioDispatcher() { + + NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host"); + CLIP_COLLECTION_NAME = SystemConfiguration.getInstance().value("services.nexio.collection-name"); + disabled = SystemConfiguration.getInstance().value("services.nexio.disabled", true); + useMOSGateways = SystemConfiguration.getInstance().value("services.nexio.use-mos-gateway", false); + this.db = NoSQLUtils.getNoSQLDB(); // Runtime.getRuntime().addShutdownHook(new Thread() { @@ -234,11 +240,11 @@ public class NexioDispatcher implements ClipEventListener { } private void innerStartup() { - + final boolean gw = useMOSGateways; worker = new Thread(() -> { try { logger.info("Initial clip import started"); - if (useMOSGateways[0]) { + if (gw) { NexioDataMiner dm = new NexioDataMiner(); dm.transferClips(); } else { @@ -305,14 +311,14 @@ public class NexioDispatcher implements ClipEventListener { } /* - + int c = connection.read(buffer, 0, 2); //2 bytes hosszan az idokozben hozzaadott id-k szamossaga if (c < 2) { throw new ProtocolException("c, 2, 2"); } //MSB, LSB - + return nofIds; */ return ret; diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO.java new file mode 100644 index 00000000..570f9098 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO.java @@ -0,0 +1,390 @@ +/*@lineinfo:filename=BreakDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class BreakIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int thumbnailNdx; + private int createdNdx; + private int mediaIdNdx; + private int inPointNdx; + private int breakTypeNdx; + private int idNdx; + public BreakIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + breakTypeNdx = findColumn("breakType"); + inPointNdx = findColumn("inPoint"); + mediaIdNdx = findColumn("mediaId"); + createdNdx = findColumn("created"); + thumbnailNdx = findColumn("thumbnail"); + } + public BreakIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + breakTypeNdx = findColumn("breakType"); + inPointNdx = findColumn("inPoint"); + mediaIdNdx = findColumn("mediaId"); + createdNdx = findColumn("created"); + thumbnailNdx = findColumn("thumbnail"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String breakType() + throws java.sql.SQLException + { + return resultSet.getString(breakTypeNdx); + } + public long inPoint() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(inPointNdx); + } + public long mediaId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(mediaIdNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public byte[] thumbnail() + throws java.sql.SQLException + { + return resultSet.getBytes(thumbnailNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^114*/ + +@SuppressWarnings("unused") +class BreakDAO extends EntityBaseDAO { + + public BreakDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + BreakIter iterator = (BreakIter) iter; + while (iterator.next()) { + Break entity = new Break(); + entity.setId(iterator.id()); + entity.setBreakType(ItemManagerData.toBreakType(iterator.breakType())); + entity.setInPoint(iterator.inPoint()); + entity.setMediaId(iterator.mediaId()); + entity.setCreated(iterator.created()); + entity.setThumbnail(iterator.thumbnail()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + BreakIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:43^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new BreakIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:43^111*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + BreakIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:50^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK WHERE MEDIAID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new BreakIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:50^116*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + BreakIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:57^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new BreakIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:57^96*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:63^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM BREAK WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:63^52*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:68^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE BREAK DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:68^86*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Break obj = (Break) entity; + long id = obj.getId(); + String breakType = obj.getBreakType().toString(); + long inPoint = obj.getInPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + /*@lineinfo:generated-code*//*@lineinfo:80^2*/ + +// ************************************************************ +// #sql [context] { UPDATE BREAK SET BREAKTYPE = :breakType, INPOINT = :inPoint, MEDIAID = :mediaId, THUMBNAIL = :thumbnail WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, breakType); + __sJT_stmt.setLong(2, inPoint); + __sJT_stmt.setLong(3, mediaId); + __sJT_stmt.setBytes(4, thumbnail); + __sJT_stmt.setLong(5, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:80^138*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Break obj = (Break) entity; + String breakType = obj.getBreakType().toString(); + long inPoint = obj.getInPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + /*@lineinfo:generated-code*//*@lineinfo:91^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO BREAK (BREAKTYPE, INPOINT, MEDIAID, THUMBNAIL) VALUES (:breakType, :inPoint, :mediaId, :thumbnail) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, breakType); + __sJT_stmt.setLong(2, inPoint); + __sJT_stmt.setLong(3, mediaId); + __sJT_stmt.setBytes(4, thumbnail); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:91^130*/ + } + +}/*@lineinfo:generated-code*/class BreakDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static BreakDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.BreakDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new BreakDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private BreakDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.BreakDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO.java new file mode 100644 index 00000000..73984061 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO.java @@ -0,0 +1,312 @@ +/*@lineinfo:filename=FolderDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class FolderIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int childIdNdx; + private int parentIdNdx; + private int idNdx; + public FolderIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + parentIdNdx = findColumn("parentId"); + childIdNdx = findColumn("childId"); + } + public FolderIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + parentIdNdx = findColumn("parentId"); + childIdNdx = findColumn("childId"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long parentId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(parentIdNdx); + } + public long childId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(childIdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^61*/ + +@SuppressWarnings("unused") +public class FolderDAO extends EntityBaseDAO { + + public FolderDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + FolderIter iterator = (FolderIter) iter; + while (iterator.next()) { + Folder entity = new Folder(); + entity.setId(iterator.id()); + entity.setParentId(iterator.parentId()); + entity.setChildId(iterator.childId()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + FolderIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:38^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new FolderIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:38^82*/ + return iter; + } + + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + FolderIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:44^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER WHERE CHILDID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new FolderIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:44^87*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + FolderIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:51^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new FolderIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:51^67*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:57^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM FOLDER WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:57^53*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:62^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE FOLDER DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:62^87*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Folder obj = (Folder) entity; + long parentId = obj.getParentId(); + long childId = obj.getChildId(); + + /*@lineinfo:generated-code*//*@lineinfo:71^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO FOLDER (PARENTID, CHILDID) VALUES (:parentId, :childId) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, parentId); + __sJT_stmt.setLong(2, childId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:71^87*/ + } + +}/*@lineinfo:generated-code*/class FolderDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static FolderDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.FolderDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new FolderDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private FolderDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.FolderDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemIter.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemIter.java new file mode 100644 index 00000000..5eb8196c --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemIter.java @@ -0,0 +1,86 @@ +/*@lineinfo:filename=ItemIter*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import java.sql.Timestamp; + +/*@lineinfo:generated-code*//*@lineinfo:5^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +public class ItemIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int isFolderNdx; + private int createdNdx; + private int houseIdNdx; + private int itemTypeIdNdx; + private int descriptionNdx; + private int titleNdx; + private int idNdx; + public ItemIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + titleNdx = findColumn("title"); + descriptionNdx = findColumn("description"); + itemTypeIdNdx = findColumn("itemTypeId"); + houseIdNdx = findColumn("houseId"); + createdNdx = findColumn("created"); + isFolderNdx = findColumn("isFolder"); + } + public ItemIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + titleNdx = findColumn("title"); + descriptionNdx = findColumn("description"); + itemTypeIdNdx = findColumn("itemTypeId"); + houseIdNdx = findColumn("houseId"); + createdNdx = findColumn("created"); + isFolderNdx = findColumn("isFolder"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String title() + throws java.sql.SQLException + { + return resultSet.getString(titleNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public long itemTypeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(itemTypeIdNdx); + } + public String houseId() + throws java.sql.SQLException + { + return resultSet.getString(houseIdNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public String isFolder() + throws java.sql.SQLException + { + return resultSet.getString(isFolderNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:5^140*//*@lineinfo:generated-code*/ \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO.java new file mode 100644 index 00000000..ba6c52aa --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO.java @@ -0,0 +1,169 @@ +/*@lineinfo:filename=MasterIdDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:11^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MasterIdIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int createdNdx; + private int idNdx; + public MasterIdIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + createdNdx = findColumn("created"); + } + public MasterIdIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + createdNdx = findColumn("created"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:11^53*/ + +@SuppressWarnings("unused") +class MasterIdDAO extends EntityBaseDAO { + + public MasterIdDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ShotIter iterator = (ShotIter) iter; + while (iterator.next()) { + MasterId entity = new MasterId(); + entity.setId(iterator.id()); + entity.setCreated(iterator.created()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MasterId obj = (MasterId) entity; + obj.setCreated(new Timestamp(new Date().getTime())); + Timestamp created = obj.getCreated(); + + /*@lineinfo:generated-code*//*@lineinfo:44^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO MASTERID (CREATED) VALUES (:created) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MasterIdDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setTimestamp(1, created); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:44^68*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:49^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE MASTERID DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MasterIdDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:49^89*/ + } +}/*@lineinfo:generated-code*/class MasterIdDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MasterIdDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MasterIdDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MasterIdDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MasterIdDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MasterIdDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO.java new file mode 100644 index 00000000..3dc91a08 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO.java @@ -0,0 +1,906 @@ +/*@lineinfo:filename=MetadataDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.jobengine.db.ItemManagerData.SignalType; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:12^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MetadataIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int metadataElementIdNdx; + private int itemTypeIdNdx; + private int parameterNdx; + private int staticTableNdx; + private int sqlFieldNdx; + private int pojoFieldNdx; + private int listTypeNdx; + private int guiTypeNdx; + private int isSearchableNdx; + private int isGeneratedNdx; + private int isListableNdx; + private int isEditableNdx; + private int isDbNullableNdx; + private int isDbUniqueNdx; + private int isDbIndexNdx; + private int idNdx; + public MetadataIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + isDbIndexNdx = findColumn("isDbIndex"); + isDbUniqueNdx = findColumn("isDbUnique"); + isDbNullableNdx = findColumn("isDbNullable"); + isEditableNdx = findColumn("isEditable"); + isListableNdx = findColumn("isListable"); + isGeneratedNdx = findColumn("isGenerated"); + isSearchableNdx = findColumn("isSearchable"); + guiTypeNdx = findColumn("guiType"); + listTypeNdx = findColumn("listType"); + pojoFieldNdx = findColumn("pojoField"); + sqlFieldNdx = findColumn("sqlField"); + staticTableNdx = findColumn("staticTable"); + parameterNdx = findColumn("parameter"); + itemTypeIdNdx = findColumn("itemTypeId"); + metadataElementIdNdx = findColumn("metadataElementId"); + } + public MetadataIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + isDbIndexNdx = findColumn("isDbIndex"); + isDbUniqueNdx = findColumn("isDbUnique"); + isDbNullableNdx = findColumn("isDbNullable"); + isEditableNdx = findColumn("isEditable"); + isListableNdx = findColumn("isListable"); + isGeneratedNdx = findColumn("isGenerated"); + isSearchableNdx = findColumn("isSearchable"); + guiTypeNdx = findColumn("guiType"); + listTypeNdx = findColumn("listType"); + pojoFieldNdx = findColumn("pojoField"); + sqlFieldNdx = findColumn("sqlField"); + staticTableNdx = findColumn("staticTable"); + parameterNdx = findColumn("parameter"); + itemTypeIdNdx = findColumn("itemTypeId"); + metadataElementIdNdx = findColumn("metadataElementId"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String isDbIndex() + throws java.sql.SQLException + { + return resultSet.getString(isDbIndexNdx); + } + public String isDbUnique() + throws java.sql.SQLException + { + return resultSet.getString(isDbUniqueNdx); + } + public String isDbNullable() + throws java.sql.SQLException + { + return resultSet.getString(isDbNullableNdx); + } + public String isEditable() + throws java.sql.SQLException + { + return resultSet.getString(isEditableNdx); + } + public String isListable() + throws java.sql.SQLException + { + return resultSet.getString(isListableNdx); + } + public String isGenerated() + throws java.sql.SQLException + { + return resultSet.getString(isGeneratedNdx); + } + public String isSearchable() + throws java.sql.SQLException + { + return resultSet.getString(isSearchableNdx); + } + public String guiType() + throws java.sql.SQLException + { + return resultSet.getString(guiTypeNdx); + } + public String listType() + throws java.sql.SQLException + { + return resultSet.getString(listTypeNdx); + } + public String pojoField() + throws java.sql.SQLException + { + return resultSet.getString(pojoFieldNdx); + } + public String sqlField() + throws java.sql.SQLException + { + return resultSet.getString(sqlFieldNdx); + } + public String staticTable() + throws java.sql.SQLException + { + return resultSet.getString(staticTableNdx); + } + public String parameter() + throws java.sql.SQLException + { + return resultSet.getString(parameterNdx); + } + public long itemTypeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(itemTypeIdNdx); + } + public long metadataElementId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(metadataElementIdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:12^318*/ + +@SuppressWarnings("unused") +class MetadataDAO extends EntityBaseDAO { + + public MetadataDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) + createTable(context.getConnection(), entity); + manager.notifyItemTypeChange(entity, SignalType.CREATE); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) { + dropTable(context.getConnection(), entity); + createTable(context.getConnection(), entity); + } + manager.notifyItemTypeChange(entity, SignalType.UPDATE); + } + + @Override + protected void afterDelete(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) + dropTable(context.getConnection(), entity); + manager.notifyItemTypeChange(entity, SignalType.DELETE); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MetadataIter iterator = (MetadataIter) iter; + while (iterator.next()) { + Metadata entity = new Metadata(); + entity.setId(iterator.id()); + entity.setIsDbIndex(iterator.isDbIndex().equals("Y") ? true : false); + entity.setIsDbUnique(iterator.isDbUnique().equals("Y") ? true : false); + entity.setIsDbNullable(iterator.isDbNullable().equals("Y") ? true : false); + entity.setIsEditable(iterator.isEditable().equals("Y") ? true : false); + entity.setIsListable(iterator.isListable().equals("Y") ? true : false); + entity.setIsGenerated(iterator.isGenerated().equals("Y") ? true : false); + entity.setIsSearchable(iterator.isSearchable().equals("Y") ? true : false); + entity.setGuiType(ItemManagerData.toGuiType(iterator.guiType())); + entity.setListType(ItemManagerData.toListType(iterator.listType())); + entity.setPojoField(iterator.pojoField()); + entity.setSqlField(iterator.sqlField()); + entity.setStaticTable(ItemManagerData.toStaticTable(iterator.staticTable())); + entity.setParameter(iterator.parameter()); + entity.setItemTypeId(iterator.itemTypeId()); + entity.setMetadataElementId(iterator.metadataElementId()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:81^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:81^248*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:88^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE,GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE ITEMTYPEID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:88^255*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:95^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:95^233*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:101^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM METADATA WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:101^55*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:106^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE METADATA DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:106^89*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Metadata obj = (Metadata) entity; + long id = obj.getId(); + String isDbIndex = obj.getIsDbIndex() == true ? "Y" : "N"; + String isDbUnique = obj.getIsDbUnique() == true ? "Y" : "N"; + String isDbNullable = obj.getIsDbNullable() == true ? "Y" : "N"; + String isEditable = obj.getIsEditable() == true ? "Y" : "N"; + String isListable = obj.getIsListable() == true ? "Y" : "N"; + String isGenerated = obj.getIsGenerated() == true ? "Y" : "N"; + String isSearchable = obj.getIsSearchable() == true ? "Y" : "N"; + String guiType = obj.getGuiType().toString(); + String listType = obj.getListType().toString(); + String pojoField = obj.getPojoField(); + String sqlField = obj.getSqlField(); + String staticTable = obj.getStaticTable() == null ? null : obj.getStaticTable().toString(); + String parameter = obj.getParameter(); + long itemTypeId = obj.getItemTypeId(); + long metadataElementId = obj.getMetadataElementId(); + + /*@lineinfo:generated-code*//*@lineinfo:129^2*/ + +// ************************************************************ +// #sql [context] { UPDATE METADATA SET ISDBINDEX = :isDbIndex, ISDBUNIQUE = :isDbUnique, ISDBNULLABLE = :isDbNullable, ISEDITABLE = :isEditable, ISLISTABLE = :isListable, ISGENERATED = :isGenerated, ISSEARCHABLE = :isSearchable, GUITYPE = :guiType, LISTTYPE = :listType, POJOFIELD = :pojoField, SQLFIELD = :sqlField, STATICTABLE = :staticTable, PARAMETER = :parameter, ITEMTYPEID = :itemTypeId, METADATAELEMENTID = :metadataElementId WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, isDbIndex); + __sJT_stmt.setString(2, isDbUnique); + __sJT_stmt.setString(3, isDbNullable); + __sJT_stmt.setString(4, isEditable); + __sJT_stmt.setString(5, isListable); + __sJT_stmt.setString(6, isGenerated); + __sJT_stmt.setString(7, isSearchable); + __sJT_stmt.setString(8, guiType); + __sJT_stmt.setString(9, listType); + __sJT_stmt.setString(10, pojoField); + __sJT_stmt.setString(11, sqlField); + __sJT_stmt.setString(12, staticTable); + __sJT_stmt.setString(13, parameter); + __sJT_stmt.setLong(14, itemTypeId); + __sJT_stmt.setLong(15, metadataElementId); + __sJT_stmt.setLong(16, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:129^449*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Metadata obj = (Metadata) entity; + String isDbIndex = obj.getIsDbIndex() == true ? "Y" : "N"; + String isDbUnique = obj.getIsDbUnique() == true ? "Y" : "N"; + String isDbNullable = obj.getIsDbNullable() == true ? "Y" : "N"; + String isEditable = obj.getIsEditable() == true ? "Y" : "N"; + String isListable = obj.getIsListable() == true ? "Y" : "N"; + String isGenerated = obj.getIsGenerated() == true ? "Y" : "N"; + String isSearchable = obj.getIsSearchable() == true ? "Y" : "N"; + String guiType = obj.getGuiType().toString(); + String listType = obj.getListType().toString(); + String pojoField = obj.getPojoField(); + String sqlField = obj.getSqlField(); + String staticTable = obj.getStaticTable() == null ? null : obj.getStaticTable().toString(); + String parameter = obj.getParameter(); + long itemTypeId = obj.getItemTypeId(); + long metadataElementId = obj.getMetadataElementId(); + + /*@lineinfo:generated-code*//*@lineinfo:151^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO METADATA (ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID) +// VALUES (:isDbIndex, :isDbUnique, :isDbNullable, :isEditable, :isListable, :isGenerated, :isSearchable, :guiType, :listType, :pojoField, :sqlField, :staticTable, :parameter, :itemTypeId, :metadataElementId) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, isDbIndex); + __sJT_stmt.setString(2, isDbUnique); + __sJT_stmt.setString(3, isDbNullable); + __sJT_stmt.setString(4, isEditable); + __sJT_stmt.setString(5, isListable); + __sJT_stmt.setString(6, isGenerated); + __sJT_stmt.setString(7, isSearchable); + __sJT_stmt.setString(8, guiType); + __sJT_stmt.setString(9, listType); + __sJT_stmt.setString(10, pojoField); + __sJT_stmt.setString(11, sqlField); + __sJT_stmt.setString(12, staticTable); + __sJT_stmt.setString(13, parameter); + __sJT_stmt.setLong(14, itemTypeId); + __sJT_stmt.setLong(15, metadataElementId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:152^208*/ + } + + public IEntityBase get(String name) { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + IEntityBase entity = null; + try { + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:161^3*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE NAME = :name }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, name); + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:161^253*/ + List result = entities(context, iter, false); + if (result != null && result.size() == 1) + entity = result.get(0); + /*@lineinfo:generated-code*//*@lineinfo:165^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 8); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:165^27*/ + } catch (Exception e) { + logger.error(e.getMessage()); + try { + /*@lineinfo:generated-code*//*@lineinfo:169^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 9); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:169^30*/ + } catch(Exception e1) { + } + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + + /** + * Besz\ufffdrja az ItemType objektumhoz kapcsol\ufffdd\ufffd Metadata adatokat. + */ + void addAll(DefaultContext context, ItemType itemType) throws SQLException { + List metadatas = itemType.getMetadatas(); + if (metadatas != null) { + for (Metadata metadata: metadatas) { + metadata.setItemTypeId(itemType.getId()); + add(context, metadata); + } + } + } + + /** + * T\ufffdrli a param\ufffdterk\ufffdnt kapott ItemType azonos\ufffdt\ufffdhoz tartoz\ufffd Metadata bejegyz\ufffdseket. + */ + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + /*@lineinfo:generated-code*//*@lineinfo:197^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM METADATA WHERE ITEMTYPEID = :filterId }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 10); + try + { + __sJT_stmt.setLong(1, filterId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:197^69*/ + manager.traceOut(); + } + +// void addColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String create = metadata.getCreateSQL(); +// List commands = new ArrayList(); +// if (create != null) { +// commands.add("ALTER TABLE " + tableName + " ADD COLUMN " + create); +// String index = metadata.getIndexSQL(); +// if (index != null) +// commands.add(index); +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// } +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } +// +// void modifyColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String columnName = metadata.getColumnName(); +// List commands = new ArrayList(); +// commands.add("ALTER TABLE " + tableName + " DROP COLUMN " + columnName); +// String create = metadata.getCreateSQL(); +// if (create != null) { +// commands.add("ALTER TABLE " + tableName + " ADD COLUMN " + create); +// String index = metadata.getIndexSQL(); +// if (index != null) { +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// commands.add(index); +// } +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// } +// st = connection.createStatement(); +// for (String sql: commands) { +// System.out.println(sql); +// st.execute(sql); +// } +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } +// +// void removeColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String columnName = metadata.getColumnName(); +// List commands = new ArrayList(); +// commands.add("ALTER TABLE " + tableName + " DROP COLUMN " + columnName); +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } + +// void dropMetadataTable(Connection connection, ItemType itemType) throws SQLException { +// manager.traceIn(); +// String tableName = itemType.getTableName().toString(); +// Statement st = null; +// try { +// st = connection.createStatement(); +// st.execute("DROP TABLE " + tableName); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// manager.traceOut(); +// } +// +// void createMetadataTable(Connection connection, ItemType itemType) throws SQLException { +// manager.traceIn(); +// List commands = new ArrayList(); +// List indexes = new ArrayList(); +// String tableName = itemType.getTableName().toString(); +// StringBuilder sb = new StringBuilder(); +// sb.append("CREATE TABLE " + tableName + "("); +// sb.append("ID BIGINT NOT NULL PRIMARY KEY,"); +// sb.append("CONSTRAINT FK_" + tableName + "_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID)"); +// +// List metadatas = itemType.getMetadatas(); +// if (metadatas != null) { +// for (Metadata md : metadatas) { +// String create = md.getCreateSQL(); +// if (create != null) { +// sb.append(", "); +// sb.append(create); +// } +// String index = md.getIndexSQL(); +// if (index != null) +// indexes.add(index); +// } +// } +// sb.append(")"); +// commands.add(sb.toString()); +// commands.addAll(indexes); +// +// Statement st = null; +// try { +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// manager.traceOut(); +// } + + void createTable(Connection connection, IEntityBase entity) throws SQLException { + manager.traceIn(); + Statement st = null; + Metadata metadata = (Metadata) entity; + try { + String tableName = metadata.getTableName(); + String columnSql = metadata.getCreateSQL(); + String sql = String.format("CREATE TABLE %1$s (ID BIGINT NOT NULL PRIMARY KEY, %2$s, CONSTRAINT FK_%1$s_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID))", tableName, columnSql); + st = connection.createStatement(); + logger.debug(sql); + st.execute(sql); + String index = metadata.getIndexSQL(); + if (index != null) { + logger.debug(index); + st.execute(index); + } + } + catch (SQLException e) { + throw new SQLException(e); + } finally { + try{ + if (st != null) + st.close(); + } catch (Exception e1) { } + } + manager.traceOut(); + } + + void dropTable(Connection connection, IEntityBase entity) throws SQLException { + manager.traceIn(); + Metadata metadata = (Metadata) entity; + String tableName = metadata.getTableName(); + Statement st = null; + try { + st = connection.createStatement(); + String sql = "DROP TABLE " + tableName; + logger.debug(sql); + st.execute(sql); + } + catch (SQLException e) { + throw new SQLException(e); + } finally { + try{ + if (st != null) + st.close(); + } catch (Exception e1) { } + } + manager.traceOut(); + } +}/*@lineinfo:generated-code*/class MetadataDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MetadataDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MetadataDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MetadataDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MetadataDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MetadataDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO.java new file mode 100644 index 00000000..d5e8ffb0 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO.java @@ -0,0 +1,448 @@ +/*@lineinfo:filename=StoreDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.StoreUri; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class StoreIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int isLowresNdx; + private int isSystemNdx; + private int nameNdx; + private int idNdx; + public StoreIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + isSystemNdx = findColumn("isSystem"); + isLowresNdx = findColumn("isLowres"); + } + public StoreIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + isSystemNdx = findColumn("isSystem"); + isLowresNdx = findColumn("isLowres"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String isSystem() + throws java.sql.SQLException + { + return resultSet.getString(isSystemNdx); + } + public String isLowres() + throws java.sql.SQLException + { + return resultSet.getString(isLowresNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^78*/ + +@SuppressWarnings("unused") +class StoreDAO extends EntityBaseDAO { + + public StoreDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + StoreUriDAO dao = (StoreUriDAO) manager.getBaseDAO(StoreUri.class); + dao.addAll(context, entity); + } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + StoreUriDAO dao = (StoreUriDAO) manager.getBaseDAO(StoreUri.class); + dao.removeAll(context, entity.getId()); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + StoreIter iterator = (StoreIter) iter; + while (iterator.next()) { + Store entity = new Store(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setSystem(iterator.isSystem().equals("Y") ? true : false); + entity.setLowres(iterator.isLowres().equals("Y") ? true : false); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:53^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:53^88*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:60^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:60^73*/ + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String name) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:66^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE NAME = :name }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setString(1, name); + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:66^92*/ + return iter; + } + + protected ResultSetIterImpl selectBySystem(DefaultContext context, String lowres) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:72^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE ISSYSTEM = 'Y' AND ISLOWRES = :lowres }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setString(1, lowres); + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:72^117*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:78^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM STORE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:78^52*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:83^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE STORE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:83^86*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Store obj = (Store) entity; + long id = obj.getId(); + String name = obj.getName(); + String isSystem = obj.isSystem() == true ? "Y" : "N"; + String isLowres = obj.isLowres() == true ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:94^2*/ + +// ************************************************************ +// #sql [context] { UPDATE STORE SET NAME = :name, ISSYSTEM = :isSystem, ISLOWRES = :isLowres WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, isSystem); + __sJT_stmt.setString(3, isLowres); + __sJT_stmt.setLong(4, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:94^108*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Store obj = (Store) entity; + String name = obj.getName(); + String isSystem = obj.isSystem() == true ? "Y" : "N"; + String isLowres = obj.isLowres() == true ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:104^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO STORE (NAME, ISSYSTEM, ISLOWRES) VALUES (:name, :isSystem, :isLowres) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, isSystem); + __sJT_stmt.setString(3, isLowres); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:104^101*/ + } + + public IEntityBase getByName(String name) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, name); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + + + public IEntityBase getSystemStore(boolean lowres) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectBySystem(context, lowres ? "Y" : "N"); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + +}/*@lineinfo:generated-code*/class StoreDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static StoreDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.StoreDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new StoreDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private StoreDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.StoreDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO.java new file mode 100644 index 00000000..ecd56f04 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO.java @@ -0,0 +1,524 @@ +/*@lineinfo:filename=StoreUriDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.StoreUri; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.DeliveryMethod; + +/*@lineinfo:generated-code*//*@lineinfo:12^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class StoreUriIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int protocolNdx; + private int deliveryNdx; + private int portNumberNdx; + private int rootPathNdx; + private int passwordNdx; + private int userNameNdx; + private int isTargetNdx; + private int isSourceNdx; + private int isStreamNdx; + private int uriNdx; + private int storeIdNdx; + private int idNdx; + public StoreUriIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + storeIdNdx = findColumn("storeId"); + uriNdx = findColumn("uri"); + isStreamNdx = findColumn("isStream"); + isSourceNdx = findColumn("isSource"); + isTargetNdx = findColumn("isTarget"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rootPathNdx = findColumn("rootPath"); + portNumberNdx = findColumn("portNumber"); + deliveryNdx = findColumn("delivery"); + protocolNdx = findColumn("protocol"); + } + public StoreUriIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + storeIdNdx = findColumn("storeId"); + uriNdx = findColumn("uri"); + isStreamNdx = findColumn("isStream"); + isSourceNdx = findColumn("isSource"); + isTargetNdx = findColumn("isTarget"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rootPathNdx = findColumn("rootPath"); + portNumberNdx = findColumn("portNumber"); + deliveryNdx = findColumn("delivery"); + protocolNdx = findColumn("protocol"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long storeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(storeIdNdx); + } + public String uri() + throws java.sql.SQLException + { + return resultSet.getString(uriNdx); + } + public String isStream() + throws java.sql.SQLException + { + return resultSet.getString(isStreamNdx); + } + public String isSource() + throws java.sql.SQLException + { + return resultSet.getString(isSourceNdx); + } + public String isTarget() + throws java.sql.SQLException + { + return resultSet.getString(isTargetNdx); + } + public String userName() + throws java.sql.SQLException + { + return resultSet.getString(userNameNdx); + } + public String password() + throws java.sql.SQLException + { + return resultSet.getString(passwordNdx); + } + public String rootPath() + throws java.sql.SQLException + { + return resultSet.getString(rootPathNdx); + } + public Integer portNumber() + throws java.sql.SQLException + { + return resultSet.getIntWrapper(portNumberNdx); + } + public String delivery() + throws java.sql.SQLException + { + return resultSet.getString(deliveryNdx); + } + public String protocol() + throws java.sql.SQLException + { + return resultSet.getString(protocolNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:12^216*/ + +@SuppressWarnings("unused") + +class StoreUriDAO extends EntityBaseDAO { + + public StoreUriDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + StoreUriIter iterator = (StoreUriIter) iter; + while (iterator.next()) { + StoreUri entity = new StoreUri(); + entity.setId(iterator.id()); + entity.setStoreId(iterator.storeId()); + entity.setUri(iterator.uri()); + entity.setStream(iterator.isStream().equals("Y") ? true : false); + entity.setSource(iterator.isSource().equals("Y") ? true : false); + entity.setTarget(iterator.isTarget().equals("Y") ? true : false); + entity.setUserName(iterator.userName()); + entity.setPassword(iterator.password()); + entity.setRootPath(iterator.rootPath()); + entity.setPortNumber(iterator.portNumber()); + entity.setDelivery(ItemManagerData.toDeliveryMethod(iterator.delivery())); + entity.setProtocol(ItemManagerData.toRemoteStoreProtocol(iterator.protocol())); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + StoreUriIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:52^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new StoreUriIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:52^171*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + StoreUriIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:59^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI WHERE STOREID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new StoreUriIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:59^176*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + StoreUriIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:66^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new StoreUriIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:66^156*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:72^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM STOREURI WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:72^55*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:77^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE STOREURI DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:77^89*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + StoreUri obj = (StoreUri) entity; + long id = obj.getId(); + long storeId = obj.getStoreId(); + String uri = obj.getUri(); + String isStream = obj.isStream() == true ? "Y" : "N"; + String isSource = obj.isSource() == true ? "Y" : "N"; + String isTarget = obj.isTarget() == true ? "Y" : "N"; + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + Integer portNumber = obj.getPortNumber(); + String delivery = obj.getDelivery() == null ? null : obj.getDelivery().toString(); + String protocol = obj.getProtocol() == null ? null : obj.getProtocol().toString(); + + /*@lineinfo:generated-code*//*@lineinfo:96^2*/ + +// ************************************************************ +// #sql [context] { UPDATE STOREURI SET STOREID = :storeId, URI = :uri, ISSTREAM = :isStream, ISSOURCE = :isSource, ISTARGET = :isTarget, USERNAME = :userName, PASSWORD = :password, ROOTPATH = :rootPath, PORTNUMBER = :portNumber, DELIVERY = :delivery, PROTOCOL = :protocol WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, storeId); + __sJT_stmt.setString(2, uri); + __sJT_stmt.setString(3, isStream); + __sJT_stmt.setString(4, isSource); + __sJT_stmt.setString(5, isTarget); + __sJT_stmt.setString(6, userName); + __sJT_stmt.setString(7, password); + __sJT_stmt.setString(8, rootPath); + __sJT_stmt.setIntWrapper(9, portNumber); + __sJT_stmt.setString(10, delivery); + __sJT_stmt.setString(11, protocol); + __sJT_stmt.setLong(12, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:96^287*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + StoreUri obj = (StoreUri) entity; + long storeId = obj.getStoreId(); + String uri = obj.getUri(); + String isStream = obj.isStream() == true ? "Y" : "N"; + String isSource = obj.isSource() == true ? "Y" : "N"; + String isTarget = obj.isTarget() == true ? "Y" : "N"; + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + Integer portNumber = obj.getPortNumber(); + String delivery = obj.getDelivery() == null ? null : obj.getDelivery().toString(); + String protocol = obj.getProtocol() == null ? null : obj.getProtocol().toString(); + + /*@lineinfo:generated-code*//*@lineinfo:114^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO STOREURI (STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL) VALUES (:storeId, :uri, :isStream, :isSource, :isTarget, :userName, :password, :rootPath, :portNumber, :delivery, :protocol) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setLong(1, storeId); + __sJT_stmt.setString(2, uri); + __sJT_stmt.setString(3, isStream); + __sJT_stmt.setString(4, isSource); + __sJT_stmt.setString(5, isTarget); + __sJT_stmt.setString(6, userName); + __sJT_stmt.setString(7, password); + __sJT_stmt.setString(8, rootPath); + __sJT_stmt.setIntWrapper(9, portNumber); + __sJT_stmt.setString(10, delivery); + __sJT_stmt.setString(11, protocol); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:114^272*/ + } + + void addAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Store store = (Store) entity; + if (store != null && store.getStoreUris() != null) { + for (StoreUri su: store.getStoreUris()) { + su.setStoreId(store.getId()); + add(context, su); + } + } + manager.traceOut(); + } + + /** + * T\ufffdrli a param\ufffdterk\ufffdnt kapott Store azonos\ufffdt\ufffdhoz tartoz\ufffd StoreUri bejegyz\ufffdseket. + */ + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + /*@lineinfo:generated-code*//*@lineinfo:134^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM STOREURI WHERE STOREID = :filterId }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setLong(1, filterId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:134^66*/ + manager.traceOut(); + } + +}/*@lineinfo:generated-code*/class StoreUriDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static StoreUriDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.StoreUriDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new StoreUriDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private StoreUriDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.StoreUriDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/migrations/scripts/008_missing_proxy_video_only.sql b/server/user.jobengine.osgi.db/migrations/scripts/034_modify_view_missing_proxy.sql similarity index 72% rename from server/user.jobengine.osgi.db/migrations/scripts/008_missing_proxy_video_only.sql rename to server/user.jobengine.osgi.db/migrations/scripts/034_modify_view_missing_proxy.sql index 4fbb1c81..3eb3e7f3 100644 --- a/server/user.jobengine.osgi.db/migrations/scripts/008_missing_proxy_video_only.sql +++ b/server/user.jobengine.osgi.db/migrations/scripts/034_modify_view_missing_proxy.sql @@ -17,11 +17,8 @@ -- // Alter missing proxy view, select video only -- Migration SQL that makes the change goes here. -DROP VIEW VW_MISSING_PROXY_IDS -@ - -CREATE VIEW VW_MISSING_PROXY_IDS AS -select m.id as mediaid +CREATE OR REPLACE VIEW VW_MISSING_PROXY_IDS AS +select m.id as mediaid, m.archived, m.modified, mf.houseid from vw_mediafiles v, mediafile mf, filetype ft, media m where m.id = mf.mediaid and @@ -34,16 +31,4 @@ where -- //@UNDO -- SQL to undo the change goes here. -DROP VIEW VW_MISSING_PROXY_IDS -@ - -CREATE VIEW VW_MISSING_PROXY_IDS AS - select m.id as mediaid - from vw_mediafiles v, mediafile mf, filetype ft, media m - where - m.id = mf.mediaid and - mf.mediaid = v.mediaid and - v.mediafilecount = 1 and - mf.filetypeid = ft.id and - ft.name = 'High-res' -@ +--No undo diff --git a/server/user.jobengine.osgi.db/migrations/scripts/035_add_local_store.sql b/server/user.jobengine.osgi.db/migrations/scripts/035_add_local_store.sql new file mode 100644 index 00000000..6349dd6d --- /dev/null +++ b/server/user.jobengine.osgi.db/migrations/scripts/035_add_local_store.sql @@ -0,0 +1,17 @@ +-- // Creates PASAPOOL as mounted store +-- Migration SQL that makes the change goes here. + +INSERT INTO STORE(NAME,ISSYSTEM,ISLOWRES) VALUES +('LOCAL','N','N') +@ + +INSERT INTO STOREURI(STOREID,PROTOCOL,DELIVERY,URI,ISSTREAM,ISSOURCE,ISTARGET,USERNAME,PASSWORD,ROOTPATH,PORTNUMBER) VALUES +((SELECT ID FROM STORE WHERE NAME='LOCAL'),'LOCAL',null,'/mediacube/data','N','Y','Y',null,null,null,null) +@ + +-- //@UNDO +-- SQL to undo the change goes here. +DELETE FROM STOREURI WHERE STOREID=(SELECT ID FROM STORE WHERE NAME='LOCAL') +@ +DELETE FROM STORE WHERE NAME='LOCAL' +@ diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/IJobEngineConfiguration.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/IJobEngineConfiguration.java index 79b5613b..58138c02 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/IJobEngineConfiguration.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/IJobEngineConfiguration.java @@ -31,4 +31,6 @@ public interface IJobEngineConfiguration { void loadSchedules() throws Exception; + String loadTemplateXml(String template); + } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java index 9b79734c..07c9aa9c 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java @@ -238,7 +238,7 @@ public class JobEngine implements IJobEngine { @Override public void addJobChangedEventListener(IJobChangedListener listener) { - if (listener != null) { + if (listener != null && !keepAliveJobChangedListeners.containsKey(listener)) { jobChangedListenerList.add(listener); } } @@ -248,7 +248,7 @@ public class JobEngine implements IJobEngine { if (listener != null) { jobChangedListenerList.add(listener); keepAliveJobChangedListeners.put(listener, System.currentTimeMillis()); - logger.info("Managed listener added"); + logger.info("Managed listener added {}", listener); } } @@ -590,8 +590,13 @@ public class JobEngine implements IJobEngine { @Override public void keepAliveJobChangedListener(IJobChangedListener listener) { - if (keepAliveJobChangedListeners != null) - keepAliveJobChangedListeners.put(listener, System.currentTimeMillis()); + if (keepAliveJobChangedListeners != null) { + long now = System.currentTimeMillis(); + //ha mar hozza van adva, nem adja hozza + addJobChangedEventListener(listener); + keepAliveJobChangedListeners.put(listener, now); + //logger.info("Refreshing listener {}, now {} ({})", listener, now, keepAliveJobChangedListeners.size()); + } } @Deprecated @@ -761,14 +766,17 @@ public class JobEngine implements IJobEngine { synchronized protected void removeJobChangedListenerGarbage() { List toBeRemoved = new ArrayList<>(); - for (IJobChangedListener listener : keepAliveJobChangedListeners.keySet()) { long lastMod = keepAliveJobChangedListeners.get(listener); - if (System.currentTimeMillis() - lastMod > 5 * 1000) + long now = System.currentTimeMillis(); + if ((now - lastMod) > 5 * 1000) { + toBeRemoved.add(listener); + logger.info("{} refreshed {}, now {}", listener, lastMod, now); + } } toBeRemoved.forEach(r -> { - logger.info("Removing listener"); + logger.info("Removing listener {}", r); removeJobChangedEventListener(r); keepAliveJobChangedListeners.remove(r); }); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngineConfiguration.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngineConfiguration.java index f3649b34..331a8d53 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngineConfiguration.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngineConfiguration.java @@ -64,10 +64,17 @@ public class JobEngineConfiguration implements IJobEngineConfiguration { boolean isGroovyClass = stepUnitName.toLowerCase().endsWith(".java") || stepUnitName.toLowerCase().endsWith(".groovy"); - String stepClassesDir = systemConfig.getConfig(DIR_CLASSES); - Path path = Paths.get(stepClassesDir); - URL[] urls = { path.toUri().toURL() }; - URLClassLoader stepsClassLoader = URLClassLoader.newInstance(urls, Thread.currentThread().getContextClassLoader()); + URLClassLoader stepsClassLoader = null; + try { + String stepClassesDir = systemConfig.getConfig(DIR_CLASSES); + Path path = Paths.get(stepClassesDir); + URL[] urls = { path.toUri().toURL() }; + stepsClassLoader = URLClassLoader.newInstance(urls, Thread.currentThread().getContextClassLoader()); + } catch (FileNotFoundException e) { + //nincs jobs/classes mappa + URL[] urls = {}; + stepsClassLoader = URLClassLoader.newInstance(urls, Thread.currentThread().getContextClassLoader()); + } Class stepClass = null; @@ -83,6 +90,9 @@ public class JobEngineConfiguration implements IJobEngineConfiguration { } else stepClass = (Class) stepsClassLoader.loadClass(stepUnitName); + if (stepClass == null) { + throw new Exception("Missing " + stepUnitName); + } result = stepClass.newInstance(); return result; @@ -237,6 +247,9 @@ public class JobEngineConfiguration implements IJobEngineConfiguration { private void loadTemplate(Path config) { InputStream stream = null; try { + // byte[] xmlBytes = Files.readAllBytes(config); + // String xml = new String(xmlBytes); + // stream = new ByteArrayInputStream(xmlBytes); stream = Files.newInputStream(config); String fileName = config.getFileName().toString(); Parser parser = new Parser(stream); @@ -279,6 +292,19 @@ public class JobEngineConfiguration implements IJobEngineConfiguration { } } + @Override + public String loadTemplateXml(String template) { + String result = null; + try { + Path templatesPath = Paths.get(systemConfig.getConfig(DIR_TEMPLATES)); + byte[] xmlBytes = Files.readAllBytes(Paths.get(templatesPath.toString(), template)); + result = new String(xmlBytes); + } catch (Exception e) { + logger.error(e.getClass().getSimpleName() + ": " + e.getMessage()); + } + return result; + } + private Class parseClassHierarchy(GroovyClassLoader cl, String root, String className) throws IOException { Path path = Paths.get(root, className); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java index f1b4f7fe..54bd8515 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java @@ -94,6 +94,7 @@ public class JobStepExecutor implements IJobStepExecutor { logger.info("Executing locally {}", jobRuntime.getId()); //jobRuntime.setDescription(PROCESSING_LOCALLY); Object[] inputs = jobEngine.getInputsFromStack(jobRuntime); + IJobStep stepObject = runStep(jobRuntime, inputs); if (stepObject.isTest()) { logger.trace("Finishing test worker"); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/InputParameter.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/InputParameter.java index c413f319..45882c15 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/InputParameter.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/InputParameter.java @@ -41,6 +41,11 @@ public class InputParameter extends Parameter { this.expression = expression; } + @Override + public String toString() { + return expression.getName(); + } + @Override public Object visit(Visitor v, Object o) { v.visitInputParameter(this, o); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/JobTemplate.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/JobTemplate.java index 3ceb5b4d..831f918e 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/JobTemplate.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/JobTemplate.java @@ -113,6 +113,10 @@ public class JobTemplate extends AST { ParameterSequence inputParameterSequence = ((CallJobStepCommand) command).getInputParameterSequence(); if (inputParameterSequence != null) { for (Parameter parameter : inputParameterSequence.getParameters()) { + if (!(parameter instanceof InputParameter)) + throw new Exception(((CallJobStepCommand) command).getType() + ": class cast problem with input parameter name " + + parameter.toString()); + Expression expression = ((InputParameter) parameter).getExpression(); if (expression instanceof VariableExpression) { if (!inputvariables.contains(expression.getName())) @@ -127,6 +131,9 @@ public class JobTemplate extends AST { ParameterSequence outputParameterSequence = ((CallJobStepCommand) command).getOutputParameterSequence(); if (outputParameterSequence != null) { for (Parameter parameter : outputParameterSequence.getParameters()) { + if (!(parameter instanceof OutputParameter)) + throw new Exception(((CallJobStepCommand) command).getType() + ": class cast problem with output parameter name " + + parameter.toString()); VariableName name = ((OutputParameter) parameter).getVariableName(); if (!inputvariables.contains(name.getName())) inputvariables.add(name.getName()); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/OutputParameter.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/OutputParameter.java index 8960f46c..9ed68247 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/OutputParameter.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/OutputParameter.java @@ -1,7 +1,7 @@ package user.jobengine.server.ast; /** - * Kimeneti paraméter osztály. + * Kimeneti param�ter oszt�ly. */ public class OutputParameter extends Parameter { @@ -11,34 +11,39 @@ public class OutputParameter extends Parameter { } /** - * Példányosítás változónév megadásával. - * + * P�ld�nyos�t�s v�ltoz�n�v megad�s�val. + * * @param vn - * Változónév. + * V�ltoz�n�v. */ public OutputParameter(VariableName vn) { this.setVariableName(vn); } /** - * Változónév lekérdezése. - * - * @return Változónév. + * V�ltoz�n�v lek�rdez�se. + * + * @return V�ltoz�n�v. */ public VariableName getVariableName() { return variableName; } /** - * Változónév beállítása. - * + * V�ltoz�n�v be�ll�t�sa. + * * @param variableName - * Változónév. + * V�ltoz�n�v. */ public void setVariableName(VariableName variableName) { this.variableName = variableName; } + @Override + public String toString() { + return variableName.getName(); + } + @Override public Object visit(Visitor v, Object o) { v.visitOutputParameter(this, o); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/Parameter.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/Parameter.java index 9b2fb005..6a5c428e 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/Parameter.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/ast/Parameter.java @@ -1,7 +1,7 @@ package user.jobengine.server.ast; /** - * Paraméter abstract osztály. + * Param�ter abstract oszt�ly. */ public abstract class Parameter extends AST { } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java index 7a61998b..41928c9d 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java @@ -2,6 +2,8 @@ package user.jobengine.server.steps; import java.lang.annotation.Annotation; import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -79,6 +81,23 @@ public class JobStep implements IJobStep { logger.error("Invokation error in {}. Invoke parameters:\r\n{}", getClass().getSimpleName(), Arrays.toString(extendedInputs)); if (method.getParameterCount() != extendedInputs.length) { logger.error("Expected parameter count: {}, invoke parameter count: {}", method.getGenericParameterTypes().length, extendedInputs.length); + } else { + List currentTypes = new ArrayList<>(); + for (Object input : extendedInputs) { + if (input == null) + currentTypes.add("null"); + else + currentTypes.add(input.getClass().getCanonicalName()); + } + int i = 0; + for (Type input : method.getGenericParameterTypes()) { + if (!input.getTypeName().equals(currentTypes.get(i))) { + logger.error("Expected parameter {}. is {} got {}", i, input.getTypeName(), currentTypes.get(i)); + break; + } + i++; + } + } } diff --git a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java index c66357f8..8d11887d 100644 --- a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java +++ b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/mediacube/MediaCubeService.java @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.adaptor.EclipseStarter; import com.ibm.nosql.json.api.BasicDBObject; import com.ibm.nosql.json.util.JSON; +import user.commons.Job; import user.commons.MediaCubeMarker; import user.jobengine.db.IItemManager; import user.jobengine.db.IResultSetConsumer; @@ -39,7 +40,7 @@ public class MediaCubeService { private static final Logger logger = LogManager.getLogger(); public MediaCubeService() { - logger.info("Created"); + //logger.info("Created"); } @GET @@ -241,19 +242,31 @@ public class MediaCubeService { public Response jobStatus(@QueryParam("jobId") long jobId) { Response result = null; try { - IItemManager itemManager = ComponentBinder.getItemManager(); - if (itemManager == null) - throw new Exception("No ItemManager found"); - if (jobId == 0) - throw new Exception("The 'jobId' parameter is not provided!"); - String status[] = { null }; - String sql = String.format("select status from JOB where id=%d", jobId); - IResultSetConsumer consumer = rs -> { - status[0] = rs.getString("status"); - return false; - }; - itemManager.executeQuery(sql, consumer, null); - result = Response.ok(status[0]).build(); + IJobEngine jobEngine = ComponentBinder.getJobengine(); + Job job = jobEngine.getJob(jobId); + BasicDBObject status = new BasicDBObject(); + if (job != null) { + status.put("status", job.getStatus().toString()); + status.put("progress", job.getProgress()); + status.put("description", job.getDescription()); + } else { + + IItemManager itemManager = ComponentBinder.getItemManager(); + if (itemManager == null) + throw new Exception("No ItemManager found"); + if (jobId == 0) + throw new Exception("The 'jobId' parameter is not provided!"); + String sql = String.format("select status, progress, description from JOB where id=%d", jobId); + IResultSetConsumer consumer = rs -> { + status.put("status", rs.getString("status")); + status.put("progress", rs.getInt("progress")); + status.put("description", rs.getString("description")); + return false; + }; + itemManager.executeQuery(sql, consumer, null); + } + + result = Response.ok(status).build(); } catch (Exception e) { result = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } diff --git a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/ComponentBinder.java b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/ComponentBinder.java index 49b7322e..ce6e54f4 100644 --- a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/ComponentBinder.java +++ b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/ComponentBinder.java @@ -90,8 +90,10 @@ public class ComponentBinder { public void start() { NexioDispatcher dispatcher = nexioAPI.getDispatcher(); - dispatcher.setNexioChangeListener(nexioServlet); - dispatcher.startup(); + if (dispatcher != null) { + dispatcher.setNexioChangeListener(nexioServlet); + dispatcher.startup(); + } logger.info(MarkerManager.getMarker(MEDIACUBE), "A MediaCube server elindult."); // Marker m = MarkerManager.getMarker("MEDIACUBE_DAILY"); diff --git a/server/user.mediacube.gui/pages/joblist.zul b/server/user.mediacube.gui/pages/joblist.zul index 900880a4..023e3de2 100644 --- a/server/user.mediacube.gui/pages/joblist.zul +++ b/server/user.mediacube.gui/pages/joblist.zul @@ -14,7 +14,7 @@ -

+
@@ -90,5 +90,4 @@
- \ No newline at end of file diff --git a/server/user.mediacube.gui/pages/jobselector.zul b/server/user.mediacube.gui/pages/jobselector.zul index 06a16303..9c971607 100644 --- a/server/user.mediacube.gui/pages/jobselector.zul +++ b/server/user.mediacube.gui/pages/jobselector.zul @@ -1,86 +1,107 @@ - - -
- - - - + + + + +
+ + + + - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+
+ + + + + + + + - -
- - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
-
+ +
+ + + + + + + + + + + +
+ - - -      - -