+++ /dev/null
-Ami kuka:\r
--Documents\r
--user.jobengine.osgi.helper\r
--user.jobengine.osgi.service\r
--user.jobengine.osgi.web\r
-\r
-Feladatok:\r
--DB2 test adatbázis létrehozása user.jobengine.osgi.db/database/db_create.sql alapján - KÉSZ\r
---dependencies beállítása a legújabb Jetty/Jersey/Jackson hármasra\r
--Új bundle: user.jobengine.osgi.rest: ez a JobEngineWebService funkcióját valósítja meg.\r
--Bundle függõségek tracker helyett DS alapokra\r
--Jetty custom http/https konfiguráció\r
-\r
--Jetty vagy REST service JWL támogatás beépítése \r
-\r
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
-
-<!-- =============================================================== -->
-<!-- Documentation of this file format can be found at: -->
-<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax -->
-<!-- -->
-<!-- Additional configuration files are available in $JETTY_HOME/etc -->
-<!-- and can be mixed in. See start.ini file for the default -->
-<!-- configuration files. -->
-<!-- -->
-<!-- For a description of the configuration mechanism, see the -->
-<!-- output of: -->
-<!-- java -jar start.jar -? -->
-<!-- =============================================================== -->
-
-<!-- =============================================================== -->
-<!-- Configure a Jetty Server instance with an ID "Server" -->
-<!-- Other configuration files may also configure the "Server" -->
-<!-- ID, in which case they are adding configuration to the same -->
-<!-- instance. If other configuration have a different ID, they -->
-<!-- will create and configure another instance of Jetty. -->
-<!-- Consult the javadoc of o.e.j.server.Server for all -->
-<!-- configuration that may be set here. -->
-<!-- =============================================================== -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-
- <!-- =========================================================== -->
- <!-- Configure the Server Thread Pool. -->
- <!-- The server holds a common thread pool which is used by -->
- <!-- default as the executor used by all connectors and servlet -->
- <!-- dispatches. -->
- <!-- -->
- <!-- Configuring a fixed thread pool is vital to controlling the -->
- <!-- maximal memory footprint of the server and is a key tuning -->
- <!-- parameter for tuning. In an application that rarely blocks -->
- <!-- then maximal threads may be close to the number of 5*CPUs. -->
- <!-- In an application that frequently blocks, then maximal -->
- <!-- threads should be set as high as possible given the memory -->
- <!-- available. -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
- <!-- for all configuration that may be set here. -->
- <!-- =========================================================== -->
- <!-- uncomment to change type of threadpool
- <Arg name="threadpool"><New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool"/></Arg>
- -->
- <Get name="ThreadPool">
- <Set name="minThreads" type="int"><Property name="jetty.threadPool.minThreads" deprecated="threads.min" default="10"/></Set>
- <Set name="maxThreads" type="int"><Property name="jetty.threadPool.maxThreads" deprecated="threads.max" default="200"/></Set>
- <Set name="idleTimeout" type="int"><Property name="jetty.threadPool.idleTimeout" deprecated="threads.timeout" default="60000"/></Set>
- <Set name="detailedDump">false</Set>
- </Get>
-
- <!-- =========================================================== -->
- <!-- Add shared Scheduler instance -->
- <!-- =========================================================== -->
- <Call name="addBean">
- <Arg>
- <New class="org.eclipse.jetty.util.thread.ScheduledExecutorScheduler"/>
- </Arg>
- </Call>
-
- <!-- =========================================================== -->
- <!-- Http Configuration. -->
- <!-- This is a common configuration instance used by all -->
- <!-- connectors that can carry HTTP semantics (HTTP, HTTPS, etc.)-->
- <!-- It configures the non wire protocol aspects of the HTTP -->
- <!-- semantic. -->
- <!-- -->
- <!-- This configuration is only defined here and is used by -->
- <!-- reference from other XML files such as jetty-http.xml, -->
- <!-- jetty-https.xml and other configuration files which -->
- <!-- instantiate the connectors. -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.server.HttpConfiguration -->
- <!-- for all configuration that may be set here. -->
- <!-- =========================================================== -->
- <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <Set name="secureScheme"><Property name="jetty.httpConfig.secureScheme" default="https" /></Set>
- <Set name="securePort"><Property name="jetty.httpConfig.securePort" deprecated="jetty.secure.port" default="8443" /></Set>
- <Set name="outputBufferSize"><Property name="jetty.httpConfig.outputBufferSize" deprecated="jetty.output.buffer.size" default="32768" /></Set>
- <Set name="outputAggregationSize"><Property name="jetty.httpConfig.outputAggregationSize" deprecated="jetty.output.aggregation.size" default="8192" /></Set>
- <Set name="requestHeaderSize"><Property name="jetty.httpConfig.requestHeaderSize" deprecated="jetty.request.header.size" default="8192" /></Set>
- <Set name="responseHeaderSize"><Property name="jetty.httpConfig.responseHeaderSize" deprecated="jetty.response.header.size" default="8192" /></Set>
- <Set name="sendServerVersion"><Property name="jetty.httpConfig.sendServerVersion" deprecated="jetty.send.server.version" default="true" /></Set>
- <Set name="sendDateHeader"><Property name="jetty.httpConfig.sendDateHeader" deprecated="jetty.send.date.header" default="false" /></Set>
- <Set name="headerCacheSize"><Property name="jetty.httpConfig.headerCacheSize" default="512" /></Set>
- <Set name="delayDispatchUntilContent"><Property name="jetty.httpConfig.delayDispatchUntilContent" deprecated="jetty.delayDispatchUntilContent" default="true"/></Set>
- <Set name="maxErrorDispatches"><Property name="jetty.httpConfig.maxErrorDispatches" default="10"/></Set>
- <Set name="blockingTimeout"><Property name="jetty.httpConfig.blockingTimeout" default="-1"/></Set>
- <Set name="persistentConnectionsEnabled"><Property name="jetty.httpConfig.persistentConnectionsEnabled" default="true"/></Set>
- </New>
-
- <!-- =========================================================== -->
- <!-- Set the default handler structure for the Server -->
- <!-- A handler collection is used to pass received requests to -->
- <!-- both the ContextHandlerCollection, which selects the next -->
- <!-- handler by context path and virtual host, and the -->
- <!-- DefaultHandler, which handles any requests not handled by -->
- <!-- the context handlers. -->
- <!-- Other handlers may be added to the "Handlers" collection, -->
- <!-- for example the jetty-requestlog.xml file adds the -->
- <!-- RequestLogHandler after the default handler -->
- <!-- =========================================================== -->
- <Set name="handler">
- <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
- <Set name="handlers">
- <Array type="org.eclipse.jetty.server.Handler">
- <Item>
- <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
- </Item>
- <Item>
- <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
- </Item>
- </Array>
- </Set>
- </New>
- </Set>
-
- <!-- =========================================================== -->
- <!-- extra server options -->
- <!-- =========================================================== -->
- <Set name="stopAtShutdown"><Property name="jetty.server.stopAtShutdown" default="true"/></Set>
- <Set name="stopTimeout"><Property name="jetty.server.stopTimeout" default="5000"/></Set>
- <Set name="dumpAfterStart"><Property name="jetty.server.dumpAfterStart" deprecated="jetty.dump.start" default="false"/></Set>
- <Set name="dumpBeforeStop"><Property name="jetty.server.dumpBeforeStop" deprecated="jetty.dump.stop" default="false"/></Set>
-
-</Configure>
+++ /dev/null
-loginModule {
- user.jobengine.osgi.service.LoginModule required
- debug="true"
- option="1";
-};
\ No newline at end of file
+++ /dev/null
-me=me,me,roleA
-lol=lol,user,admin
-password=password,user,admin
-user=user,user,admin
+++ /dev/null
-loginModule {
-org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule required
-debug="true"
-file="/etc/login.properties";
-};
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
-
-<!-- =============================================================== -->
-<!-- Create the deployment manager -->
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-<!-- The deplyment manager handles the lifecycle of deploying web -->
-<!-- applications. Apps are provided by instances of the -->
-<!-- AppProvider interface. -->
-<!-- =============================================================== -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-
- <Call name="addBean">
- <Arg>
- <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
- <Set name="contexts">
- <Ref refid="Contexts" />
- </Set>
- <Call name="setContextAttribute">
- <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
- <Arg>.*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$</Arg>
- </Call>
-
- <!-- Add a customize step to the deployment lifecycle -->
- <!-- uncomment and replace DebugBinding with your extended AppLifeCycle.Binding class
- <Call name="insertLifeCycleNode">
- <Arg>deployed</Arg>
- <Arg>starting</Arg>
- <Arg>customise</Arg>
- </Call>
- <Call name="addLifeCycleBinding">
- <Arg>
- <New class="org.eclipse.jetty.deploy.bindings.DebugBinding">
- <Arg>customise</Arg>
- </New>
- </Arg>
- </Call> -->
-
- <Call id="webappprovider" name="addAppProvider">
- <Arg>
- <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
- <Set name="monitoredDirName">
- <Property>
- <Name>jetty.deploy.monitoredPath</Name>
- <Default>
- <Property name="jetty.base" default="." />/<Property name="jetty.deploy.monitoredDir" deprecated="jetty.deploy.monitoredDirName" default="."/>
- </Default>
- </Property>
- </Set>
- <Set name="defaultsDescriptor">
- <Property>
- <Name>jetty.deploy.defaultsDescriptorPath</Name>
- <Default>
- <Property name="jetty.home" default="." />/etc/webdefault.xml
- </Default>
- </Property>
- </Set>
- <Set name="scanInterval"><Property name="jetty.deploy.scanInterval" default="1"/></Set>
- <Set name="extractWars"><Property name="jetty.deploy.extractWars" default="true"/></Set>
- <Set name="configurationManager">
- <New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager">
- <!-- file of context configuration properties
- <Set name="file"><SystemProperty name="jetty.base"/>/etc/some.properties</Set>
- -->
- <!-- set a context configuration property
- <Call name="put"><Arg>name</Arg><Arg>value</Arg></Call>
- -->
- </New>
- </Set>
- </New>
- </Arg>
- </Call>
- </New>
- </Arg>
- </Call>
-</Configure>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
-
-<!-- ============================================================= -->
-<!-- Configure the Jetty Server instance with an ID "Server" -->
-<!-- by adding a HTTP connector. -->
-<!-- This configuration must be used in conjunction with jetty.xml -->
-<!-- ============================================================= -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-
- <!-- =========================================================== -->
- <!-- Add a HTTP Connector. -->
- <!-- Configure an o.e.j.server.ServerConnector with a single -->
- <!-- HttpConnectionFactory instance using the common httpConfig -->
- <!-- instance defined in jetty.xml -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.server.ServerConnector and -->
- <!-- o.e.j.server.HttpConnectionFactory for all configuration -->
- <!-- that may be set here. -->
- <!-- =========================================================== -->
- <Call name="addConnector">
- <Arg>
- <New id="httpConnector" class="org.eclipse.jetty.server.ServerConnector">
- <Arg name="server"><Ref refid="Server" /></Arg>
- <Arg name="acceptors" type="int"><Property name="jetty.http.acceptors" deprecated="http.acceptors" default="-1"/></Arg>
- <Arg name="selectors" type="int"><Property name="jetty.http.selectors" deprecated="http.selectors" default="-1"/></Arg>
- <Arg name="factories">
- <Array type="org.eclipse.jetty.server.ConnectionFactory">
- <Item>
- <New class="org.eclipse.jetty.server.HttpConnectionFactory">
- <Arg name="config">
- <New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <Arg>
- <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <!-- This says... Redirect to https://host:8443 if server returns "NOT SECURE" error -->
- <Set name="secureScheme">https</Set>
- <Set name="securePort">8443</Set>
- </New>
- </Arg>
- <Call name="addCustomizer">
- <Arg>
- <New class="org.eclipse.jetty.server.SecureRequestCustomizer" />
- </Arg>
- </Call>
- </New>
- </Arg>
- </New>
- </Item>
- </Array>
- </Arg>
- <Set name="host"><Property name="jetty.http.host" deprecated="jetty.host" /></Set>
- <Set name="port"><Property name="jetty.http.port" deprecated="jetty.port" default="8080" /></Set>
- <Set name="idleTimeout"><Property name="jetty.http.idleTimeout" deprecated="http.timeout" default="30000"/></Set>
- <Set name="soLingerTime"><Property name="jetty.http.soLingerTime" deprecated="http.soLingerTime" default="-1"/></Set>
- <Set name="acceptorPriorityDelta"><Property name="jetty.http.acceptorPriorityDelta" deprecated="http.acceptorPriorityDelta" default="0"/></Set>
- <Set name="acceptQueueSize"><Property name="jetty.http.acceptQueueSize" deprecated="http.acceptQueueSize" default="0"/></Set>
- </New>
- </Arg>
- </Call>
-
-</Configure>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app
- xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
- metadata-complete="false"
- version="3.1">
-
- <!-- ===================================================================== -->
- <!-- This file contains the default descriptor for web applications. -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- The intent of this descriptor is to include jetty specific or common -->
- <!-- configuration for all webapps. If a context has a webdefault.xml -->
- <!-- descriptor, it is applied before the context's own web.xml file -->
- <!-- -->
- <!-- A context may be assigned a default descriptor by calling -->
- <!-- WebAppContext.setDefaultsDescriptor(String). -->
- <!-- -->
- <!-- This file is present in the jetty-webapp.jar, and is used as the -->
- <!-- defaults descriptor if no other is explicitly set on a context. -->
- <!-- -->
- <!-- A copy of this file is also placed into the $JETTY_HOME/etc dir of -->
- <!-- the distribution, and is referenced by some of the other xml files, -->
- <!-- eg the jetty-deploy.xml file. -->
- <!-- ===================================================================== -->
-
- <description>
- Default web.xml file.
- This file is applied to a Web application before it's own WEB_INF/web.xml file
- </description>
-
- <!-- ==================================================================== -->
- <!-- Removes static references to beans from javax.el.BeanELResolver to -->
- <!-- ensure webapp classloader can be released on undeploy -->
- <!-- ==================================================================== -->
- <listener>
- <listener-class>org.eclipse.jetty.servlet.listener.ELContextCleaner</listener-class>
- </listener>
-
- <!-- ==================================================================== -->
- <!-- Removes static cache of Methods from java.beans.Introspector to -->
- <!-- ensure webapp classloader can be released on undeploy -->
- <!-- ==================================================================== -->
- <listener>
- <listener-class>org.eclipse.jetty.servlet.listener.IntrospectorCleaner</listener-class>
- </listener>
-
-
- <!-- ==================================================================== -->
- <!-- Context params to control Session Cookies -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!--
- UNCOMMENT TO ACTIVATE
- <context-param>
- <param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
- <param-value>127.0.0.1</param-value>
- </context-param>
- <context-param>
- <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
- <param-value>/</param-value>
- </context-param>
- <context-param>
- <param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
- <param-value>-1</param-value>
- </context-param>
- -->
-
- <!-- ==================================================================== -->
- <!-- The default servlet. -->
- <!-- This servlet, normally mapped to /, provides the handling for static -->
- <!-- content, OPTIONS and TRACE methods for the context. -->
- <!-- The following initParameters are supported: -->
- <!--
- * acceptRanges If true, range requests and responses are
- * supported
- *
- * dirAllowed If true, directory listings are returned if no
- * welcome file is found. Else 403 Forbidden.
- *
- * welcomeServlets If true, attempt to dispatch to welcome files
- * that are servlets, but only after no matching static
- * resources could be found. If false, then a welcome
- * file must exist on disk. If "exact", then exact
- * servlet matches are supported without an existing file.
- * Default is true.
- *
- * This must be false if you want directory listings,
- * but have index.jsp in your welcome file list.
- *
- * redirectWelcome If true, welcome files are redirected rather than
- * forwarded to.
- *
- * gzip If set to true, then static content will be served as
- * gzip content encoded if a matching resource is
- * found ending with ".gz"
- *
- * resourceBase Set to replace the context resource base
- *
- * resourceCache If set, this is a context attribute name, which the servlet
- * will use to look for a shared ResourceCache instance.
- *
- * relativeResourceBase
- * Set with a pathname relative to the base of the
- * servlet context root. Useful for only serving static content out
- * of only specific subdirectories.
- *
- * pathInfoOnly If true, only the path info will be applied to the resourceBase
- *
- * stylesheet Set with the location of an optional stylesheet that will be used
- * to decorate the directory listing html.
- *
- * aliases If True, aliases of resources are allowed (eg. symbolic
- * links and caps variations). May bypass security constraints.
- *
- * etags If True, weak etags will be generated and handled.
- *
- * maxCacheSize The maximum total size of the cache or 0 for no cache.
- * maxCachedFileSize The maximum size of a file to cache
- * maxCachedFiles The maximum number of files to cache
- *
- * useFileMappedBuffer
- * If set to true, it will use mapped file buffers to serve static content
- * when using an NIO connector. Setting this value to false means that
- * a direct buffer will be used instead of a mapped file buffer.
- * This file sets the value to true.
- *
- * cacheControl If set, all static content will have this value set as the cache-control
- * header.
- *
- -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <servlet>
- <servlet-name>default</servlet-name>
- <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
- <init-param>
- <param-name>aliases</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>acceptRanges</param-name>
- <param-value>true</param-value>
- </init-param>
- <init-param>
- <param-name>dirAllowed</param-name>
- <param-value>true</param-value>
- </init-param>
- <init-param>
- <param-name>welcomeServlets</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>redirectWelcome</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>maxCacheSize</param-name>
- <param-value>256000000</param-value>
- </init-param>
- <init-param>
- <param-name>maxCachedFileSize</param-name>
- <param-value>200000000</param-value>
- </init-param>
- <init-param>
- <param-name>maxCachedFiles</param-name>
- <param-value>2048</param-value>
- </init-param>
- <init-param>
- <param-name>gzip</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>etags</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>useFileMappedBuffer</param-name>
- <param-value>true</param-value>
- </init-param>
- <!--
- <init-param>
- <param-name>resourceCache</param-name>
- <param-value>resourceCache</param-value>
- </init-param>
- -->
- <!--
- <init-param>
- <param-name>cacheControl</param-name>
- <param-value>max-age=3600,public</param-value>
- </init-param>
- -->
- <load-on-startup>0</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>default</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
-
-
- <!-- ==================================================================== -->
- <!-- JSP Servlet -->
- <!-- This is the jasper JSP servlet. -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- The JSP page compiler and execution servlet, which is the mechanism -->
- <!-- used by the jsp container to support JSP pages. Traditionally, -->
- <!-- this servlet is mapped to URL pattern "*.jsp". This servlet -->
- <!-- supports the following initialization parameters (default values -->
- <!-- are in square brackets): -->
- <!-- -->
- <!-- checkInterval If development is false and reloading is true, -->
- <!-- background compiles are enabled. checkInterval -->
- <!-- is the time in seconds between checks to see -->
- <!-- if a JSP page needs to be recompiled. [300] -->
- <!-- -->
- <!-- compiler Which compiler Ant should use to compile JSP -->
- <!-- pages. See the Ant documentation for more -->
- <!-- information. [javac] -->
- <!-- -->
- <!-- classdebuginfo Should the class file be compiled with -->
- <!-- debugging information? [true] -->
- <!-- -->
- <!-- classpath What class path should I use while compiling -->
- <!-- generated servlets? [Created dynamically -->
- <!-- based on the current web application] -->
- <!-- Set to ? to make the container explicitly set -->
- <!-- this parameter. -->
- <!-- -->
- <!-- development Is Jasper used in development mode (will check -->
- <!-- for JSP modification on every access)? [true] -->
- <!-- -->
- <!-- enablePooling Determines whether tag handler pooling is -->
- <!-- enabled [true] -->
- <!-- -->
- <!-- fork Tell Ant to fork compiles of JSP pages so that -->
- <!-- a separate JVM is used for JSP page compiles -->
- <!-- from the one Tomcat is running in. [true] -->
- <!-- -->
- <!-- ieClassId The class-id value to be sent to Internet -->
- <!-- Explorer when using <jsp:plugin> tags. -->
- <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
- <!-- -->
- <!-- javaEncoding Java file encoding to use for generating java -->
- <!-- source files. [UTF-8] -->
- <!-- -->
- <!-- keepgenerated Should we keep the generated Java source code -->
- <!-- for each page instead of deleting it? [true] -->
- <!-- -->
- <!-- logVerbosityLevel The level of detailed messages to be produced -->
- <!-- by this servlet. Increasing levels cause the -->
- <!-- generation of more messages. Valid values are -->
- <!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
- <!-- [WARNING] -->
- <!-- -->
- <!-- mappedfile Should we generate static content with one -->
- <!-- print statement per input line, to ease -->
- <!-- debugging? [false] -->
- <!-- -->
- <!-- -->
- <!-- reloading Should Jasper check for modified JSPs? [true] -->
- <!-- -->
- <!-- suppressSmap Should the generation of SMAP info for JSR45 -->
- <!-- debugging be suppressed? [false] -->
- <!-- -->
- <!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
- <!-- dumped to a file? [false] -->
- <!-- False if suppressSmap is true -->
- <!-- -->
- <!-- scratchdir What scratch directory should we use when -->
- <!-- compiling JSP pages? [default work directory -->
- <!-- for the current web application] -->
- <!-- -->
- <!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
- <!-- -->
- <!-- xpoweredBy Determines whether X-Powered-By response -->
- <!-- header is added by generated servlet [false] -->
- <!-- -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <servlet id="jsp">
- <servlet-name>jsp</servlet-name>
- <servlet-class>org.eclipse.jetty.jsp.JettyJspServlet</servlet-class>
- <init-param>
- <param-name>logVerbosityLevel</param-name>
- <param-value>DEBUG</param-value>
- </init-param>
- <init-param>
- <param-name>fork</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>xpoweredBy</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>compilerTargetVM</param-name>
- <param-value>1.7</param-value>
- </init-param>
- <init-param>
- <param-name>compilerSourceVM</param-name>
- <param-value>1.7</param-value>
- </init-param>
- <!--
- <init-param>
- <param-name>classpath</param-name>
- <param-value>?</param-value>
- </init-param>
- -->
- <load-on-startup>0</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>jsp</servlet-name>
- <url-pattern>*.jsp</url-pattern>
- <url-pattern>*.jspf</url-pattern>
- <url-pattern>*.jspx</url-pattern>
- <url-pattern>*.xsp</url-pattern>
- <url-pattern>*.JSP</url-pattern>
- <url-pattern>*.JSPF</url-pattern>
- <url-pattern>*.JSPX</url-pattern>
- <url-pattern>*.XSP</url-pattern>
- </servlet-mapping>
-
-
- <!-- ==================================================================== -->
- <!-- Default session configuration -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <session-config>
- <session-timeout>30</session-timeout>
- </session-config>
-
- <!-- ==================================================================== -->
- <!-- Default MIME mappings -->
- <!-- The default MIME mappings are provided by the mime.properties -->
- <!-- resource in the jetty-http.jar file. Additional or modified -->
- <!-- mappings may be specified here -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- UNCOMMENT TO ACTIVATE
- <mime-mapping>
- <extension>mysuffix</extension>
- <mime-type>mymime/type</mime-type>
- </mime-mapping>
- -->
-
- <!-- ==================================================================== -->
- <!-- Default welcome files -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- <welcome-file>index.htm</welcome-file>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
-
- <!-- ==================================================================== -->
- <!-- Default locale encodings -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <locale-encoding-mapping-list>
- <locale-encoding-mapping>
- <locale>ar</locale>
- <encoding>ISO-8859-6</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>be</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>bg</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ca</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>cs</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>da</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>de</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>el</locale>
- <encoding>ISO-8859-7</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>en</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>es</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>et</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>fi</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>fr</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>hr</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>hu</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>is</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>it</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>iw</locale>
- <encoding>ISO-8859-8</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ja</locale>
- <encoding>Shift_JIS</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ko</locale>
- <encoding>EUC-KR</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>lt</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>lv</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>mk</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>nl</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>no</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>pl</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>pt</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ro</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ru</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sh</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sk</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sl</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sq</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sr</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sv</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>tr</locale>
- <encoding>ISO-8859-9</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>uk</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>zh</locale>
- <encoding>GB2312</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>zh_TW</locale>
- <encoding>Big5</encoding>
- </locale-encoding-mapping>
- </locale-encoding-mapping-list>
-
- <!-- ==================================================================== -->
- <!-- Disable TRACE method with security constraint -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Disable TRACE</web-resource-name>
- <url-pattern>/</url-pattern>
- <http-method>TRACE</http-method>
- </web-resource-collection>
- <auth-constraint/>
- </security-constraint>
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Enable everything but TRACE</web-resource-name>
- <url-pattern>/</url-pattern>
- <http-method-omission>TRACE</http-method-omission>
- </web-resource-collection>
- </security-constraint>
-
-</web-app>
-
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
-
-<!-- =============================================================== -->
-<!-- Documentation of this file format can be found at: -->
-<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax -->
-<!-- -->
-<!-- Additional configuration files are available in $JETTY_HOME/etc -->
-<!-- and can be mixed in. See start.ini file for the default -->
-<!-- configuration files. -->
-<!-- -->
-<!-- For a description of the configuration mechanism, see the -->
-<!-- output of: -->
-<!-- java -jar start.jar -? -->
-<!-- =============================================================== -->
-
-<!-- =============================================================== -->
-<!-- Configure a Jetty Server instance with an ID "Server" -->
-<!-- Other configuration files may also configure the "Server" -->
-<!-- ID, in which case they are adding configuration to the same -->
-<!-- instance. If other configuration have a different ID, they -->
-<!-- will create and configure another instance of Jetty. -->
-<!-- Consult the javadoc of o.e.j.server.Server for all -->
-<!-- configuration that may be set here. -->
-<!-- =============================================================== -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-
- <!-- =========================================================== -->
- <!-- Configure the Server Thread Pool. -->
- <!-- The server holds a common thread pool which is used by -->
- <!-- default as the executor used by all connectors and servlet -->
- <!-- dispatches. -->
- <!-- -->
- <!-- Configuring a fixed thread pool is vital to controlling the -->
- <!-- maximal memory footprint of the server and is a key tuning -->
- <!-- parameter for tuning. In an application that rarely blocks -->
- <!-- then maximal threads may be close to the number of 5*CPUs. -->
- <!-- In an application that frequently blocks, then maximal -->
- <!-- threads should be set as high as possible given the memory -->
- <!-- available. -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
- <!-- for all configuration that may be set here. -->
- <!-- =========================================================== -->
- <!-- uncomment to change type of threadpool
- <Arg name="threadpool"><New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool"/></Arg>
- -->
- <Get name="ThreadPool">
- <Set name="minThreads" type="int"><Property name="jetty.threadPool.minThreads" deprecated="threads.min" default="10"/></Set>
- <Set name="maxThreads" type="int"><Property name="jetty.threadPool.maxThreads" deprecated="threads.max" default="200"/></Set>
- <Set name="idleTimeout" type="int"><Property name="jetty.threadPool.idleTimeout" deprecated="threads.timeout" default="60000"/></Set>
- <Set name="detailedDump">false</Set>
- </Get>
-
- <!-- =========================================================== -->
- <!-- Add shared Scheduler instance -->
- <!-- =========================================================== -->
- <Call name="addBean">
- <Arg>
- <New class="org.eclipse.jetty.util.thread.ScheduledExecutorScheduler"/>
- </Arg>
- </Call>
-
- <!-- =========================================================== -->
- <!-- Http Configuration. -->
- <!-- This is a common configuration instance used by all -->
- <!-- connectors that can carry HTTP semantics (HTTP, HTTPS, etc.)-->
- <!-- It configures the non wire protocol aspects of the HTTP -->
- <!-- semantic. -->
- <!-- -->
- <!-- This configuration is only defined here and is used by -->
- <!-- reference from other XML files such as jetty-http.xml, -->
- <!-- jetty-https.xml and other configuration files which -->
- <!-- instantiate the connectors. -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.server.HttpConfiguration -->
- <!-- for all configuration that may be set here. -->
- <!-- =========================================================== -->
- <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <Set name="secureScheme"><Property name="jetty.httpConfig.secureScheme" default="https" /></Set>
- <Set name="securePort"><Property name="jetty.httpConfig.securePort" deprecated="jetty.secure.port" default="8443" /></Set>
- <Set name="outputBufferSize"><Property name="jetty.httpConfig.outputBufferSize" deprecated="jetty.output.buffer.size" default="32768" /></Set>
- <Set name="outputAggregationSize"><Property name="jetty.httpConfig.outputAggregationSize" deprecated="jetty.output.aggregation.size" default="8192" /></Set>
- <Set name="requestHeaderSize"><Property name="jetty.httpConfig.requestHeaderSize" deprecated="jetty.request.header.size" default="8192" /></Set>
- <Set name="responseHeaderSize"><Property name="jetty.httpConfig.responseHeaderSize" deprecated="jetty.response.header.size" default="8192" /></Set>
- <Set name="sendServerVersion"><Property name="jetty.httpConfig.sendServerVersion" deprecated="jetty.send.server.version" default="true" /></Set>
- <Set name="sendDateHeader"><Property name="jetty.httpConfig.sendDateHeader" deprecated="jetty.send.date.header" default="false" /></Set>
- <Set name="headerCacheSize"><Property name="jetty.httpConfig.headerCacheSize" default="512" /></Set>
- <Set name="delayDispatchUntilContent"><Property name="jetty.httpConfig.delayDispatchUntilContent" deprecated="jetty.delayDispatchUntilContent" default="true"/></Set>
- <Set name="maxErrorDispatches"><Property name="jetty.httpConfig.maxErrorDispatches" default="10"/></Set>
- <Set name="blockingTimeout"><Property name="jetty.httpConfig.blockingTimeout" default="-1"/></Set>
- <Set name="persistentConnectionsEnabled"><Property name="jetty.httpConfig.persistentConnectionsEnabled" default="true"/></Set>
- </New>
-
- <!-- =========================================================== -->
- <!-- Set the default handler structure for the Server -->
- <!-- A handler collection is used to pass received requests to -->
- <!-- both the ContextHandlerCollection, which selects the next -->
- <!-- handler by context path and virtual host, and the -->
- <!-- DefaultHandler, which handles any requests not handled by -->
- <!-- the context handlers. -->
- <!-- Other handlers may be added to the "Handlers" collection, -->
- <!-- for example the jetty-requestlog.xml file adds the -->
- <!-- RequestLogHandler after the default handler -->
- <!-- =========================================================== -->
- <Set name="handler">
- <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
- <Set name="handlers">
- <Array type="org.eclipse.jetty.server.Handler">
- <Item>
- <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
- </Item>
- <Item>
- <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
- </Item>
- </Array>
- </Set>
- </New>
- </Set>
-
- <!-- =========================================================== -->
- <!-- extra server options -->
- <!-- =========================================================== -->
- <Set name="stopAtShutdown"><Property name="jetty.server.stopAtShutdown" default="true"/></Set>
- <Set name="stopTimeout"><Property name="jetty.server.stopTimeout" default="5000"/></Set>
- <Set name="dumpAfterStart"><Property name="jetty.server.dumpAfterStart" deprecated="jetty.dump.start" default="false"/></Set>
- <Set name="dumpBeforeStop"><Property name="jetty.server.dumpBeforeStop" deprecated="jetty.dump.stop" default="false"/></Set>
-
-</Configure>
+++ /dev/null
-loginModule {
- user.jobengine.osgi.service.LoginModule required
- debug="true"
- option="1";
-};
\ No newline at end of file
+++ /dev/null
-me=me,me,roleA
-lol=lol,user,admin
-password=password,user,admin
-user=user,user,admin
+++ /dev/null
-loginModule {
-org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule required
-debug="true"
-file="/etc/login.properties";
-};
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
-
-<!-- =============================================================== -->
-<!-- Create the deployment manager -->
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-<!-- The deplyment manager handles the lifecycle of deploying web -->
-<!-- applications. Apps are provided by instances of the -->
-<!-- AppProvider interface. -->
-<!-- =============================================================== -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-
- <Call name="addBean">
- <Arg>
- <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
- <Set name="contexts">
- <Ref refid="Contexts" />
- </Set>
- <Call name="setContextAttribute">
- <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
- <Arg>.*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$</Arg>
- </Call>
-
- <!-- Add a customize step to the deployment lifecycle -->
- <!-- uncomment and replace DebugBinding with your extended AppLifeCycle.Binding class
- <Call name="insertLifeCycleNode">
- <Arg>deployed</Arg>
- <Arg>starting</Arg>
- <Arg>customise</Arg>
- </Call>
- <Call name="addLifeCycleBinding">
- <Arg>
- <New class="org.eclipse.jetty.deploy.bindings.DebugBinding">
- <Arg>customise</Arg>
- </New>
- </Arg>
- </Call> -->
-
- <Call id="webappprovider" name="addAppProvider">
- <Arg>
- <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
- <Set name="monitoredDirName">
- <Property>
- <Name>jetty.deploy.monitoredPath</Name>
- <Default>
- <Property name="jetty.base" default="." />/<Property name="jetty.deploy.monitoredDir" deprecated="jetty.deploy.monitoredDirName" default="."/>
- </Default>
- </Property>
- </Set>
- <Set name="defaultsDescriptor">
- <Property>
- <Name>jetty.deploy.defaultsDescriptorPath</Name>
- <Default>
- <Property name="jetty.home" default="." />/etc/webdefault.xml
- </Default>
- </Property>
- </Set>
- <Set name="scanInterval"><Property name="jetty.deploy.scanInterval" default="1"/></Set>
- <Set name="extractWars"><Property name="jetty.deploy.extractWars" default="true"/></Set>
- <Set name="configurationManager">
- <New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager">
- <!-- file of context configuration properties
- <Set name="file"><SystemProperty name="jetty.base"/>/etc/some.properties</Set>
- -->
- <!-- set a context configuration property
- <Call name="put"><Arg>name</Arg><Arg>value</Arg></Call>
- -->
- </New>
- </Set>
- </New>
- </Arg>
- </Call>
- </New>
- </Arg>
- </Call>
-</Configure>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
-
-<!-- ============================================================= -->
-<!-- Configure the Jetty Server instance with an ID "Server" -->
-<!-- by adding a HTTP connector. -->
-<!-- This configuration must be used in conjunction with jetty.xml -->
-<!-- ============================================================= -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-
- <!-- =========================================================== -->
- <!-- Add a HTTP Connector. -->
- <!-- Configure an o.e.j.server.ServerConnector with a single -->
- <!-- HttpConnectionFactory instance using the common httpConfig -->
- <!-- instance defined in jetty.xml -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.server.ServerConnector and -->
- <!-- o.e.j.server.HttpConnectionFactory for all configuration -->
- <!-- that may be set here. -->
- <!-- =========================================================== -->
- <Call name="addConnector">
- <Arg>
- <New id="httpConnector" class="org.eclipse.jetty.server.ServerConnector">
- <Arg name="server"><Ref refid="Server" /></Arg>
- <Arg name="acceptors" type="int"><Property name="jetty.http.acceptors" deprecated="http.acceptors" default="-1"/></Arg>
- <Arg name="selectors" type="int"><Property name="jetty.http.selectors" deprecated="http.selectors" default="-1"/></Arg>
- <Arg name="factories">
- <Array type="org.eclipse.jetty.server.ConnectionFactory">
- <Item>
- <New class="org.eclipse.jetty.server.HttpConnectionFactory">
- <Arg name="config">
- <New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <Arg>
- <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
- <!-- This says... Redirect to https://host:8443 if server returns "NOT SECURE" error -->
- <Set name="secureScheme">https</Set>
- <Set name="securePort">8443</Set>
- </New>
- </Arg>
- <Call name="addCustomizer">
- <Arg>
- <New class="org.eclipse.jetty.server.SecureRequestCustomizer" />
- </Arg>
- </Call>
- </New>
- </Arg>
- </New>
- </Item>
- </Array>
- </Arg>
- <Set name="host"><Property name="jetty.http.host" deprecated="jetty.host" /></Set>
- <Set name="port"><Property name="jetty.http.port" deprecated="jetty.port" default="8080" /></Set>
- <Set name="idleTimeout"><Property name="jetty.http.idleTimeout" deprecated="http.timeout" default="30000"/></Set>
- <Set name="soLingerTime"><Property name="jetty.http.soLingerTime" deprecated="http.soLingerTime" default="-1"/></Set>
- <Set name="acceptorPriorityDelta"><Property name="jetty.http.acceptorPriorityDelta" deprecated="http.acceptorPriorityDelta" default="0"/></Set>
- <Set name="acceptQueueSize"><Property name="jetty.http.acceptQueueSize" deprecated="http.acceptQueueSize" default="0"/></Set>
- </New>
- </Arg>
- </Call>
-
-</Configure>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app
- xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
- metadata-complete="false"
- version="3.1">
-
- <!-- ===================================================================== -->
- <!-- This file contains the default descriptor for web applications. -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- The intent of this descriptor is to include jetty specific or common -->
- <!-- configuration for all webapps. If a context has a webdefault.xml -->
- <!-- descriptor, it is applied before the context's own web.xml file -->
- <!-- -->
- <!-- A context may be assigned a default descriptor by calling -->
- <!-- WebAppContext.setDefaultsDescriptor(String). -->
- <!-- -->
- <!-- This file is present in the jetty-webapp.jar, and is used as the -->
- <!-- defaults descriptor if no other is explicitly set on a context. -->
- <!-- -->
- <!-- A copy of this file is also placed into the $JETTY_HOME/etc dir of -->
- <!-- the distribution, and is referenced by some of the other xml files, -->
- <!-- eg the jetty-deploy.xml file. -->
- <!-- ===================================================================== -->
-
- <description>
- Default web.xml file.
- This file is applied to a Web application before it's own WEB_INF/web.xml file
- </description>
-
- <!-- ==================================================================== -->
- <!-- Removes static references to beans from javax.el.BeanELResolver to -->
- <!-- ensure webapp classloader can be released on undeploy -->
- <!-- ==================================================================== -->
- <listener>
- <listener-class>org.eclipse.jetty.servlet.listener.ELContextCleaner</listener-class>
- </listener>
-
- <!-- ==================================================================== -->
- <!-- Removes static cache of Methods from java.beans.Introspector to -->
- <!-- ensure webapp classloader can be released on undeploy -->
- <!-- ==================================================================== -->
- <listener>
- <listener-class>org.eclipse.jetty.servlet.listener.IntrospectorCleaner</listener-class>
- </listener>
-
-
- <!-- ==================================================================== -->
- <!-- Context params to control Session Cookies -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!--
- UNCOMMENT TO ACTIVATE
- <context-param>
- <param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
- <param-value>127.0.0.1</param-value>
- </context-param>
- <context-param>
- <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
- <param-value>/</param-value>
- </context-param>
- <context-param>
- <param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
- <param-value>-1</param-value>
- </context-param>
- -->
-
- <!-- ==================================================================== -->
- <!-- The default servlet. -->
- <!-- This servlet, normally mapped to /, provides the handling for static -->
- <!-- content, OPTIONS and TRACE methods for the context. -->
- <!-- The following initParameters are supported: -->
- <!--
- * acceptRanges If true, range requests and responses are
- * supported
- *
- * dirAllowed If true, directory listings are returned if no
- * welcome file is found. Else 403 Forbidden.
- *
- * welcomeServlets If true, attempt to dispatch to welcome files
- * that are servlets, but only after no matching static
- * resources could be found. If false, then a welcome
- * file must exist on disk. If "exact", then exact
- * servlet matches are supported without an existing file.
- * Default is true.
- *
- * This must be false if you want directory listings,
- * but have index.jsp in your welcome file list.
- *
- * redirectWelcome If true, welcome files are redirected rather than
- * forwarded to.
- *
- * gzip If set to true, then static content will be served as
- * gzip content encoded if a matching resource is
- * found ending with ".gz"
- *
- * resourceBase Set to replace the context resource base
- *
- * resourceCache If set, this is a context attribute name, which the servlet
- * will use to look for a shared ResourceCache instance.
- *
- * relativeResourceBase
- * Set with a pathname relative to the base of the
- * servlet context root. Useful for only serving static content out
- * of only specific subdirectories.
- *
- * pathInfoOnly If true, only the path info will be applied to the resourceBase
- *
- * stylesheet Set with the location of an optional stylesheet that will be used
- * to decorate the directory listing html.
- *
- * aliases If True, aliases of resources are allowed (eg. symbolic
- * links and caps variations). May bypass security constraints.
- *
- * etags If True, weak etags will be generated and handled.
- *
- * maxCacheSize The maximum total size of the cache or 0 for no cache.
- * maxCachedFileSize The maximum size of a file to cache
- * maxCachedFiles The maximum number of files to cache
- *
- * useFileMappedBuffer
- * If set to true, it will use mapped file buffers to serve static content
- * when using an NIO connector. Setting this value to false means that
- * a direct buffer will be used instead of a mapped file buffer.
- * This file sets the value to true.
- *
- * cacheControl If set, all static content will have this value set as the cache-control
- * header.
- *
- -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <servlet>
- <servlet-name>default</servlet-name>
- <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
- <init-param>
- <param-name>aliases</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>acceptRanges</param-name>
- <param-value>true</param-value>
- </init-param>
- <init-param>
- <param-name>dirAllowed</param-name>
- <param-value>true</param-value>
- </init-param>
- <init-param>
- <param-name>welcomeServlets</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>redirectWelcome</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>maxCacheSize</param-name>
- <param-value>256000000</param-value>
- </init-param>
- <init-param>
- <param-name>maxCachedFileSize</param-name>
- <param-value>200000000</param-value>
- </init-param>
- <init-param>
- <param-name>maxCachedFiles</param-name>
- <param-value>2048</param-value>
- </init-param>
- <init-param>
- <param-name>gzip</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>etags</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>useFileMappedBuffer</param-name>
- <param-value>true</param-value>
- </init-param>
- <!--
- <init-param>
- <param-name>resourceCache</param-name>
- <param-value>resourceCache</param-value>
- </init-param>
- -->
- <!--
- <init-param>
- <param-name>cacheControl</param-name>
- <param-value>max-age=3600,public</param-value>
- </init-param>
- -->
- <load-on-startup>0</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>default</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
-
-
- <!-- ==================================================================== -->
- <!-- JSP Servlet -->
- <!-- This is the jasper JSP servlet. -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- The JSP page compiler and execution servlet, which is the mechanism -->
- <!-- used by the jsp container to support JSP pages. Traditionally, -->
- <!-- this servlet is mapped to URL pattern "*.jsp". This servlet -->
- <!-- supports the following initialization parameters (default values -->
- <!-- are in square brackets): -->
- <!-- -->
- <!-- checkInterval If development is false and reloading is true, -->
- <!-- background compiles are enabled. checkInterval -->
- <!-- is the time in seconds between checks to see -->
- <!-- if a JSP page needs to be recompiled. [300] -->
- <!-- -->
- <!-- compiler Which compiler Ant should use to compile JSP -->
- <!-- pages. See the Ant documentation for more -->
- <!-- information. [javac] -->
- <!-- -->
- <!-- classdebuginfo Should the class file be compiled with -->
- <!-- debugging information? [true] -->
- <!-- -->
- <!-- classpath What class path should I use while compiling -->
- <!-- generated servlets? [Created dynamically -->
- <!-- based on the current web application] -->
- <!-- Set to ? to make the container explicitly set -->
- <!-- this parameter. -->
- <!-- -->
- <!-- development Is Jasper used in development mode (will check -->
- <!-- for JSP modification on every access)? [true] -->
- <!-- -->
- <!-- enablePooling Determines whether tag handler pooling is -->
- <!-- enabled [true] -->
- <!-- -->
- <!-- fork Tell Ant to fork compiles of JSP pages so that -->
- <!-- a separate JVM is used for JSP page compiles -->
- <!-- from the one Tomcat is running in. [true] -->
- <!-- -->
- <!-- ieClassId The class-id value to be sent to Internet -->
- <!-- Explorer when using <jsp:plugin> tags. -->
- <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
- <!-- -->
- <!-- javaEncoding Java file encoding to use for generating java -->
- <!-- source files. [UTF-8] -->
- <!-- -->
- <!-- keepgenerated Should we keep the generated Java source code -->
- <!-- for each page instead of deleting it? [true] -->
- <!-- -->
- <!-- logVerbosityLevel The level of detailed messages to be produced -->
- <!-- by this servlet. Increasing levels cause the -->
- <!-- generation of more messages. Valid values are -->
- <!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
- <!-- [WARNING] -->
- <!-- -->
- <!-- mappedfile Should we generate static content with one -->
- <!-- print statement per input line, to ease -->
- <!-- debugging? [false] -->
- <!-- -->
- <!-- -->
- <!-- reloading Should Jasper check for modified JSPs? [true] -->
- <!-- -->
- <!-- suppressSmap Should the generation of SMAP info for JSR45 -->
- <!-- debugging be suppressed? [false] -->
- <!-- -->
- <!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
- <!-- dumped to a file? [false] -->
- <!-- False if suppressSmap is true -->
- <!-- -->
- <!-- scratchdir What scratch directory should we use when -->
- <!-- compiling JSP pages? [default work directory -->
- <!-- for the current web application] -->
- <!-- -->
- <!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
- <!-- -->
- <!-- xpoweredBy Determines whether X-Powered-By response -->
- <!-- header is added by generated servlet [false] -->
- <!-- -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <servlet id="jsp">
- <servlet-name>jsp</servlet-name>
- <servlet-class>org.eclipse.jetty.jsp.JettyJspServlet</servlet-class>
- <init-param>
- <param-name>logVerbosityLevel</param-name>
- <param-value>DEBUG</param-value>
- </init-param>
- <init-param>
- <param-name>fork</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>xpoweredBy</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>compilerTargetVM</param-name>
- <param-value>1.7</param-value>
- </init-param>
- <init-param>
- <param-name>compilerSourceVM</param-name>
- <param-value>1.7</param-value>
- </init-param>
- <!--
- <init-param>
- <param-name>classpath</param-name>
- <param-value>?</param-value>
- </init-param>
- -->
- <load-on-startup>0</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>jsp</servlet-name>
- <url-pattern>*.jsp</url-pattern>
- <url-pattern>*.jspf</url-pattern>
- <url-pattern>*.jspx</url-pattern>
- <url-pattern>*.xsp</url-pattern>
- <url-pattern>*.JSP</url-pattern>
- <url-pattern>*.JSPF</url-pattern>
- <url-pattern>*.JSPX</url-pattern>
- <url-pattern>*.XSP</url-pattern>
- </servlet-mapping>
-
-
- <!-- ==================================================================== -->
- <!-- Default session configuration -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <session-config>
- <session-timeout>30</session-timeout>
- </session-config>
-
- <!-- ==================================================================== -->
- <!-- Default MIME mappings -->
- <!-- The default MIME mappings are provided by the mime.properties -->
- <!-- resource in the jetty-http.jar file. Additional or modified -->
- <!-- mappings may be specified here -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- UNCOMMENT TO ACTIVATE
- <mime-mapping>
- <extension>mysuffix</extension>
- <mime-type>mymime/type</mime-type>
- </mime-mapping>
- -->
-
- <!-- ==================================================================== -->
- <!-- Default welcome files -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- <welcome-file>index.htm</welcome-file>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
-
- <!-- ==================================================================== -->
- <!-- Default locale encodings -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <locale-encoding-mapping-list>
- <locale-encoding-mapping>
- <locale>ar</locale>
- <encoding>ISO-8859-6</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>be</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>bg</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ca</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>cs</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>da</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>de</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>el</locale>
- <encoding>ISO-8859-7</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>en</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>es</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>et</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>fi</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>fr</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>hr</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>hu</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>is</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>it</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>iw</locale>
- <encoding>ISO-8859-8</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ja</locale>
- <encoding>Shift_JIS</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ko</locale>
- <encoding>EUC-KR</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>lt</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>lv</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>mk</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>nl</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>no</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>pl</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>pt</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ro</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>ru</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sh</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sk</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sl</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sq</locale>
- <encoding>ISO-8859-2</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sr</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>sv</locale>
- <encoding>ISO-8859-1</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>tr</locale>
- <encoding>ISO-8859-9</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>uk</locale>
- <encoding>ISO-8859-5</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>zh</locale>
- <encoding>GB2312</encoding>
- </locale-encoding-mapping>
- <locale-encoding-mapping>
- <locale>zh_TW</locale>
- <encoding>Big5</encoding>
- </locale-encoding-mapping>
- </locale-encoding-mapping-list>
-
- <!-- ==================================================================== -->
- <!-- Disable TRACE method with security constraint -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Disable TRACE</web-resource-name>
- <url-pattern>/</url-pattern>
- <http-method>TRACE</http-method>
- </web-resource-collection>
- <auth-constraint/>
- </security-constraint>
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Enable everything but TRACE</web-resource-name>
- <url-pattern>/</url-pattern>
- <http-method-omission>TRACE</http-method-omission>
- </web-resource-collection>
- </security-constraint>
-
-</web-app>
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate name="Csatolás" description="">\r
-<declarations>\r
- <parameters>\r
- <parameter name="itemID" type="java.lang.Long"/>\r
- <parameter name="media" type="user.jobengine.db.Media"/>\r
- <parameter name="sourceStoreUri" type="user.commons.StoreUri"/>\r
- <parameter name="sourceFileName" type="java.lang.String"/>\r
- <parameter name="transcoderProfile" type="java.lang.String"/>\r
- </parameters>\r
- <variables>\r
- <variable name="file" type="user.commons.RemoteFile"/>\r
- <variable name="mediaFiles" type="java.util.ArrayList"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.DownloadStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="sourceStoreUri" />\r
- </input>\r
- <input>\r
- <parameter name="sourceFileName" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="file" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep id="id2" type="user.jobengine.server.steps.TranscodeStep" weight="5">\r
- <inputs>\r
- <input>\r
- <variable name="file" />\r
- </input>\r
- <input>\r
- <parameter name="transcoderProfile" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="mediaFiles" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep id="id3" type="user.jobengine.server.steps.MediaDBWriterStep" weight="0">\r
- <inputs>\r
- <input>\r
- <parameter name="itemID" />\r
- </input>\r
- <input>\r
- <parameter name="media"/>\r
- </input>\r
- <input>\r
- <variable name="mediaFiles" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate>\r
-<declarations>\r
- <parameters>\r
- <parameter name="itemID" type="java.lang.Long"/>\r
- <parameter name="media" type="user.jobengine.db.Media"/>\r
- <parameter name="sourceFile" type="user.commons.RemoteFile"/>\r
- <parameter name="transcoderProfile" type="java.lang.String"/>\r
- </parameters>\r
- <variables>\r
- <variable name="mediaFiles" type="java.util.ArrayList"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="id2" type="user.jobengine.server.steps.TranscodeStep" weight="5">\r
- <inputs>\r
- <input>\r
- <parameter name="sourceFile" />\r
- </input>\r
- <input>\r
- <parameter name="transcoderProfile" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="mediaFiles" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep id="id3" type="user.jobengine.server.steps.MediaDBWriterStep" weight="0">\r
- <inputs>\r
- <input>\r
- <parameter name="itemID" />\r
- </input>\r
- <input>\r
- <parameter name="media"/>\r
- </input>\r
- <input>\r
- <variable name="mediaFiles" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate name="Csatolás" description="">\r
-<declarations>\r
- <parameters>\r
- <parameter name="mediaFile" type="user.jobengine.db.MediaFile"/>\r
- <parameter name="targetStoreUri" type="user.commons.StoreUri"/>\r
- <parameter name="isTranscode" type="java.lang.Boolean"/>\r
- <parameter name="transcoderProfile" type="java.lang.String"/>\r
- <parameter name="isDataExport" type="java.lang.Boolean"/>\r
- </parameters>\r
- <variables>\r
- <variable name="file" type="user.commons.RemoteFile"/>\r
- <variable name="mediaFiles" type="java.util.ArrayList"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.MediaDownloadStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="mediaFile" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="file" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep id="id2" type="user.jobengine.server.steps.TranscodeStep" weight="5">\r
- <inputs>\r
- <input>\r
- <variable name="file" />\r
- </input>\r
- <input>\r
- <parameter name="transcoderProfile" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="mediaFiles" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep id="id3" type="user.jobengine.server.steps.MediaUploadStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="targetStoreUri" />\r
- </input>\r
- <input>\r
- <variable name="mediaFiles" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate>\r
-<declarations>\r
- <parameters>\r
- <parameter name="Item" type="user.jobengine.db.Item"/>\r
- <parameter name="Medias" type="java.util.ArrayList"/>\r
- </parameters>\r
- <variables>\r
- <variable name="ImportDBResult" type="user.jobengine.db.Item"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.ImportWriteDataToDBStep">\r
- <inputs>\r
- <input>\r
- <parameter name="Item" />\r
- </input>\r
- <input>\r
- <parameter name="Medias" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="ImportDBResult" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.CreateLowresStep">\r
- <inputs>\r
- <input>\r
- <variable name="ImportDBResult" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate name="LowresTranszkod" description="Kiálasztott média kis felbontású verziójának transzkódolása.">\r
-<declarations>\r
- <parameters>\r
- <parameter name="mediaWrapper" type="user.jobengine.server.steps.MediaFileWrapper"/>\r
- </parameters>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.SelenioLowresTranscodeStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="mediaWrapper" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- </outputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate>\r
-<commands>\r
- <calljobstep id="sync" type="user.jobengine.server.steps.NexioDataMinerStep" weight="1" />\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate>\r
-<declarations>\r
- <parameters>\r
- <parameter name="param1" type="java.lang.String"/>\r
- <parameter name="param2" type="java.lang.Integer"/>\r
- </parameters>\r
- <variables>\r
- <variable name="var1" type="java.lang.Integer"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <sendusermessage id="message1" catalogName="catalog1" messageNumber="1">\r
- <inputs>\r
- <input name="input1">\r
- <parameter name="param1" />\r
- </input>\r
- <input name="input2">\r
- <parameter name="param2" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output name="output1">\r
- <variable name="var1" />\r
- </output>\r
- </outputs>\r
- </sendusermessage>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate>\r
-<commands>\r
- <calljobstep id="step1" type="user.jobengine.server.steps.TemplateStep" weight="1" />\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
-<jobtemplate description="" name="">\r
-<declarations>\r
-<parameters>\r
-<parameter name="xxx1" type="java.lang.String"/>\r
-</parameters>\r
-<variables/>\r
-</declarations>\r
-<commands>\r
-<calljobstep id="id1" type="user.jobengine.server.steps.FakeStep" weight="0">\r
-<inputs/>\r
-<outputs/>\r
-</calljobstep>\r
-<calljobstep id="id2" type="user.jobengine.server.steps.FakeStep" weight="0">\r
-<inputs/>\r
-<outputs/>\r
-</calljobstep>\r
-</commands>\r
-</jobtemplate>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate name="Archiválás" description="Kiálasztott média nagy felbontású verziójának mentése szalagos háttértárra.">\r
-<declarations>\r
- <parameters>\r
- <parameter name="media" type="user.jobengine.db.Media"/>\r
- </parameters>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.TSMBackupStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="media" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
- <calljobstep id="id2" type="user.jobengine.server.steps.SetArchivedStep" weight="0">\r
- <inputs>\r
- <input>\r
- <parameter name="media" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate name="Visszatöltés" description="Kiálasztott média nagy felbontású verziójának visszatöltése szalagos háttértárról.">\r
-<declarations>\r
- <parameters>\r
- <parameter name="media" type="user.jobengine.db.Media"/>\r
- </parameters>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.TSMRestoreStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="media" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djobengine.jobsteps.root="${workspace_loc}/user.jobengine.executors/bin" -Djobengine.jobtemplates.root="${workspace_loc}/user.jobengine.executors/jobtemplates" -Djobengine.jobsteps.config="${workspace_loc}/user.jobengine.executors/config/config.xml" -Djobengine.jobscheduling.config="${workspace_loc}/-configuration/scheduledjobs.json" -Djobengine.db.url=jdbc:db2://10.10.1.27:50000/mc -Djobengine.db.user=db2admin -Djobengine.db.password=password -Djobengine.loglevel=INFO -Dlog4j.configurationFile="${workspace_loc}/-configuration/log4j2.xml" -Djobengine.jobsteps.alternate.root="${workspace_loc}/user.jobengine.executors/bin/" -Djetty.home="${workspace_loc:}/-configuration/jetty" -Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Dorg.eclipse.jetty.webapp.basetempdir=c:\temp\jetty -Djava.io.tmpdir=c:\temp\jetty -Djobengine.octopus.api.address=http://10.10.1.11/api/v1 -Djobengine.octopus.api.user=mam -Djobengine.octopus.api.password=napocska -Djobengine.nosql.db.url=jdbc:db2://10.10.1.27:50000/mc -Djobengine.nosql.db.user=db2admin -Djobengine.nosql.db.password=password -Djobengine.nosql.db.schema=test -Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl -Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium -Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; -Djobengine.nexio.db.user=sa -Djobengine.nexio.db.password=resolve -Dnexio.host=10.10.1.55 -Djobengine.nexio.name=testnexioclips -Dnexio.useMOSGateway=true -Dnexio.disable=true -Djobengine.octopus.rundowns.name=rundowns -Djobengine.octopus.storyfolders.name=storyfolders -Djobengine.octopus.stories.name=stories -Dmediacube.auth.location="${workspace_loc}/-configuration/mediacube-auth.properties" -Djobengine.mediacube.config="${workspace_loc}/-configuration/mediacube.json" -Djobengine.mediacube.service.proxyroot="/opt" -Djobengine.jobsteps.groovy.root="${workspace_loc}/user.jobengine.executors/src/user/jobengine/server/steps" -Djobengine.randomize.archives=false -Dmediacube.simplesearch=false"/>\r
<stringAttribute key="pde.version" value="3.3"/>\r
<booleanAttribute key="show_selected_only" value="false"/>\r
-<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs-api@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
+<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.dataformat.jackson-dataformat-yaml@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs-api@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
<booleanAttribute key="tracing" value="false"/>\r
<booleanAttribute key="useCustomFeatures" value="false"/>\r
<booleanAttribute key="useDefaultConfigArea" value="true"/>\r
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>\r
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djobengine.jobsteps.root="${workspace_loc}/user.jobengine.executors/bin" -Djobengine.jobtemplates.root="${workspace_loc}/user.jobengine.executors/jobtemplates/mediavivantis" -Djobengine.db.url=jdbc:db2://10.11.1.90:50000/mc -Djobengine.db.user=db2admin -Djobengine.db.password=password -Djobengine.loglevel=INFO -Dlog4j.configurationFile="${workspace_loc}/-configuration/log4j2.xml" -Djobengine.jobsteps.alternate.root="${workspace_loc}/user.jobengine.executors/bin/" -Djetty.home="${workspace_loc:}/-configuration/jetty" -Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Dorg.eclipse.jetty.webapp.basetempdir=c:\temp\jetty -Djava.io.tmpdir=c:\temp\jetty -Djobengine.octopus.api.address=http://10.10.1.11/api/v1 -Djobengine.octopus.api.user=mam -Djobengine.octopus.api.password=napocska -Djobengine.nosql.db.url=jdbc:db2://10.11.1.90:50000/mc -Djobengine.nosql.db.user=db2admin -Djobengine.nosql.db.password=password -Djobengine.nosql.db.schema=test -Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl -Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium -Djobengine.transcoder.address=http://10.11.1.111:65445/api/json/v1/ -Djobengine.transcoder.template=MP4 -Djobengine.transcoder.version=1 -Djobengine.jobscheduling.config="${workspace_loc}/-configuration/scheduledjobs.json" -Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; -Djobengine.nexio.db.user=sa -Djobengine.nexio.db.password=resolve -Djobengine.planair.db.url=jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis; -Djobengine.planair.db.user=MAM -Djobengine.planair.db.password=VDani -Dnexio.host=192.168.0.12 -Djobengine.nexio.name=testnexioclips -Dnexio.useMOSGateway=false -Dnexio.disable=true -Djobengine.octopus.rundowns.name=rundowns181026 -Djobengine.octopus.storyfolders.name=storyfolders181026 -Djobengine.octopus.stories.name=stories181026 -Djobengine.maestro.config="${workspace_loc}/-configuration/maestro.json" -Djobengine.mediacube.config="${workspace_loc}/-configuration/mediacube.json" -Dgui.statistics.disable=true -Dgui.help.disable=true -Dgui.editor.disable=true -Djobengine.mediafinder.external=false -Djobengine.mediacube.service.proxyroot="/opt" -Djobengine.randomize.archives=true -Djobengine.jobsteps.config="${workspace_loc}/user.jobengine.executors/config/config-mv.xml" -Djobengine.jobsteps.groovy.root="${workspace_loc}/user.jobengine.executors/src/user/jobengine/server/steps" -Dmediacube.simplesearch=true"/>\r
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dlog4j.configurationFile=configuration/log4j2.xml -Djetty.home=configuration/jetty -Djetty.etc.config.urls=jetty.xml,jetty-ssl.xml,jetty-ssl-context.xml,jetty-http.xml,jetty-https.xml -Djava.io.tmpdir=tmp"/>\r
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="C:\_workspace\USER\MediaCube\server\-product\production\MEDIAVIVANTIS"/>\r
<stringAttribute key="pde.version" value="3.3"/>\r
<booleanAttribute key="show_selected_only" value="false"/>\r
-<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs-api@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
+<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.dataformat.jackson-dataformat-yaml@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs-api@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
<booleanAttribute key="tracing" value="false"/>\r
<booleanAttribute key="useCustomFeatures" value="false"/>\r
<booleanAttribute key="useDefaultConfigArea" value="true"/>\r
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djobengine.db.url=jdbc:db2://10.11.1.90:50000/mc -Djobengine.db.user=db2admin -Djobengine.db.password=password -Djobengine.loglevel=INFO -Dlog4j.configurationFile="${workspace_loc}/-configuration/log4j2.xml" -Djobengine.jobsteps.alternate.root="${workspace_loc}/user.jobengine.executors/bin/" -Djetty.home="${workspace_loc:}/-configuration/jetty" -Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Dorg.eclipse.jetty.webapp.basetempdir=c:\temp\jetty -Djava.io.tmpdir=c:\temp\jetty -Djobengine.octopus.api.address=http://10.10.1.11/api/v1 -Djobengine.octopus.api.user=mam -Djobengine.octopus.api.password=napocska -Djobengine.nosql.db.url=jdbc:db2://10.11.1.90:50000/mc -Djobengine.nosql.db.user=db2admin -Djobengine.nosql.db.password=password -Djobengine.nosql.db.schema=test -Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl -Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium -Djobengine.transcoder.address=http://10.11.1.111:65445/api/json/v1/ -Djobengine.transcoder.template=MP4 -Djobengine.transcoder.version=1 -Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; -Djobengine.nexio.db.user=sa -Djobengine.nexio.db.password=resolve -Djobengine.planair.db.url=jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis; -Djobengine.planair.db.user=MAM -Djobengine.planair.db.password=VDani -Dnexio.host=192.168.0.12 -Djobengine.nexio.name=testnexioclips -Dnexio.useMOSGateway=false -Dnexio.disable=true -Djobengine.octopus.rundowns.name=rundowns181026 -Djobengine.octopus.storyfolders.name=storyfolders181026 -Djobengine.octopus.stories.name=stories181026 -Djobengine.maestro.config="${workspace_loc}/-configuration/maestro.json" -Djobengine.mediacube.config="${workspace_loc}/-configuration/mediacube.json" -Dgui.statistics.disable=true -Dgui.help.disable=true -Dgui.editor.disable=true -Djobengine.mediafinder.external=false -Djobengine.mediacube.service.proxyroot="/opt" -Djobengine.randomize.archives=true -Dmediacube.simplesearch=true -Djobengine.jobscheduling.config="/opt/steps/scheduledjobs.json" -Djobengine.jobsteps.config="/opt/steps/executors.xml" -Djobengine.jobtemplates.root="/opt/steps/jobtemplates" -Djobengine.jobsteps.groovy.root="/opt/steps""/>\r
<stringAttribute key="pde.version" value="3.3"/>\r
<booleanAttribute key="show_selected_only" value="false"/>\r
-<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs-api@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
+<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.dataformat.jackson-dataformat-yaml@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs-api@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
<booleanAttribute key="tracing" value="false"/>\r
<booleanAttribute key="useCustomFeatures" value="false"/>\r
<booleanAttribute key="useDefaultConfigArea" value="true"/>\r
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djobengine.jobsteps.root="${workspace_loc}/user.jobengine.executors/bin" -Djobengine.jobtemplates.root="${workspace_loc}/user.jobengine.executors/jobtemplates" -Djobengine.db.url=jdbc:db2://10.228.212.42:50000/mc -Djobengine.db.user=blobtest -Djobengine.db.password=blobtest -Djobengine.db.loginTimeout=3 -Djobengine.loglevel=INFO -Dlog4j.configurationFile="${workspace_loc}/-configuration/log4j2.xml" -Djetty.home="${workspace_loc:}/-configuration/jetty" -Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Dorg.eclipse.jetty.webapp.basetempdir=c:\temp\jetty -Djava.io.tmpdir=c:\temp\jetty -Djobengine.octopus.api.address=http://10.10.1.11/api/v1 -Djobengine.octopus.api.user=mam -Djobengine.octopus.api.password=napocska -Djobengine.nosql.db.url=jdbc:db2://10.228.212.42:50000/mccache -Djobengine.nosql.db.user=blobtest -Djobengine.nosql.db.password=blobtest -Djobengine.nosql.db.schema=test -Djobengine.nosql.db.loginTimeout=3 -Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl -Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium -Djobengine.transcoder.address=http://10.11.1.111:65445/api/json/v1/ -Djobengine.transcoder.template=MP4 -Djobengine.transcoder.version=1 -Djobengine.jobscheduling.config="${workspace_loc}/-configuration/scheduledjobs.json" -Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; -Djobengine.nexio.db.user=sa -Djobengine.nexio.db.password=resolve -Djobengine.planair.db.url=jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis; -Djobengine.planair.db.user=MAM -Djobengine.planair.db.password=VDani -Dnexio.host=192.168.0.12 -Djobengine.nexio.name=testnexioclips -Dnexio.useMOSGateway=false -Dnexio.disable=true -Djobengine.octopus.rundowns.name=rundowns181026 -Djobengine.octopus.storyfolders.name=storyfolders181026 -Djobengine.octopus.stories.name=stories181026 -Djobengine.maestro.config="${workspace_loc}/-configuration/maestro.json" -Djobengine.mediacube.config="${workspace_loc}/-configuration/mediacube.json" -Dgui.statistics.disable=true -Dgui.help.disable=true -Dgui.editor.disable=true -Dgui.maestro.disable=true -Djobengine.mediafinder.external=false -Djobengine.mediacube.service.proxyroot="/opt" -Djobengine.scheduledexecution.disabled=false -Djobengine.randomize.archives=false -Djobengine.jobsteps.config="${workspace_loc}/user.jobengine.executors/config/config.xml" -Djobengine.jobsteps.groovy.root="${workspace_loc}/user.jobengine.executors/src/user/jobengine/server/steps" -Dgui.jobs.alternate.selector=true -Dmediacube.simplesearch=true"/>\r
<stringAttribute key="pde.version" value="3.3"/>\r
<booleanAttribute key="show_selected_only" value="false"/>\r
-<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
+<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.dataformat.jackson-dataformat-yaml@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,groovy@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
<booleanAttribute key="tracing" value="false"/>\r
<booleanAttribute key="useCustomFeatures" value="false"/>\r
<booleanAttribute key="useDefaultConfigArea" value="true"/>\r
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djobengine.jobsteps.root="${workspace_loc}/user.jobengine.executors/config" -Djobengine.jobtemplates.root="${workspace_loc}/user.jobengine.executors/jobtemplates" -Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true; -Djobengine.db.user=db2admin -Djobengine.db.password=password -Djobengine.loglevel=INFO -Dlog4j.configurationFile="${workspace_loc}/-configuration/log4j2.xml" -Djobengine.jobsteps.alternate.root="${workspace_loc}/user.jobengine.executors/bin/" -Djetty.home="${workspace_loc:}/-configuration/jetty" -Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Dorg.eclipse.jetty.webapp.basetempdir=c:\temp\jetty -Djava.io.tmpdir=c:\temp\jetty -Djobengine.octopus.api.address=http://10.10.1.11/api/v1 -Djobengine.octopus.api.user=mam -Djobengine.octopus.api.password=napocska -Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; -Djobengine.nosql.db.user=db2admin -Djobengine.nosql.db.password=password -Djobengine.nosql.db.schema=test -Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl -Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium -Djobengine.jobscheduling.config="${workspace_loc}/-configuration/scheduledjobs.json" -Djobengine.mediacube.config="${workspace_loc}/-configuration/mediacube.json" -Djobengine.maestro.config="${workspace_loc}/-configuration/maestro.json" -Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; -Djobengine.nexio.db.user=sa -Djobengine.nexio.db.password=resolve -Djobengine.planair.db.url=jdbc:sqlserver://10.10.1.45;databaseName=PA_Echo; -Djobengine.planair.db.user=MAM -Djobengine.planair.db.password=Echotv.hu -Dnexio.host=192.168.0.12 -Djobengine.nexio.name=testnexioclips -Dnexio.useMOSGateway=false -Dnexio.disable=true -Dgui.statistics.disable=true -Dgui.help.disable=true -Dgui.editor.disable=true -Djobengine.octopus.rundowns.name=rundowns181026 -Djobengine.octopus.storyfolders.name=storyfolders181026 -Djobengine.octopus.stories.name=stories181026 -Djobengine.mediafinder.external=false -Djobengine.mediafinder.external.url=localhost -Dmediacube.auth.location="${workspace_loc}/-configuration/mediacube-auth.properties""/>\r
<stringAttribute key="pde.version" value="3.3"/>\r
<booleanAttribute key="show_selected_only" value="false"/>\r
-<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.client@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
+<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.dataformat.jackson-dataformat-yaml@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,com.sun.jna@default:default,io.humble.video-arch-x86_64-pc-linux-gnu6@default:default,io.humble.video-arch-x86_64-w64-mingw32@default:default,io.humble.video-noarch@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,junit@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.client@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
<booleanAttribute key="tracing" value="false"/>\r
<booleanAttribute key="useCustomFeatures" value="false"/>\r
<booleanAttribute key="useDefaultConfigArea" value="true"/>\r
<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
-<?pde version="3.8"?><target name="JobEngine" sequenceNumber="466">\r
+<?pde version="3.8"?><target name="JobEngine" sequenceNumber="478">\r
<locations>\r
<location path="${workspace_loc}/-dependencies/target/repository/plugins" type="Directory"/>\r
</locations>\r
<plugin id="com.fasterxml.jackson.core.jackson-annotations" version="2.4.5"/>\r
<plugin id="com.fasterxml.jackson.core.jackson-core" version="2.4.5"/>\r
<plugin id="com.fasterxml.jackson.core.jackson-databind" version="2.4.5"/>\r
+<plugin id="com.fasterxml.jackson.dataformat.jackson-dataformat-yaml"/>\r
<plugin id="com.fasterxml.jackson.datatype.jackson-datatype-joda"/>\r
<plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-base" version="2.4.5"/>\r
<plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" version="2.4.5"/>\r
<plugin id="org.apache.commons.io" version="2.2.0"/>\r
<plugin id="org.apache.commons.lang"/>\r
<plugin id="org.apache.commons.net"/>\r
-<plugin id="org.apache.felix.fileinstall"/>\r
-<plugin id="org.apache.felix.fileinstall.source"/>\r
<plugin id="org.apache.felix.gogo.command"/>\r
<plugin id="org.apache.felix.gogo.runtime" version="0.10.0.v201209301036"/>\r
<plugin id="org.apache.felix.gogo.shell" version="0.10.0.v201212101605"/>\r
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\r
<jetty.version>9.3.9.v20160517</jetty.version>\r
- <!-- <jetty.version>9.3.27.v20190418</jetty.version> -->\r
- <swagger-core-version>1.5.9</swagger-core-version>\r
<resteasy-version>3.0.11.Final</resteasy-version>\r
<fasterxml-jackson-core>2.4.5</fasterxml-jackson-core>\r
</properties>\r
<packaging>jar</packaging>\r
</configuration>\r
</execution>\r
- <execution>\r
- <id>install4</id>\r
- <phase>package</phase>\r
- <goals>\r
- <goal>install-file</goal>\r
- </goals>\r
- <configuration>\r
- <file>libs/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar</file>\r
- <groupId>org.eclipse.platform</groupId>\r
- <artifactId>org.eclipse.equinox.launcher</artifactId>\r
- <version>1.3.200.v20160318-1642</version>\r
- <packaging>jar</packaging>\r
- </configuration>\r
- </execution>\r
+<!-- <execution> -->\r
+<!-- <id>install4</id> -->\r
+<!-- <phase>package</phase> -->\r
+<!-- <goals> -->\r
+<!-- <goal>install-file</goal> -->\r
+<!-- </goals> -->\r
+<!-- <configuration> -->\r
+<!-- <file>libs/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar</file> -->\r
+<!-- <groupId>org.eclipse.platform</groupId> -->\r
+<!-- <artifactId>org.eclipse.equinox.launcher</artifactId> -->\r
+<!-- <version>1.3.200.v20160318-1642</version> -->\r
+<!-- <packaging>jar</packaging> -->\r
+<!-- </configuration> -->\r
+<!-- </execution> -->\r
</executions>\r
</plugin>\r
<plugin>\r
<configuration>\r
<artifacts>\r
<artifact>\r
- <id>org.eclipse.platform:org.eclipse.equinox.launcher:1.3.200.v20160318-1642</id>\r
- </artifact>\r
- <artifact>\r
- <id>org.apache.felix:org.apache.felix.fileinstall:3.6.8</id>\r
- <source>true</source>\r
+ <id>org.eclipse.platform:org.eclipse.equinox.launcher:1.3.201</id>\r
</artifact>\r
<artifact>\r
<id>net.java.dev.jna:jna:4.2.0</id>\r
<id>org.eclipse.jetty:jetty-server:9.3.9.v20160517</id>\r
</artifact>\r
<artifact>\r
- <id>org.apache.felix:org.apache.felix.gogo.shell:0.10.0</id>\r
+ <id>org.apache.felix:org.apache.felix.gogo.command:0.10.0.v201209301215</id>\r
</artifact>\r
<artifact>\r
- <id>org.apache.felix:org.apache.felix.gogo.runtime:0.10.0</id>\r
+ <id>org.apache.felix:org.apache.felix.gogo.shell:0.10.0</id>\r
</artifact>\r
<artifact>\r
- <id>org.apache.felix:org.apache.felix.gogo.command:0.10.0.v201209301215</id>\r
+ <id>org.apache.felix:org.apache.felix.gogo.runtime:0.10.0</id>\r
</artifact>\r
+<!-- <artifact> -->\r
+<!-- <id>org.apache.felix:org.apache.felix.gogo.command:0.10.0.v201209301215</id> -->\r
+<!-- </artifact> -->\r
\r
<artifact>\r
<id>commons-io:commons-io:2.2</id>\r
<artifact>\r
<id>com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${fasterxml-jackson-core}</id>\r
</artifact>\r
+ <artifact>\r
+ <id>com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${fasterxml-jackson-core}</id>\r
+ </artifact>\r
<artifact>\r
<id>com.fasterxml.jackson.datatype:jackson-datatype-joda:${fasterxml-jackson-core}</id>\r
</artifact>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<Configuration status="ERROR" monitorInterval="10" packages="user.commons.log4j2.appender">\r
- <Properties>\r
- <Property name="logPath">/opt/mediacube/log</Property>\r
- <Property name="fileName">${logPath}/mediacube.log</Property>\r
- <Property name="filePattern">${logPath}/$${date:yyyy-MM}/mediacube-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
- <Property name="markeredFileName">${logPath}/markered-mediacube.log</Property>\r
- <Property name="markeredFilePattern">${logPath}/$${date:yyyy-MM}/markered-mediacube-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
- <Property name="fileName.err">${logPath}/mediacube-err.log</Property>\r
- <Property name="filePattern.err">${logPath}/$${date:yyyy-MM}/mediacube-err-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
- </Properties>\r
- <Appenders>\r
- <Console name="Console" target="SYSTEM_OUT">\r
- <Filters>\r
- <MarkerFilter marker="MEDIACUBE" onMatch="DENY" onMismatch="NEUTRAL" />\r
- </Filters>\r
- <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %msg (%F:%L) %n" />\r
- </Console>\r
- <Console name="MarkeredConsole" target="SYSTEM_ERR">\r
- <Filters>\r
- <MarkerFilter marker="MEDIACUBE" onMatch="ACCEPT" onMismatch="DENY" />\r
- </Filters>\r
- <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %markerSimpleName - %msg (%F:%L)%n" />\r
- </Console>\r
- <HTMLMailAppender name="MarkeredMail" subject="MediaCube rendszerüzenet" to="vasary@elgekko.net" from="mediacube-noreply@echotv.hu" smtpHost="10.10.254.63"\r
- smtpPort="25" smtpProtocol="smtp" smtpUsername="intra\mediacube" smtpPassword="s@vm*P#6Jh" ignoreExceptions="false" bufferSize="1">\r
- <Filters>\r
- <MarkerFilter marker="MEDIACUBE" onMatch="ACCEPT" onMismatch="DENY" />\r
- </Filters>\r
- <PatternLayout pattern="%d{HH:mm:ss} %-5level - %msg %n%n A küldő a %F forráskód %L. sorából a %logger{1}.%M függvény volt. %n" />\r
- </HTMLMailAppender>\r
-<!-- <HTMLMailAppender name="MarkeredMail" subject="MediaCube rendszerüzenet" to="vasary@elgekko.net" from="mediacubeserver@gmail.com" smtpHost="smtp.gmail.com" -->\r
-<!-- smtpPort="465" smtpProtocol="smtps" smtpUsername="mediacubeserver@gmail.com" smtpPassword="salabakter" ignoreExceptions="false" bufferSize="1"> -->\r
-<!-- <Filters> -->\r
-<!-- <MarkerFilter marker="MEDIACUBE" onMatch="ACCEPT" onMismatch="DENY" /> -->\r
-<!-- </Filters> -->\r
-<!-- <PatternLayout pattern="%d{HH:mm:ss} %-5level - %msg %n%n A küldő a %F forráskód %L. sorából a %logger{1}.%M függvény volt. %n" /> -->\r
-<!-- </HTMLMailAppender> -->\r
- <RollingFile name="MarkeredRollingFile" fileName="${markeredFileName}" filePattern="${markeredFilePattern}">\r
- <Filters>\r
- <MarkerFilter marker="MEDIACUBE" onMatch="ACCEPT" onMismatch="DENY" />\r
- </Filters>\r
- <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %markerSimpleName - %msg (%F:%L)%n %throwable" />\r
- <Policies>\r
- <TimeBasedTriggeringPolicy />\r
- </Policies>\r
- </RollingFile>\r
- <RollingFile name="RollingFile" fileName="${fileName}" filePattern="${filePattern}">\r
- <Filters>\r
- <MarkerFilter marker="MEDIACUBE" onMatch="DENY" onMismatch="NEUTRAL" />\r
- </Filters>\r
- <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %level %logger{1}.%M %msg (%F:%L)%n %throwable" />\r
- <Policies>\r
- <TimeBasedTriggeringPolicy />\r
- </Policies>\r
- </RollingFile>\r
- <RollingFile name="RollingFileExceptions" fileName="${fileName.err}" filePattern="${filePattern.err}">\r
- <PatternLayout pattern="%d{HH:mm:ss.SSS} %logger{1}.%M %msg (%F:%L)%n %throwable" />\r
- <Filters>\r
- <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY" />\r
- </Filters>\r
- <Policies>\r
- <TimeBasedTriggeringPolicy />\r
- </Policies>\r
- </RollingFile>\r
- </Appenders>\r
- <Loggers>\r
- <Root level="INFO">\r
- <AppenderRef ref="Console" />\r
- <AppenderRef ref="MarkeredConsole" />\r
- <AppenderRef ref="RollingFile" />\r
- <AppenderRef ref="RollingFileExceptions" />\r
- <AppenderRef ref="MarkeredRollingFile" />\r
- <AppenderRef ref="MarkeredMail" />\r
- </Root>\r
- <Logger name="org.zkoss" level="ERROR" additivity="false" />\r
- <Logger name="org.quartz" level="ERROR" additivity="false" />\r
- <Logger name="org.eclipse.jetty.osgi.boot" level="ERROR" additivity="false" />\r
-\r
-<!-- <logger name="org.jboss.resteasy.core" level="debug" /> -->\r
-<!-- <logger name="org.jboss.resteasy.specimpl" level="debug" /> -->\r
-<!-- <logger name="org.jboss.resteasy.plugins.server" level="debug" /> -->\r
-<!-- <logger name="org.jboss.resteasy.plugins.providers" level="debug" /> -->\r
-<!-- <logger name="user.commons.nexio" level="debug" /> -->\r
- </Loggers>\r
-</Configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>\r
<?pde version="3.5"?>\r
\r
-<product name="MediaCube" uid="MediaCube" version="1.0.0" useFeatures="false" includeLaunchers="true">\r
+<product name="MediaCube" uid="MediaCube" version="1.0.0" useFeatures="false" includeLaunchers="false">\r
\r
<configIni use="default">\r
+ <linux>/-product/production/configuration/config.ini</linux>\r
</configIni>\r
\r
<launcherArgs>\r
- <programArgs>-consoleLog -console 5555\r
- </programArgs>\r
- <vmArgs>-Xms512m
--Xmx1024m
--Dfile.encoding=UTF-8
--agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888
--Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory
-
-#System
--Djetty.home=/opt/mediacube/configuration/jetty
--Dlog4j.configurationFile=/opt/mediacube/configuration/log4j2.xml
--Djobengine.jobsteps.root=/opt/mediacube/configuration/executors
--Djobengine.jobtemplates.root=/opt/mediacube/configuration/jobtemplates
--Djobengine.jobscheduling.config=/opt/mediacube/configuration/scheduledjobs.json
--Dmediacube.auth.location=/opt/mediacube/configuration/mediacube-auth.properties
-
--Dorg.eclipse.epp.logging.aeri.skipReports=true
--Declipse.ignoreApp=true
--Dosgi.noShutdown=true
--Djobengine.loglevel=INFO
--Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml
--Djava.io.tmpdir=/opt/mediacube/tmp\r
- </vmArgs>\r
- <vmArgsLin>#Database
--Djobengine.db.url=jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.db.user=db2admin
--Djobengine.db.password=password
--Djobengine.nosql.db.url=jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.nosql.db.user=db2admin
--Djobengine.nosql.db.password=password
--Djobengine.nosql.db.schema=test
-
-#Octopus
--Djobengine.octopus.api.address=http://10.10.1.11/api/v1
--Djobengine.octopus.api.user=mam
--Djobengine.octopus.api.password=napocska
--Djobengine.octopus.rundowns.name=rundowns
--Djobengine.octopus.storyfolders.name=storyfolders
--Djobengine.octopus.stories.name=stories
-
-#Selenio
--Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl
--Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium
-
-#Nexio
--Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB;
--Djobengine.nexio.db.user=sa
--Djobengine.nexio.db.password=resolve
--Dnexio.useMOSGateway=true
--Dnexio.host=10.10.1.55
--Dnexio.disable=false\r
- </vmArgsLin>\r
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts\r
- </vmArgsMac>\r
- <vmArgsWin>#Database
--Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.db.user=db2admin
--Djobengine.db.password=password
--Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.nosql.db.user=db2admin
--Djobengine.nosql.db.password=password
--Djobengine.nosql.db.schema=test
-
-#Octopus
--Djobengine.octopus.api.address=http://10.10.1.11/api/v1
--Djobengine.octopus.api.user=mam
--Djobengine.octopus.api.password=napocska
-
-#Selenio
--Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl
--Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium
-
-#Nexio
--Dnexio.host=10.10.1.55\r
- </vmArgsWin>\r
</launcherArgs>\r
\r
+ <windowImages/>\r
+\r
+\r
<launcher name="mediacube">\r
<solaris/>\r
<win useIco="false">\r
<plugin id="com.fasterxml.jackson.core.jackson-annotations" version="2.4.5"/>\r
<plugin id="com.fasterxml.jackson.core.jackson-core" version="2.4.5"/>\r
<plugin id="com.fasterxml.jackson.core.jackson-databind" version="2.4.5"/>\r
+ <plugin id="com.fasterxml.jackson.dataformat.jackson-dataformat-yaml"/>\r
<plugin id="com.fasterxml.jackson.datatype.jackson-datatype-joda" version="2.4.5"/>\r
<plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-base" version="2.4.5"/>\r
<plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" version="2.4.5"/>\r
<plugin id="org.apache.commons.io"/>\r
<plugin id="org.apache.commons.lang"/>\r
<plugin id="org.apache.commons.net"/>\r
- <plugin id="org.apache.felix.fileinstall"/>\r
- <plugin id="org.apache.felix.fileinstall.source"/>\r
<plugin id="org.apache.felix.gogo.command" version="0.10.0.v201209301215"/>\r
<plugin id="org.apache.felix.gogo.runtime" version="0.10.0.v201209301036"/>\r
<plugin id="org.apache.felix.gogo.shell" version="0.10.0.v201212101605"/>\r
<plugin id="org.eclipse.equinox.console"/>\r
<plugin id="org.eclipse.equinox.ds"/>\r
<plugin id="org.eclipse.equinox.launcher"/>\r
- <plugin id="org.eclipse.equinox.launcher.source"/>\r
<plugin id="org.eclipse.equinox.util"/>\r
<plugin id="org.eclipse.jetty.client"/>\r
<plugin id="org.eclipse.jetty.deploy"/>\r
<plugin id="user.jobengine.osgi.commons" autoStart="true" startLevel="0" />\r
</configurations>\r
\r
+ <preferencesInfo>\r
+ <targetfile overwrite="false"/>\r
+ </preferencesInfo>\r
+\r
+ <cssInfo>\r
+ </cssInfo>\r
+\r
</product>\r
+++ /dev/null
-./mediacube &
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<?pde version="3.5"?>\r
-\r
-<product name="MediaCube" uid="MediaCube" version="1.0.0" useFeatures="false" includeLaunchers="true">\r
-\r
- <configIni use="default">\r
- </configIni>\r
-\r
- <launcherArgs>\r
- <programArgs>-consoleLog -console\r
- </programArgs>\r
- <vmArgs>#System
--Dorg.eclipse.equinox.http.jetty.http.port=8080
--Dorg.eclipse.epp.logging.aeri.skipReports=true
--Declipse.ignoreApp=true
--Dosgi.noShutdown=true
--Djetty.home=configuration/jetty
--Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml
--Dlog4j.configuration=./configuration/log4j.properties
--Dlog4j.configurationFile=./configuration/log4j2.xml
-
-#JobEngine
--Djobengine.loglevel=INFO
--Djobengine.jobsteps.root=./configuration/executors
--Djobengine.jobtemplates.root=./configuration/templates
--Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.db.user=db2admin
--Djobengine.db.password=password
--Djobengine.octopus.api.address=http://10.10.1.21/api/v1
--Djobengine.octopus.api.user=mam
--Djobengine.octopus.api.password=napocska
--Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.nosql.db.user=db2admin
--Djobengine.nosql.db.password=password
--Djobengine.nosql.db.schema=test
--Djobengine.rcc.host=localhost
--Djobengine.rcc.defaultlowresprofile="MediaCube-H264"
--Djobengine.transcoder.source=c:\_Movie\hires\\r
- </vmArgs>\r
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts\r
- </vmArgsMac>\r
- </launcherArgs>\r
-\r
- <launcher name="mediacube">\r
- <solaris/>\r
- <win useIco="false">\r
- <bmp/>\r
- </win>\r
- </launcher>\r
-\r
- <vm>\r
- <windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</windows>\r
- </vm>\r
-\r
- <plugins>\r
- <plugin id="cglib"/>\r
- <plugin id="com.auth0.java-jwt"/>\r
- <plugin id="com.fasterxml.jackson.core.jackson-annotations"/>\r
- <plugin id="com.fasterxml.jackson.core.jackson-core"/>\r
- <plugin id="com.fasterxml.jackson.core.jackson-databind"/>\r
- <plugin id="com.fasterxml.jackson.dataformat.jackson-dataformat-xml"/>\r
- <plugin id="com.fasterxml.jackson.dataformat.jackson-dataformat-yaml"/>\r
- <plugin id="com.fasterxml.jackson.datatype.jackson-datatype-joda"/>\r
- <plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-base"/>\r
- <plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider"/>\r
- <plugin id="com.fasterxml.jackson.module.jackson-module-jaxb-annotations"/>\r
- <plugin id="com.google.guava"/>\r
- <plugin id="com.ibm.db2jcc4"/>\r
- <plugin id="com.ibm.nosql"/>\r
- <plugin id="com.sun.el.javax.el"/>\r
- <plugin id="commons-logging"/>\r
- <plugin id="io.swagger.annotations"/>\r
- <plugin id="io.swagger.core"/>\r
- <plugin id="io.swagger.jaxrs"/>\r
- <plugin id="io.swagger.jersey2-jaxrs"/>\r
- <plugin id="io.swagger.models"/>\r
- <plugin id="javassist"/>\r
- <plugin id="javax.annotation-api"/>\r
- <plugin id="javax.inject"/>\r
- <plugin id="javax.servlet-api"/>\r
- <plugin id="javax.servlet.jsp-api"/>\r
- <plugin id="javax.validation.api"/>\r
- <plugin id="javax.ws.rs-api"/>\r
- <plugin id="jcifs"/>\r
- <plugin id="joda-time"/>\r
- <plugin id="org.apache.aries.spifly.dynamic.bundle"/>\r
- <plugin id="org.apache.aries.util"/>\r
- <plugin id="org.apache.commons.beanutils"/>\r
- <plugin id="org.apache.commons.codec"/>\r
- <plugin id="org.apache.commons.collections"/>\r
- <plugin id="org.apache.commons.digester"/>\r
- <plugin id="org.apache.commons.io"/>\r
- <plugin id="org.apache.commons.lang"/>\r
- <plugin id="org.apache.commons.lang3"/>\r
- <plugin id="org.apache.commons.net"/>\r
- <plugin id="org.apache.felix.gogo.command"/>\r
- <plugin id="org.apache.felix.gogo.runtime"/>\r
- <plugin id="org.apache.felix.gogo.shell"/>\r
- <plugin id="org.apache.jasper.glassfish"/>\r
- <plugin id="org.apache.log4j"/>\r
- <plugin id="org.apache.logging.log4j.api"/>\r
- <plugin id="org.apache.logging.log4j.core"/>\r
- <plugin id="org.apache.logging.log4j.slf4j-impl"/>\r
- <plugin id="org.apache.servicemix.bundles.quartz"/>\r
- <plugin id="org.eclipse.equinox.common"/>\r
- <plugin id="org.eclipse.equinox.console"/>\r
- <plugin id="org.eclipse.equinox.ds"/>\r
- <plugin id="org.eclipse.equinox.util"/>\r
- <plugin id="org.eclipse.jdt.core.compiler.batch"/>\r
- <plugin id="org.eclipse.jetty.client"/>\r
- <plugin id="org.eclipse.jetty.deploy"/>\r
- <plugin id="org.eclipse.jetty.http"/>\r
- <plugin id="org.eclipse.jetty.io"/>\r
- <plugin id="org.eclipse.jetty.jsp"/>\r
- <plugin id="org.eclipse.jetty.osgi.boot"/>\r
- <plugin id="org.eclipse.jetty.osgi.boot.jsp" fragment="true"/>\r
- <plugin id="org.eclipse.jetty.schemas"/>\r
- <plugin id="org.eclipse.jetty.security"/>\r
- <plugin id="org.eclipse.jetty.server"/>\r
- <plugin id="org.eclipse.jetty.servlet"/>\r
- <plugin id="org.eclipse.jetty.util"/>\r
- <plugin id="org.eclipse.jetty.webapp"/>\r
- <plugin id="org.eclipse.jetty.websocket.api"/>\r
- <plugin id="org.eclipse.jetty.websocket.client"/>\r
- <plugin id="org.eclipse.jetty.websocket.common"/>\r
- <plugin id="org.eclipse.jetty.websocket.server"/>\r
- <plugin id="org.eclipse.jetty.websocket.servlet"/>\r
- <plugin id="org.eclipse.jetty.xml"/>\r
- <plugin id="org.eclipse.osgi"/>\r
- <plugin id="org.eclipse.osgi.services"/>\r
- <plugin id="org.glassfish.hk2.api"/>\r
- <plugin id="org.glassfish.hk2.external.aopalliance-repackaged"/>\r
- <plugin id="org.glassfish.hk2.external.javax.inject"/>\r
- <plugin id="org.glassfish.hk2.locator"/>\r
- <plugin id="org.glassfish.hk2.osgi-resource-locator"/>\r
- <plugin id="org.glassfish.hk2.utils"/>\r
- <plugin id="org.glassfish.jersey.bundles.repackaged.jersey-guava"/>\r
- <plugin id="org.glassfish.jersey.containers.jersey-container-servlet-core"/>\r
- <plugin id="org.glassfish.jersey.core.jersey-client"/>\r
- <plugin id="org.glassfish.jersey.core.jersey-common"/>\r
- <plugin id="org.glassfish.jersey.core.jersey-server"/>\r
- <plugin id="org.glassfish.jersey.media.jersey-media-jaxb"/>\r
- <plugin id="org.glassfish.jersey.media.jersey-media-multipart"/>\r
- <plugin id="org.hamcrest.core"/>\r
- <plugin id="org.jmock"/>\r
- <plugin id="org.jmock.junit4"/>\r
- <plugin id="org.junit"/>\r
- <plugin id="org.jvnet.mimepull"/>\r
- <plugin id="org.objectweb.asm"/>\r
- <plugin id="org.objectweb.asm.commons"/>\r
- <plugin id="org.objectweb.asm.tree"/>\r
- <plugin id="org.reflections"/>\r
- <plugin id="slf4j.api"/>\r
- <plugin id="slf4j.simple" fragment="true"/>\r
- <plugin id="stax2-api"/>\r
- <plugin id="user.jobengine.executors"/>\r
- <plugin id="user.jobengine.osgi.commons"/>\r
- <plugin id="user.jobengine.osgi.db"/>\r
- <plugin id="user.jobengine.osgi.rest"/>\r
- <plugin id="user.jobengine.osgi.server"/>\r
- <plugin id="user.tsm.client"/>\r
- </plugins>\r
-\r
- <configurations>\r
- <plugin id="org.apache.logging.log4j.api" autoStart="true" startLevel="1" />\r
- <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />\r
- <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" />\r
- <plugin id="org.eclipse.jetty.osgi.boot" autoStart="true" startLevel="0" />\r
- <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />\r
- <plugin id="org.glassfish.jersey.bundles.repackaged.jersey-guava" autoStart="true" startLevel="0" />\r
- <plugin id="user.jobengine.osgi.commons" autoStart="true" startLevel="0" />\r
- </configurations>\r
-\r
-</product>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<?pde version="3.5"?>\r
-\r
-<product name="MediaCube" uid="MediaCube" version="1.0.0" useFeatures="false" includeLaunchers="true">\r
-\r
-\r
- <configIni use="default">\r
- </configIni>\r
-\r
- <launcherArgs>\r
- <programArgs>-consoleLog -console\r
- </programArgs>\r
- <vmArgs>#System\r
--Dorg.eclipse.equinox.http.jetty.http.port=8080\r
--Dorg.eclipse.epp.logging.aeri.skipReports=true \r
--Declipse.ignoreApp=true \r
--Dosgi.noShutdown=true\r
--Djetty.home=configuration/jetty\r
--Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml\r
--Dlog4j.configuration=./configuration/log4j.properties\r
--Dlog4j.configurationFile=./configuration/log4j2.xml\r
-\r
-#JobEngine\r
--Djobengine.loglevel=INFO\r
--Djobengine.jobsteps.root=./configuration/executors\r
--Djobengine.jobtemplates.root=./configuration/templates\r
--Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;\r
--Djobengine.db.user=db2admin\r
--Djobengine.db.password=password\r
--Djobengine.octopus.api.address=http://10.10.1.21/api/v1\r
--Djobengine.octopus.api.user=mam\r
--Djobengine.octopus.api.password=napocska\r
--Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;\r
--Djobengine.nosql.db.user=db2admin\r
--Djobengine.nosql.db.password=password\r
--Djobengine.nosql.db.schema=test\r
--Djobengine.rcc.host=localhost\r
--Djobengine.rcc.defaultlowresprofile="MediaCube-H264"\r
--Djobengine.transcoder.source=c:\_Movie\hires\\r
- </vmArgs>\r
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts\r
- </vmArgsMac>\r
- </launcherArgs>\r
-\r
- <windowImages/>\r
-\r
-\r
- <launcher>\r
- <solaris/>\r
- <win useIco="false">\r
- <bmp/>\r
- </win>\r
- </launcher>\r
-\r
-\r
- <vm>\r
- <windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</windows>\r
- </vm>\r
-\r
-\r
- <plugins>\r
- <plugin id="cglib"/>\r
- <plugin id="com.auth0.java-jwt"/>\r
- <plugin id="com.fasterxml.jackson.core.jackson-annotations"/>\r
- <plugin id="com.fasterxml.jackson.core.jackson-core"/>\r
- <plugin id="com.fasterxml.jackson.core.jackson-databind"/>\r
- <plugin id="com.fasterxml.jackson.dataformat.jackson-dataformat-yaml"/>\r
- <plugin id="com.fasterxml.jackson.datatype.jackson-datatype-joda"/>\r
- <plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-base"/>\r
- <plugin id="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider"/>\r
- <plugin id="com.fasterxml.jackson.module.jackson-module-jaxb-annotations"/>\r
- <plugin id="com.google.guava"/>\r
- <plugin id="com.ibm.db2jcc4"/>\r
- <plugin id="com.ibm.nosql"/>\r
- <plugin id="com.microsoft.sqlserver.sqljdbc"/>\r
- <plugin id="com.sun.el.javax.el"/>\r
- <plugin id="commons-logging"/>\r
- <plugin id="javassist"/>\r
- <plugin id="javax.annotation-api"/>\r
- <plugin id="javax.inject"/>\r
- <plugin id="javax.servlet-api"/>\r
- <plugin id="javax.servlet.jsp-api"/>\r
- <plugin id="javax.validation.api"/>\r
- <plugin id="javax.ws.rs-api"/>\r
- <plugin id="jcifs"/>\r
- <plugin id="joda-time"/>\r
- <plugin id="org.apache.aries.spifly.dynamic.bundle"/>\r
- <plugin id="org.apache.aries.util"/>\r
- <plugin id="org.apache.commons.beanutils"/>\r
- <plugin id="org.apache.commons.codec"/>\r
- <plugin id="org.apache.commons.collections"/>\r
- <plugin id="org.apache.commons.digester"/>\r
- <plugin id="org.apache.commons.io"/>\r
- <plugin id="org.apache.commons.lang"/>\r
- <plugin id="org.apache.commons.lang3"/>\r
- <plugin id="org.apache.commons.net"/>\r
- <plugin id="org.apache.felix.gogo.command"/>\r
- <plugin id="org.apache.felix.gogo.runtime"/>\r
- <plugin id="org.apache.felix.gogo.shell"/>\r
- <plugin id="org.apache.jasper.glassfish"/>\r
- <plugin id="org.apache.logging.log4j.api"/>\r
- <plugin id="org.apache.logging.log4j.core"/>\r
- <plugin id="org.apache.logging.log4j.slf4j-impl"/>\r
- <plugin id="org.apache.servicemix.bundles.quartz"/>\r
- <plugin id="org.eclipse.equinox.common"/>\r
- <plugin id="org.eclipse.equinox.console"/>\r
- <plugin id="org.eclipse.equinox.ds"/>\r
- <plugin id="org.eclipse.equinox.util"/>\r
- <plugin id="org.eclipse.jdt.core.compiler.batch"/>\r
- <plugin id="org.eclipse.jetty.client"/>\r
- <plugin id="org.eclipse.jetty.deploy"/>\r
- <plugin id="org.eclipse.jetty.http"/>\r
- <plugin id="org.eclipse.jetty.io"/>\r
- <plugin id="org.eclipse.jetty.jsp"/>\r
- <plugin id="org.eclipse.jetty.osgi.boot"/>\r
- <plugin id="org.eclipse.jetty.osgi.boot.jsp" fragment="true"/>\r
- <plugin id="org.eclipse.jetty.schemas"/>\r
- <plugin id="org.eclipse.jetty.security"/>\r
- <plugin id="org.eclipse.jetty.server"/>\r
- <plugin id="org.eclipse.jetty.servlet"/>\r
- <plugin id="org.eclipse.jetty.util"/>\r
- <plugin id="org.eclipse.jetty.webapp"/>\r
- <plugin id="org.eclipse.jetty.websocket.api"/>\r
- <plugin id="org.eclipse.jetty.websocket.client"/>\r
- <plugin id="org.eclipse.jetty.websocket.common"/>\r
- <plugin id="org.eclipse.jetty.websocket.server"/>\r
- <plugin id="org.eclipse.jetty.websocket.servlet"/>\r
- <plugin id="org.eclipse.jetty.xml"/>\r
- <plugin id="org.eclipse.osgi"/>\r
- <plugin id="org.eclipse.osgi.services"/>\r
- <plugin id="org.glassfish.hk2.api"/>\r
- <plugin id="org.glassfish.hk2.external.aopalliance-repackaged"/>\r
- <plugin id="org.glassfish.hk2.external.javax.inject"/>\r
- <plugin id="org.glassfish.hk2.locator"/>\r
- <plugin id="org.glassfish.hk2.osgi-resource-locator"/>\r
- <plugin id="org.glassfish.hk2.utils"/>\r
- <plugin id="org.glassfish.jersey.bundles.repackaged.jersey-guava"/>\r
- <plugin id="org.glassfish.jersey.core.jersey-client"/>\r
- <plugin id="org.glassfish.jersey.core.jersey-common"/>\r
- <plugin id="org.hamcrest.core"/>\r
- <plugin id="org.jboss.resteasy.jaxrs"/>\r
- <plugin id="org.jmock"/>\r
- <plugin id="org.jmock.junit4"/>\r
- <plugin id="org.junit"/>\r
- <plugin id="org.jvnet.mimepull"/>\r
- <plugin id="org.objectweb.asm"/>\r
- <plugin id="org.objectweb.asm.commons"/>\r
- <plugin id="org.objectweb.asm.tree"/>\r
- <plugin id="org.reflections"/>\r
- <plugin id="slf4j.api"/>\r
- <plugin id="slf4j.simple" fragment="true"/>\r
- <plugin id="user.jobengine.osgi.commons"/>\r
- <plugin id="user.jobengine.osgi.db"/>\r
- <plugin id="user.jobengine.osgi.server"/>\r
- <plugin id="user.jobengine.osgi.services"/>\r
- <plugin id="user.tsm.client"/>\r
- </plugins>\r
-\r
- <configurations>\r
- <plugin id="org.apache.logging.log4j.api" autoStart="true" startLevel="1" />\r
- <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />\r
- <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" />\r
- <plugin id="org.eclipse.jetty.osgi.boot" autoStart="true" startLevel="0" />\r
- <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />\r
- <plugin id="user.jobengine.osgi.commons" autoStart="true" startLevel="0" />\r
- </configurations>\r
-\r
- <preferencesInfo>\r
- <targetfile overwrite="false"/>\r
- </preferencesInfo>\r
-\r
- <cssInfo>\r
- </cssInfo>\r
-\r
-</product>\r
<goal>materialize-products</goal>\r
</goals>\r
</execution>\r
- <!-- <execution> -->\r
- <!-- <id>archive-products</id> -->\r
- <!-- <goals> -->\r
- <!-- <goal>archive-products</goal> -->\r
- <!-- </goals> -->\r
- <!-- </execution> -->\r
</executions>\r
</plugin>\r
- <plugin>\r
- <groupId>org.apache.maven.plugins</groupId>\r
- <artifactId>maven-resources-plugin</artifactId>\r
- <version>2.7</version>\r
- <executions>\r
- <execution>\r
- <id>copy-resources-1-lnx</id>\r
- <phase>install</phase>\r
- <goals>\r
- <goal>copy-resources</goal>\r
- </goals>\r
- <configuration>\r
- <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration</outputDirectory>\r
- <resources>\r
- <resource>\r
- <directory>${basedir}/../-configuration</directory>\r
- <includes>\r
- <include>dsm.opt</include>\r
- </includes>\r
- </resource>\r
- <resource>\r
- <directory>${basedir}/../user.jobengine.executors/config</directory>\r
- <includes>\r
- <include>scheduledjobs.json</include>\r
- </includes>\r
- </resource>\r
- <resource>\r
- <directory>${basedir}</directory>\r
- <includes>\r
- <include>log4j2.xml</include>\r
- </includes>\r
- </resource>\r
- <resource>\r
- <directory>${basedir}/../-configuration</directory>\r
- <includes>\r
- <include>mediacube-auth.properties</include>\r
- </includes>\r
- </resource>\r
- </resources>\r
- </configuration>\r
- </execution>\r
- <execution>\r
- <id>copy-resources-2-lnx</id>\r
- <phase>install</phase>\r
- <goals>\r
- <goal>copy-resources</goal>\r
- </goals>\r
- <configuration>\r
- <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/executors</outputDirectory>\r
- <resources>\r
- <resource>\r
- <directory>${basedir}/../user.jobengine.executors/config</directory>\r
- <includes>\r
- <include>config.xml</include>\r
- </includes>\r
- </resource>\r
- </resources>\r
- </configuration>\r
- </execution>\r
- <execution>\r
- <id>copy-resources-3-lnx</id>\r
- <phase>install</phase>\r
- <goals>\r
- <goal>copy-resources</goal>\r
- </goals>\r
- <configuration>\r
- <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/executors</outputDirectory>\r
- <resources>\r
- <resource>\r
- <directory>${basedir}/../user.jobengine.executors/bin/user/jobengine/server/steps</directory>\r
- </resource>\r
- </resources>\r
- </configuration>\r
- </execution>\r
- <execution>\r
- <id>copy-resources-4-lnx</id>\r
- <phase>install</phase>\r
- <goals>\r
- <goal>copy-resources</goal>\r
- </goals>\r
- <configuration>\r
- <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/jobtemplates</outputDirectory>\r
- <resources>\r
- <resource>\r
- <directory>${basedir}/../user.jobengine.executors/jobtemplates</directory>\r
- </resource>\r
- </resources>\r
- </configuration>\r
- </execution>\r
- <execution>\r
- <id>copy-resources-5-lnx</id>\r
- <phase>install</phase>\r
- <goals>\r
- <goal>copy-resources</goal>\r
- </goals>\r
- <configuration>\r
- <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/jetty/etc</outputDirectory>\r
- <resources>\r
- <resource>\r
- <directory>${basedir}/../-configuration/jetty-deploy/etc</directory>\r
- </resource>\r
- </resources>\r
- </configuration>\r
- </execution>\r
- <execution>\r
- <id>copy-resources-6-lnx</id>\r
- <phase>install</phase>\r
- <goals>\r
- <goal>copy-resources</goal>\r
- </goals>\r
- <configuration>\r
- <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64</outputDirectory>\r
- <resources>\r
- <resource>\r
- <directory>${basedir}/../-configuration</directory>\r
- <includes>\r
- <include>start-mediacube.sh</include>\r
- <include>stop-mediacube.sh</include>\r
- </includes>\r
- </resource>\r
- </resources>\r
- </configuration>\r
- </execution>\r
-\r
- </executions>\r
- </plugin>\r
-\r
</plugins>\r
</build>\r
\r
- <profiles>\r
- <profile>\r
- <id>full</id>\r
- <build>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.codehaus.mojo</groupId>\r
- <artifactId>exec-maven-plugin</artifactId>\r
- <version>1.5.0</version>\r
- <executions>\r
- <execution>\r
- <id>remote-deploy</id>\r
- <phase>deploy</phase>\r
- <goals>\r
- <goal>exec</goal>\r
- </goals>\r
- <configuration>\r
- <workingDirectory>${project.build.directory}</workingDirectory>\r
- <executable>winscp.com</executable>\r
- <arguments>\r
- <argument>/command</argument>\r
- <argument>"echo STARTING DEPLOY TO: ${remote.address}"</argument>\r
- <argument>"open ${remote.address} -hostkey=""${remote.hostkey}"""</argument>\r
- <argument>"call rm -rf ${remote.location}"</argument>\r
- <argument>"call mkdir ${remote.location}"</argument>\r
- <argument>"lcd ${local.location}"</argument>\r
- <argument>"cd ${remote.location}"</argument>\r
- <argument>"synchronize remote"</argument>\r
- <argument>"mkdir log"</argument>\r
- <argument>"mkdir tmp"</argument>\r
- <argument>"call chmod +w tmp"</argument>\r
- <argument>"call chmod +x mediacube"</argument>\r
- <argument>"call chmod +x start-mediacube.sh"</argument>\r
- <argument>"call chmod +x stop-mediacube.sh"</argument>\r
- <argument>"exit"</argument>\r
- </arguments>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin>\r
- </plugins>\r
- </build>\r
- </profile>\r
- <profile>\r
- <id>plugins</id>\r
- <build>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.codehaus.mojo</groupId>\r
- <artifactId>exec-maven-plugin</artifactId>\r
- <version>1.5.0</version>\r
- <executions>\r
- <execution>\r
- <id>remote-deploy</id>\r
- <phase>deploy</phase>\r
- <goals>\r
- <goal>exec</goal>\r
- </goals>\r
- <configuration>\r
- <workingDirectory>${project.build.directory}</workingDirectory>\r
- <executable>winscp.com</executable>\r
- <arguments>\r
- <argument>/command</argument>\r
- <argument>"echo STARTING DEPLOY TO: ${remote.address}"</argument>\r
- <argument>"open ${remote.address} -hostkey=""${remote.hostkey}"""</argument>\r
- <argument>"lcd ${local.location}/plugins"</argument>\r
- <argument>"cd ${remote.location}/plugins"</argument>\r
- <argument>"synchronize remote"</argument>\r
- <argument>"lcd ${local.location}/configuration"</argument>\r
- <argument>"cd ${remote.location}/configuration"</argument>\r
- <argument>"synchronize remote -filemask=config.ini"</argument>\r
- <argument>"exit"</argument>\r
- </arguments>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin>\r
- </plugins>\r
- </build>\r
-\r
- </profile>\r
- </profiles>\r
- <properties>\r
- <local.location>${project.build.directory}/products/MediaCube/linux/gtk/x86_64</local.location>\r
- </properties>\r
</project> \r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <relativePath>../-modules</relativePath>\r
+ <groupId>user.jobengine</groupId>\r
+ <artifactId>MediaCube</artifactId>\r
+ <version>1.0.0</version>\r
+ </parent>\r
+\r
+ <artifactId>user.jobengine.product</artifactId>\r
+ <packaging>eclipse-repository</packaging>\r
+\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.eclipse.tycho</groupId>\r
+ <artifactId>tycho-p2-repository-plugin</artifactId>\r
+ <version>${tycho.version}</version>\r
+ <configuration>\r
+ <includeAllDependencies>true</includeAllDependencies>\r
+ </configuration>\r
+ </plugin>\r
+ <plugin>\r
+ <groupId>org.eclipse.tycho</groupId>\r
+ <artifactId>tycho-p2-director-plugin</artifactId>\r
+ <version>${tycho.version}</version>\r
+ <executions>\r
+ <execution>\r
+ <id>materialize-products</id>\r
+ <goals>\r
+ <goal>materialize-products</goal>\r
+ </goals>\r
+ </execution>\r
+ <!-- <execution> -->\r
+ <!-- <id>archive-products</id> -->\r
+ <!-- <goals> -->\r
+ <!-- <goal>archive-products</goal> -->\r
+ <!-- </goals> -->\r
+ <!-- </execution> -->\r
+ </executions>\r
+ </plugin>\r
+ <plugin>\r
+ <groupId>org.apache.maven.plugins</groupId>\r
+ <artifactId>maven-resources-plugin</artifactId>\r
+ <version>2.7</version>\r
+ <executions>\r
+ <execution>\r
+ <id>copy-resources-1-lnx</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../-configuration</directory>\r
+ <includes>\r
+ <include>dsm.opt</include>\r
+ </includes>\r
+ </resource>\r
+ <resource>\r
+ <directory>${basedir}/../user.jobengine.executors/config</directory>\r
+ <includes>\r
+ <include>scheduledjobs.json</include>\r
+ </includes>\r
+ </resource>\r
+ <resource>\r
+ <directory>${basedir}</directory>\r
+ <includes>\r
+ <include>log4j2.xml</include>\r
+ </includes>\r
+ </resource>\r
+ <resource>\r
+ <directory>${basedir}/../-configuration</directory>\r
+ <includes>\r
+ <include>mediacube-auth.properties</include>\r
+ </includes>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>copy-resources-2-lnx</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/executors</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../user.jobengine.executors/config</directory>\r
+ <includes>\r
+ <include>config.xml</include>\r
+ </includes>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>copy-resources-3-lnx</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/executors</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../user.jobengine.executors/bin/user/jobengine/server/steps</directory>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>copy-resources-4-lnx</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/jobtemplates</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../user.jobengine.executors/jobtemplates</directory>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>copy-resources-5-lnx</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64/configuration/jetty/etc</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../-configuration/jetty-deploy/etc</directory>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>copy-resources-6-lnx</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../-configuration</directory>\r
+ <includes>\r
+ <include>start-mediacube.sh</include>\r
+ <include>stop-mediacube.sh</include>\r
+ </includes>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+\r
+ </executions>\r
+ </plugin>\r
+\r
+ </plugins>\r
+ </build>\r
+\r
+ <profiles>\r
+ <profile>\r
+ <id>full</id>\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.codehaus.mojo</groupId>\r
+ <artifactId>exec-maven-plugin</artifactId>\r
+ <version>1.5.0</version>\r
+ <executions>\r
+ <execution>\r
+ <id>remote-deploy</id>\r
+ <phase>deploy</phase>\r
+ <goals>\r
+ <goal>exec</goal>\r
+ </goals>\r
+ <configuration>\r
+ <workingDirectory>${project.build.directory}</workingDirectory>\r
+ <executable>winscp.com</executable>\r
+ <arguments>\r
+ <argument>/command</argument>\r
+ <argument>"echo STARTING DEPLOY TO: ${remote.address}"</argument>\r
+ <argument>"open ${remote.address} -hostkey=""${remote.hostkey}"""</argument>\r
+ <argument>"call rm -rf ${remote.location}"</argument>\r
+ <argument>"call mkdir ${remote.location}"</argument>\r
+ <argument>"lcd ${local.location}"</argument>\r
+ <argument>"cd ${remote.location}"</argument>\r
+ <argument>"synchronize remote"</argument>\r
+ <argument>"mkdir log"</argument>\r
+ <argument>"mkdir tmp"</argument>\r
+ <argument>"call chmod +w tmp"</argument>\r
+ <argument>"call chmod +x mediacube"</argument>\r
+ <argument>"call chmod +x start-mediacube.sh"</argument>\r
+ <argument>"call chmod +x stop-mediacube.sh"</argument>\r
+ <argument>"exit"</argument>\r
+ </arguments>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+ </profile>\r
+ <profile>\r
+ <id>plugins</id>\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.codehaus.mojo</groupId>\r
+ <artifactId>exec-maven-plugin</artifactId>\r
+ <version>1.5.0</version>\r
+ <executions>\r
+ <execution>\r
+ <id>remote-deploy</id>\r
+ <phase>deploy</phase>\r
+ <goals>\r
+ <goal>exec</goal>\r
+ </goals>\r
+ <configuration>\r
+ <workingDirectory>${project.build.directory}</workingDirectory>\r
+ <executable>winscp.com</executable>\r
+ <arguments>\r
+ <argument>/command</argument>\r
+ <argument>"echo STARTING DEPLOY TO: ${remote.address}"</argument>\r
+ <argument>"open ${remote.address} -hostkey=""${remote.hostkey}"""</argument>\r
+ <argument>"lcd ${local.location}/plugins"</argument>\r
+ <argument>"cd ${remote.location}/plugins"</argument>\r
+ <argument>"synchronize remote"</argument>\r
+ <argument>"lcd ${local.location}/configuration"</argument>\r
+ <argument>"cd ${remote.location}/configuration"</argument>\r
+ <argument>"synchronize remote -filemask=config.ini"</argument>\r
+ <argument>"exit"</argument>\r
+ </arguments>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+\r
+ </profile>\r
+ </profiles>\r
+ <properties>\r
+ <local.location>${project.build.directory}/products/MediaCube/linux/gtk/x86_64</local.location>\r
+ </properties>\r
+</project> \r
--- /dev/null
+#2021-02-06\r
+osgi.bundles=reference\:file\:cglib_2.2.2.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.core.jackson-annotations_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.core.jackson-core_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.core.jackson-databind_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.datatype.jackson-datatype-joda_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.jaxrs.jackson-jaxrs-base_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.dataformat.jackson-dataformat-yaml_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.module.jackson-module-jaxb-annotations_2.4.5.jar@4,\\r
+reference\:file\:com.ibm.db2.jcc_1.4.0.jar@4,\\r
+reference\:file\:com.ibm.nosql_4.19.26.jar@4,\\r
+reference\:file\:com.microsoft.sqlserver.sqljdbc_6.0.8112.100.jar@4,\\r
+reference\:file\:com.sun.jna_4.2.0.jar@4,\\r
+reference\:file\:groovy_3.0.3.jar@4,\\r
+reference\:file\:io.humble.video-arch-x86_64-pc-linux-gnu6_0.2.1.jar@4,\\r
+reference\:file\:io.humble.video-arch-x86_64-w64-mingw32_0.2.1.jar@4,\\r
+reference\:file\:io.humble.video-noarch_0.2.1.jar@4,\\r
+reference\:file\:javax.annotation-api_1.2.0.jar@4,\\r
+reference\:file\:javax.mail_1.5.0.b01.jar@4,\\r
+reference\:file\:javax.servlet-api_3.1.0.jar@4,\\r
+reference\:file\:javax.ws.rs-api_2.0.1.jar@4,\\r
+reference\:file\:jcifs_1.3.17.jar@4,\\r
+reference\:file\:joda-time_2.2.0.jar@4,\\r
+reference\:file\:junit_4.12.0.jar@4,\\r
+reference\:file\:org.apache.aries.spifly.dynamic.bundle_1.0.8.jar@4,\\r
+reference\:file\:org.apache.aries.util_1.0.0.jar@4,\\r
+reference\:file\:org.apache.commons.beanutils_1.8.3.jar@4,\\r
+reference\:file\:org.apache.commons.codec_1.6.0.v201305230611.jar@4,\\r
+reference\:file\:org.apache.commons.collections_3.2.2.v201511171945.jar@4,\\r
+reference\:file\:org.apache.commons.digester_3.2.0.jar@4,\\r
+reference\:file\:org.apache.commons.io_2.6.0.jar@4,\\r
+reference\:file\:org.apache.commons.lang_2.6.0.v201404270220.jar@4,\\r
+reference\:file\:org.apache.commons.net_3.6.0.jar@4,\\r
+reference\:file\:org.apache.felix.gogo.command_0.10.0.jar@4,\\r
+reference\:file\:org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@4,\\r
+reference\:file\:org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@4,\\r
+reference\:file\:org.apache.httpcomponents.httpclient_4.5.2.v20161115-1643.jar@4,\\r
+reference\:file\:org.apache.httpcomponents.httpcore_4.4.4.v20161115-1643.jar@4,\\r
+reference\:file\:org.apache.logging.log4j.api_2.8.2.jar@1\:start,\\r
+reference\:file\:org.apache.logging.log4j.core_2.8.2.jar@4,\\r
+reference\:file\:org.apache.logging.log4j.slf4j-impl_2.8.2.jar@4,\\r
+reference\:file\:org.apache.servicemix.bundles.quartz_2.3.0.2.jar@4,\\r
+reference\:file\:org.eclipse.equinox.common_3.8.0.v20160509-1230.jar@2\:start,\\r
+reference\:file\:org.eclipse.equinox.console_1.1.200.v20150929-1405.jar@4,\\r
+reference\:file\:org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar@1\:start,\\r
+reference\:file\:org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar@4,\\r
+reference\:file\:org.eclipse.equinox.util_1.0.500.v20130404-1337.jar@4,\\r
+reference\:file\:org.eclipse.jetty.client_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.deploy_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.http_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.io_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.osgi.boot_9.3.9.v20160517.jar@4\:start,\\r
+reference\:file\:org.eclipse.jetty.schemas_3.1.0.jar@4,\\r
+reference\:file\:org.eclipse.jetty.security_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.server_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.servlet_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.util_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.webapp_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.api_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.client_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.common_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.server_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.servlet_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.xml_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.osgi.services_3.2.100.v20100503.jar@4,\\r
+reference\:file\:org.hamcrest.core_1.3.0.v201303031735.jar@4,\\r
+reference\:file\:org.jboss.resteasy.client_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jboss.resteasy.jaxb-provider_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jboss.resteasy.jaxrs_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jboss.resteasy.jaxrs-api_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jmock_2.6.0.jar@4,\\r
+reference\:file\:org.jmock.junit4_2.6.0.jar@4,\\r
+reference\:file\:org.mybatis.mybatis_3.5.2.jar@4,\\r
+reference\:file\:org.objectweb.asm_5.1.0.v20160914-0701.jar@4,\\r
+reference\:file\:org.objectweb.asm.commons_5.0.1.v201404251740.jar@4,\\r
+reference\:file\:org.objectweb.asm.tree_5.1.0.v20160914-0701.jar@4,\\r
+reference\:file\:org.omnifaces_3.4.1.jar@4,\\r
+reference\:file\:org.slf4j.jcl_1.7.2.v20130115-1340.jar@4,\\r
+reference\:file\:slf4j.api_1.7.24.jar@4,\\r
+reference\:file\:slf4j.simple_1.7.2.jar@4,\\r
+reference\:file\:user.commons.log4j2_1.0.0.jar@4,\\r
+reference\:file\:user.commons.zk_8.0.3.jar@4,\\r
+reference\:file\:user.jobengine.osgi.commons_1.0.0.jar@4\:start,\\r
+reference\:file\:user.jobengine.osgi.db_1.0.0.jar@4,\\r
+reference\:file\:user.jobengine.osgi.server_1.0.0.jar@4,\\r
+reference\:file\:user.jobengine.osgi.services_1.0.0.jar@4,\\r
+reference\:file\:user.mediacube.gui_1.0.0.jar@4,\\r
+reference\:file\:user.mediacube.metadata_1.0.0.jar@4,\\r
+reference\:file\:user.tsm.client_1.2.0.jar@4\r
+equinox.use.ds=true\r
+osgi.bundles.defaultStartLevel=4\r
+osgi.framework=file\:plugins/org.eclipse.osgi_3.11.2.v20161107-1947.jar\r
-->
<Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
- <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.keyStorePath" deprecated="jetty.keystore" default="etc/localhost.jks"/></Set>
+ <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.keyStorePath" deprecated="jetty.keystore" default="localhost.jks"/></Set>
<Set name="KeyStorePassword"><Property name="jetty.sslContext.keyStorePassword" deprecated="jetty.keystore.password" default="password"/></Set>
<Set name="KeyStoreType"><Property name="jetty.sslContext.keyStoreType" default="JKS"/></Set>
<Set name="KeyStoreProvider"><Property name="jetty.sslContext.keyStoreProvider"/></Set>
<Set name="KeyManagerPassword"><Property name="jetty.sslContext.keyManagerPassword" deprecated="jetty.keymanager.password" default="password"/></Set>
- <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.trustStorePath" deprecated="jetty.truststore" default="etc/localhost.jks"/></Set>
+ <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.trustStorePath" deprecated="jetty.truststore" default="localhost.jks"/></Set>
<Set name="TrustStorePassword"><Property name="jetty.sslContext.trustStorePassword" deprecated="jetty.truststore.password" default="password"/></Set>
<Set name="TrustStoreType"><Property name="jetty.sslContext.trustStoreType"/></Set>
<Set name="TrustStoreProvider"><Property name="jetty.sslContext.trustStoreProvider"/></Set>
--- /dev/null
+:-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml ^\r
+\r
+\r
+@echo off\r
+if exist tmp rmdir tmp /s /q\r
+mkdir tmp\r
+java ^\r
+-Dclean ^\r
+-Dorg.eclipse.epp.logging.aeri.skipReports=true ^\r
+-Declipse.ignoreApp=true ^\r
+-Dosgi.noShutdown=true ^\r
+-Dlog4j.configurationFile=configuration/log4j2.xml ^\r
+-Djobengine.maestro.config=configuration/maestro.json ^\r
+-Djobengine.mediacube.config=configuration/mediacube.json ^\r
+-Djetty.home=configuration/jetty ^\r
+-Djetty.etc.config.urls=jetty.xml,jetty-ssl.xml,jetty-ssl-context.xml,jetty-http.xml,jetty-https.xml ^\r
+-Djava.io.tmpdir=tmp ^\r
+-Djobengine.jobsteps.root=jobs/executors ^\r
+-Djobengine.jobtemplates.root=jobs/templates ^\r
+-Djobengine.jobscheduling.config=jobs/schedules.json ^\r
+-Djobengine.jobsteps.config=jobs/executors.xml ^\r
+-Djobengine.jobsteps.groovy.root=jobs/steps ^\r
+-Djobengine.db.url=jdbc:db2://10.11.1.90:50000/mc ^\r
+-Djobengine.db.user=db2admin ^\r
+-Djobengine.db.password=password ^\r
+-Djobengine.db.loginTimeout=3 ^\r
+-Djobengine.nosql.db.url=jdbc:db2://10.11.1.90:50000/mc ^\r
+-Djobengine.nosql.db.user=db2admin ^\r
+-Djobengine.nosql.db.password=password ^\r
+-Djobengine.nosql.db.schema=test ^\r
+-Djobengine.nosql.db.loginTimeout=3 ^\r
+-Dnexio.disable=true ^\r
+-Djobengine.scheduledexecution.disabled=true ^\r
+-Djobengine.randomize.archives=false ^\r
+-Dgui.jobs.alternate.selector=true ^\r
+-Dmediacube.simplesearch=true ^\r
+-jar plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar ^\r
+-Xms512m ^\r
+-Xmx1024m ^\r
+-console 5555\r
--- /dev/null
+datasource:\r
+ mediacube:\r
+ url: jdbc:db2://10.11.1.90:50000/mc\r
+ user: db2admin\r
+ password: password\r
+ external-indexer: false\r
+ simple-search: true\r
+ login-timeout: 3\r
+ pool-size: 10\r
+ mediacube-nosql:\r
+ url: jdbc:db2://10.11.1.90:50000/mc\r
+ user: db2admin\r
+ password: password\r
+ schema: test\r
+ login-timeout: 3\r
+ nexio: \r
+ url: jdbc:db2://10.11.1.90:50000/mc\r
+ user: db2admin\r
+ password: password\r
+ hsm: \r
+ url: jdbc:db2://10.11.1.89:51500/tsmdb1\r
+ user: tsminst1\r
+ password: tsminst1\r
+ planair: \r
+ url: jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis;\r
+ user: MAM\r
+ password: VDani\r
+services:\r
+ ffmpeg:\r
+ execurable-location: /opt/ffmpeg/ffmpeg \r
+ peablebeach:\r
+ template-root: configuration/soap\r
+ mediacube:\r
+ proxy-root: /opt\r
+ nexio:\r
+ host: 10.10.1.55\r
+ collection-name: nexioclips\r
+ use-mos-gateway: true\r
+ disabled: true\r
+ octopus:\r
+ api:\r
+ address: http://10.10.1.11/api/v1\r
+ user: mama\r
+ password: napocska\r
+ rundowns-collection-name: rundowns\r
+ stories-collection-name: stories\r
+ folders-collection-name: storyfolders\r
+jobs:\r
+ nexio-track: false\r
+ randomize-archives: false\r
+ scheduled-execution: false\r
+ validate-transfers: false\r
+ copy-buffer-size: 32768\r
+ scheduled-execution-disabled: true\r
+ randomize-archives: false\r
+tsm:\r
+ randomize-archives: false \r
+ delimiter: /\r
+ node-name: JOBENGINE\r
+ fs-name: /JOBENGINE\r
+ alternate-fs-name: /JOBENGINE\r
+ hl-name: /JOBENGINE\r
+
\ No newline at end of file
--- /dev/null
+#2021-02-06\r
+osgi.bundles=reference\:file\:cglib_2.2.2.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.core.jackson-annotations_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.core.jackson-core_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.core.jackson-databind_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.datatype.jackson-datatype-joda_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.jaxrs.jackson-jaxrs-base_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.dataformat.jackson-dataformat-yaml_2.4.5.jar@4,\\r
+reference\:file\:com.fasterxml.jackson.module.jackson-module-jaxb-annotations_2.4.5.jar@4,\\r
+reference\:file\:com.ibm.db2.jcc_1.4.0.jar@4,\\r
+reference\:file\:com.ibm.nosql_4.19.26.jar@4,\\r
+reference\:file\:com.microsoft.sqlserver.sqljdbc_6.0.8112.100.jar@4,\\r
+reference\:file\:com.sun.jna_4.2.0.jar@4,\\r
+reference\:file\:groovy_3.0.3.jar@4,\\r
+reference\:file\:io.humble.video-arch-x86_64-pc-linux-gnu6_0.2.1.jar@4,\\r
+reference\:file\:io.humble.video-arch-x86_64-w64-mingw32_0.2.1.jar@4,\\r
+reference\:file\:io.humble.video-noarch_0.2.1.jar@4,\\r
+reference\:file\:javax.annotation-api_1.2.0.jar@4,\\r
+reference\:file\:javax.mail_1.5.0.b01.jar@4,\\r
+reference\:file\:javax.servlet-api_3.1.0.jar@4,\\r
+reference\:file\:javax.ws.rs-api_2.0.1.jar@4,\\r
+reference\:file\:jcifs_1.3.17.jar@4,\\r
+reference\:file\:joda-time_2.2.0.jar@4,\\r
+reference\:file\:junit_4.12.0.jar@4,\\r
+reference\:file\:org.apache.aries.spifly.dynamic.bundle_1.0.8.jar@4,\\r
+reference\:file\:org.apache.aries.util_1.0.0.jar@4,\\r
+reference\:file\:org.apache.commons.beanutils_1.8.3.jar@4,\\r
+reference\:file\:org.apache.commons.codec_1.6.0.v201305230611.jar@4,\\r
+reference\:file\:org.apache.commons.collections_3.2.2.v201511171945.jar@4,\\r
+reference\:file\:org.apache.commons.digester_3.2.0.jar@4,\\r
+reference\:file\:org.apache.commons.io_2.6.0.jar@4,\\r
+reference\:file\:org.apache.commons.lang_2.6.0.v201404270220.jar@4,\\r
+reference\:file\:org.apache.commons.net_3.6.0.jar@4,\\r
+reference\:file\:org.apache.felix.gogo.command_0.10.0.jar@4,\\r
+reference\:file\:org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@4,\\r
+reference\:file\:org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@4,\\r
+reference\:file\:org.apache.httpcomponents.httpclient_4.5.2.v20161115-1643.jar@4,\\r
+reference\:file\:org.apache.httpcomponents.httpcore_4.4.4.v20161115-1643.jar@4,\\r
+reference\:file\:org.apache.logging.log4j.api_2.8.2.jar@1\:start,\\r
+reference\:file\:org.apache.logging.log4j.core_2.8.2.jar@4,\\r
+reference\:file\:org.apache.logging.log4j.slf4j-impl_2.8.2.jar@4,\\r
+reference\:file\:org.apache.servicemix.bundles.quartz_2.3.0.2.jar@4,\\r
+reference\:file\:org.eclipse.equinox.common_3.8.0.v20160509-1230.jar@2\:start,\\r
+reference\:file\:org.eclipse.equinox.console_1.1.200.v20150929-1405.jar@4,\\r
+reference\:file\:org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar@1\:start,\\r
+reference\:file\:org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar@4,\\r
+reference\:file\:org.eclipse.equinox.util_1.0.500.v20130404-1337.jar@4,\\r
+reference\:file\:org.eclipse.jetty.client_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.deploy_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.http_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.io_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.osgi.boot_9.3.9.v20160517.jar@4\:start,\\r
+reference\:file\:org.eclipse.jetty.schemas_3.1.0.jar@4,\\r
+reference\:file\:org.eclipse.jetty.security_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.server_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.servlet_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.util_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.webapp_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.api_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.client_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.common_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.server_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.websocket.servlet_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.jetty.xml_9.3.9.v20160517.jar@4,\\r
+reference\:file\:org.eclipse.osgi.services_3.2.100.v20100503.jar@4,\\r
+reference\:file\:org.hamcrest.core_1.3.0.v201303031735.jar@4,\\r
+reference\:file\:org.jboss.resteasy.client_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jboss.resteasy.jaxb-provider_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jboss.resteasy.jaxrs_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jboss.resteasy.jaxrs-api_3.0.11.Final.jar@4,\\r
+reference\:file\:org.jmock_2.6.0.jar@4,\\r
+reference\:file\:org.jmock.junit4_2.6.0.jar@4,\\r
+reference\:file\:org.mybatis.mybatis_3.5.2.jar@4,\\r
+reference\:file\:org.objectweb.asm_5.1.0.v20160914-0701.jar@4,\\r
+reference\:file\:org.objectweb.asm.commons_5.0.1.v201404251740.jar@4,\\r
+reference\:file\:org.objectweb.asm.tree_5.1.0.v20160914-0701.jar@4,\\r
+reference\:file\:org.omnifaces_3.4.1.jar@4,\\r
+reference\:file\:org.slf4j.jcl_1.7.2.v20130115-1340.jar@4,\\r
+reference\:file\:slf4j.api_1.7.24.jar@4,\\r
+reference\:file\:slf4j.simple_1.7.2.jar@4,\\r
+reference\:file\:user.commons.log4j2_1.0.0.jar@4,\\r
+reference\:file\:user.commons.zk_8.0.3.jar@4,\\r
+reference\:file\:user.jobengine.osgi.commons_1.0.0.jar@4\:start,\\r
+reference\:file\:user.jobengine.osgi.db_1.0.0.jar@4,\\r
+reference\:file\:user.jobengine.osgi.server_1.0.0.jar@4,\\r
+reference\:file\:user.jobengine.osgi.services_1.0.0.jar@4,\\r
+reference\:file\:user.mediacube.gui_1.0.0.jar@4,\\r
+reference\:file\:user.mediacube.metadata_1.0.0.jar@4,\\r
+reference\:file\:user.tsm.client_1.2.0.jar@4\r
+equinox.use.ds=true\r
+osgi.bundles.defaultStartLevel=4\r
+osgi.framework=file\:plugins/org.eclipse.osgi_3.11.2.v20161107-1947.jar\r
</Array>
</Arg>
<Set name="host"><Property name="jetty.http.host" /></Set>
- <Set name="port"><Property name="jetty.http.port" default="80" /></Set>
+ <Set name="port"><Property name="jetty.http.port" default="8888" /></Set>
<Set name="idleTimeout"><Property name="jetty.http.idleTimeout" default="30000"/></Set>
</New>
</Arg>
-->
<Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
- <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.keyStorePath" deprecated="jetty.keystore" default="etc/localhost.jks"/></Set>
+ <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.keyStorePath" deprecated="jetty.keystore" default="localhost.jks"/></Set>
<Set name="KeyStorePassword"><Property name="jetty.sslContext.keyStorePassword" deprecated="jetty.keystore.password" default="password"/></Set>
<Set name="KeyStoreType"><Property name="jetty.sslContext.keyStoreType" default="JKS"/></Set>
<Set name="KeyStoreProvider"><Property name="jetty.sslContext.keyStoreProvider"/></Set>
<Set name="KeyManagerPassword"><Property name="jetty.sslContext.keyManagerPassword" deprecated="jetty.keymanager.password" default="password"/></Set>
- <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.trustStorePath" deprecated="jetty.truststore" default="etc/localhost.jks"/></Set>
+ <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.trustStorePath" deprecated="jetty.truststore" default="localhost.jks"/></Set>
<Set name="TrustStorePassword"><Property name="jetty.sslContext.trustStorePassword" deprecated="jetty.truststore.password" default="password"/></Set>
<Set name="TrustStoreType"><Property name="jetty.sslContext.trustStoreType"/></Set>
<Set name="TrustStoreProvider"><Property name="jetty.sslContext.trustStoreProvider"/></Set>
</Arg>
<Set name="host"><Property name="jetty.ssl.host" deprecated="jetty.host" /></Set>
- <Set name="port"><Property name="jetty.ssl.port" deprecated="ssl.port" default="443" /></Set>
+ <Set name="port"><Property name="jetty.ssl.port" deprecated="ssl.port" default="8443" /></Set>
<Set name="idleTimeout"><Property name="jetty.ssl.idleTimeout" deprecated="ssl.timeout" default="30000"/></Set>
<Set name="soLingerTime"><Property name="jetty.ssl.soLingerTime" deprecated="ssl.soLingerTime" default="-1"/></Set>
<Set name="acceptorPriorityDelta"><Property name="jetty.ssl.acceptorPriorityDelta" deprecated="ssl.acceptorPriorityDelta" default="0"/></Set>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<Configuration status="ERROR" monitorInterval="10">\r
+ <Properties>\r
+ <Property name="fileName">log/mediacube.log</Property>\r
+ <Property name="filePattern">/opt/log/$${date:yyyy-MM}/mediacube-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
+ <Property name="fileName.err">/opt/log/mediacube-err.log</Property>\r
+ <Property name="filePattern.err">/opt/log/$${date:yyyy-MM}/mediacube-err-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
+ </Properties>\r
+ <Appenders>\r
+ <Console name="Console" target="SYSTEM_OUT">\r
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %msg (%F:%L) %n" />\r
+ </Console>\r
+ </Appenders>\r
+ <Loggers>\r
+ <Root level="INFO">\r
+ <AppenderRef ref="Console" />\r
+ </Root>\r
+ <Logger name="org.quartz" level="ERROR" additivity="false" />\r
+ <Logger name="org.zkoss" level="ERROR" additivity="false" />\r
+</Loggers>\r
+</Configuration>
\ No newline at end of file
--- /dev/null
+{
+ "sourceStoreUri": {
+ "name": "Default",
+ "protocol": "LOCAL",
+ "uri": "/mnt/NLE",
+ "fileFilter": "*.mxf",
+ "showDirectories": true
+ },
+ "alternateSourceStoreUris":
+ [
+ {
+ "name": "NLE1",
+ "protocol": "LOCAL",
+ "uri": "/mnt/NLE/NLE1",
+ "fileFilter": "*.mxf",
+ "showDirectories": true
+ },
+ {
+ "name": "NLE2",
+ "protocol": "LOCAL",
+ "uri": "/mnt/NLE/NLE2",
+ "fileFilter": "*.mxf",
+ "showDirectories": true
+ },
+ {
+ "name": "NLE3",
+ "protocol": "LOCAL",
+ "uri": "/mnt/NLE/NLE3",
+ "fileFilter": "*.mxf",
+ "showDirectories": true
+ },
+ {
+ "name": "NLE4",
+ "protocol": "LOCAL",
+ "uri": "/mnt/NLE/NLE4",
+ "fileFilter": "*.mxf",
+ "showDirectories": true
+ },
+ {
+ "name": "POLC",
+ "protocol": "LOCAL",
+ "uri": "/mnt/POLC",
+ "fileFilter": "*.mxf",
+ "showDirectories": true
+ }
+ ],
+ "targets":
+ [
+ {
+ "name": "FINISHED_SHOWS",
+ "killDateDays": 7,
+ "storeUri": {
+ "protocol": "LOCAL",
+ "uri": "/mnt/PROMISE/FINISHED_SHOWS"
+ }
+ }
+ ]
+}
+
+
+
--- /dev/null
+{\r
+ "jobQueuePollInterval": 1000,\r
+ "topTypeFilters": [\r
+ {\r
+ "name": "Hír bejátszó",\r
+ "color": "RED200",\r
+ "icon": "ic_language_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Hír nyers",\r
+ "color": "RED100",\r
+ "icon": "ic_perm_camera_mic_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Visszarögzített",\r
+ "color": "BROWN100",\r
+ "icon": "ic_group_work_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Egyéb",\r
+ "color": "YELLOW200",\r
+ "icon": "ic_view_quilt_black_18dp.png"\r
+ }\r
+ ],\r
+ "bottomTypeFilters": [\r
+ {\r
+ "name": "Műsor",\r
+ "color": "TEAL200",\r
+ "icon": "ic_theaters_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Műsor nyers",\r
+ "color": "TEAL100",\r
+ "icon": "ic_invert_colors_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Promo",\r
+ "color": "INDIGO200",\r
+ "icon": "ic_picture_in_picture_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Promo nyers",\r
+ "color": "INDIGO100",\r
+ "icon": "ic_bug_report_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Reklám",\r
+ "color": "BLUE200",\r
+ "icon": "ic_picture_in_picture_alt_black_18dp.png"\r
+ },\r
+ {\r
+ "name": "Reklám nyers",\r
+ "color": "BLUE100",\r
+ "icon": "ic_settings_brightness_black_18dp.png"\r
+ }\r
+ ],\r
+ "authentication": {\r
+ "authEnabled": true,\r
+ "adHost": "intra.mediavivantis.hu",\r
+ "adNonSecurePort": 3268,\r
+ "adBaseDn": "DC=intra,DC=mediavivantis,DC=hu",\r
+ "adAdminMap": [\r
+ "G_MV_U_MUSZAK",\r
+ "G_MV_U_INGEST"\r
+ ],\r
+ "adSubmitterMap": [\r
+ "G_ECH_U_INFORMATIKUSOK",\r
+ "G_ECH_U_MUSZAKVEZETOK",\r
+ "ECH-ISILON-ADMINS"\r
+ ],\r
+ "adEditorMap": [\r
+ "G_ECH_U_INFORMATIKUSOK",\r
+ "G_ECH_U_MUSZAKVEZETOK",\r
+ "ECH-ISILON-ADMINS"\r
+ ],\r
+ "localAccounts": [\r
+ {\r
+ "user" : "user",\r
+ "password" : "5F4DCC3B5AA765D61D8327DEB882CF99",\r
+ "email" : null\r
+ },\r
+ {\r
+ "user" : "lebony",\r
+ "password" : "4E25B117B14D86D7DCECB4E433CF932C",\r
+ "email" : null\r
+ },\r
+ {\r
+ "user" : "root",\r
+ "password" : "5F4DCC3B5AA765D61D8327DEB882CF99",\r
+ "email" : "vasary@elgekko.net"\r
+ }\r
+ ],\r
+ "localAdmins": [\r
+ "root",\r
+ "admin"\r
+ ],\r
+ "localSubmitters": [\r
+ "lebony"\r
+ ],\r
+ "localEditors": [\r
+ "editor"\r
+ ]\r
+ }\r
+}\r
+\r
+\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<executors>\r
+ <executor className="CancelableStep.java" maxConcurrent="10" isRemote="true" />\r
+ <executor className="TestForkCancelableStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="ArchiveRecursive.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="ArchiveListBuilderStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="ArchiveMaterialSubmitStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="BatchRetrieveForkStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="CleanupMountedLocationStep.java" maxConcurrent="5" isRemote="false" />\r
+ <executor className="CreateArchiveItemStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="CreateMissingLowresStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="FileCopyStep.java" maxConcurrent="20" isRemote="false" />\r
+ <executor className="HSMMigrateStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="MediaToolStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="MetadataTransformStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="MXFCutterStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="OutputPathAndNameSelectorStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="TranscodeFFAStranStep.java" maxConcurrent="2" isRemote="false" />\r
+ <executor className="TSMBackupStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="TSMExtendedRetrieveStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="TSMRestoreStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="TSMSimpleRestoreStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="UpdateGhostMediaDataStep.java" maxConcurrent="1" isRemote="false" />\r
+</executors>
\ No newline at end of file
--- /dev/null
+{"joblist":[\r
+ {\r
+ "active": false,\r
+ "executeimmediate": false,\r
+ "name" : "Rekurzív archiválás a POLC/FINISHED_SHOWS mappából",\r
+ "template": "archive-recursive.xml",\r
+ "cronexpression": "0 */1 * * * ?",\r
+ "parameters": [ \r
+ {"name": "sourcePath", "value": "/mnt/POLC/FINISHED_SHOWS", "type": "java.lang.String"},\r
+ {"name": "killDateDays", "value": 1, "type": "java.lang.Integer"},\r
+ {"name": "limit", "value": 1, "type": "java.lang.Integer"}\r
+ ]\r
+ },\r
+ {\r
+ "active": false,\r
+ "executeimmediate": false,\r
+ "name" : "Párhuzamosított teszt folyamat",\r
+ "template": "fake-noparams.xml",\r
+ "cronexpression": "0 40 22 * * ?",\r
+ "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ]\r
+ },\r
+ {\r
+ "template": "cancelable.xml",\r
+ "parameters": [ {"name": "param", "value": 1, "type": "java.lang.Integer"} ]\r
+ }, \r
+ {\r
+ "active": false,\r
+ "executeimmediate": false,\r
+ "name" : "HSM migrálás",\r
+ "template": "migrate-hsm.xml",\r
+ "cronexpression": "0 0 */1 * * ?",\r
+ "parameters": [ \r
+ {"name": "sourceLocation", "value": "", "type": "java.lang.String"},\r
+ {"name": "targetLocation", "value": "/mediacube/data/ARCHIVE", "type": "java.lang.String"}\r
+ ]\r
+ },\r
+ {\r
+ "active": false,\r
+ "executeimmediate": true,\r
+ "name" : "Limitált archiválás az PROMISE/ARCHIVE mappából",\r
+ "template": "archive-limited.xml",\r
+ "cronexpression": "0 */10 * * * ?",\r
+ "parameters": [ \r
+ {"name": "sourcePath", "value": "/mnt/PROMISE/ARCHIVE", "type": "java.lang.String"},\r
+ {"name": "globalSourcePath", "value": "\\\\10.11.1.100\\PROMISE\\ARCHIVE", "type": "java.lang.String"},\r
+ {"name": "transcoderTargetPath", "value": "/mnt/PROMISE/TRANSCODER/FFASTRANSCODER/Out", "type": "java.lang.String"},\r
+ {"name": "killDateDays", "value": -1, "type": "java.lang.Integer"},\r
+ {"name": "limit", "value": 10, "type": "java.lang.Integer"}\r
+ ]\r
+ },\r
+ {\r
+ "active": false,\r
+ "executeimmediate": true,\r
+ "name" : "Limitált archiválás a /mediacube/data/ARCHIVE mappából",\r
+ "template": "archive-limited.xml",\r
+ "cronexpression": "0 */10 * * * ?",\r
+ "parameters": [ \r
+ {"name": "sourcePath", "value": "/mediacube/data/ARCHIVE", "type": "java.lang.String"},\r
+ {"name": "globalSourcePath", "value": "\\\\10.11.1.90\\data\\ARCHIVE", "type": "java.lang.String"},\r
+ {"name": "transcoderTargetPath", "value": "/mnt/PROMISE/TRANSCODER/FFASTRANSCODER/Out", "type": "java.lang.String"},\r
+ {"name": "killDateDays", "value": -1, "type": "java.lang.Integer"},\r
+ {"name": "limit", "value": 1000, "type": "java.lang.Integer"}\r
+ ]\r
+ },\r
+ {\r
+ "active": true,\r
+ "executeimmediate": true,\r
+ "name" : "Lejárt /mediacube/data/ARCHIVE anyagok törlése",\r
+ "template": "delete-materials.xml",\r
+ "cronexpression": "0 */10 * * * ?",\r
+ "parameters": [ \r
+ {"name": "sourcePath", "value": "/mediacube/data/ARCHIVE", "type": "java.lang.String"}\r
+ ]\r
+ }, \r
+ {\r
+ "active": false,\r
+ "executeimmediate": true,\r
+ "name" : "Lejárt /mediacube/data/OMARCHIVE anyagok törlése",\r
+ "template": "delete-materials.xml",\r
+ "cronexpression": "0 */10 * * * ?",\r
+ "parameters": [ \r
+ {"name": "sourcePath", "value": "/mediacube/data/OMARCHIVE", "type": "java.lang.String"}\r
+ ]\r
+ }, \r
+ {\r
+ "active": true,\r
+ "executeimmediate": true,\r
+ "name" : "Lejárt /PROMISE/ARCHIVE anyagok törlése",\r
+ "template": "delete-materials.xml",\r
+ "cronexpression": "0 */10 * * * ?",\r
+ "parameters": [ \r
+ {"name": "sourcePath", "value": "/mnt/PROMISE/ARCHIVE", "type": "java.lang.String"}\r
+ ]\r
+ }, \r
+ {\r
+ "active": false,\r
+ "executeimmediate": false,\r
+ "name" : "Lejárt /POLC/FINISHED_SHOWS anyagok törlése",\r
+ "template": "delete-materials.xml",\r
+ "cronexpression": "0 * 11 * * ?",\r
+ "parameters": [ \r
+ {"name": "sourcePath", "value": "/mnt/POLC/FINISHED_SHOWS", "type": "java.lang.String"}\r
+ ]\r
+ }, \r
+ {\r
+ "active": true,\r
+ "executeimmediate": true,\r
+ "name" : "Proxy generálás",\r
+ "template": "sys-recreate-lowres.xml",\r
+ "cronexpression": "0 */1 * * * ?",\r
+ "parameters": [ \r
+ {"name": "globalRetrievePath", "value": "file://10.11.1.90/data", "type": "java.lang.String"},\r
+ {"name": "localRetrievePath", "value": "/mediacube/data", "type": "java.lang.String"},\r
+ {"name": "localHiresPath", "value": "/mediacube/data", "type": "java.lang.String" },\r
+ {"name": "globalHiresPath", "value": "\\\\10.11.1.90\\data", "type": "java.lang.String" },\r
+ {"name": "localLowresPath", "value": "/mediacube/data/TRANSCODER_OUT", "type": "java.lang.String" },\r
+ {"name": "transcoderAddress", "value": "http://10.11.1.111:65445/api/json/v1/", "type": "java.lang.String"},\r
+ {"name": "transcoderTemplateName", "value": "MP4", "type": "java.lang.String"}\r
+ ]\r
+ },\r
+ {\r
+ "name" : "SYS: batch-retrieve-ondemand",\r
+ "template": "batch-retrieve-ondemand.xml",\r
+ "active": false,\r
+ "executeimmediate": false\r
+ },\r
+ {\r
+ "name" : "SYS: retrieve-ondemand",\r
+ "template": "retrieve-ondemand.xml",\r
+ "active": false,\r
+ "executeimmediate": false,\r
+ "parameters": [ \r
+ {"name": "globalRetrievePath", "value": "file://10.11.1.100", "type": "java.lang.String"},\r
+ {"name": "localRetrievePath", "value": "/mnt/PROMISE/", "type": "java.lang.String"},\r
+ {"name": "materialOutputFolder", "value": "PLAYOUT_NLE", "type": "java.lang.String"},\r
+ {"name": "promoOutputFolder", "value": "PROMO_NLE", "type": "java.lang.String"},\r
+ {"name": "advertisementOutputFolder", "value": "REKLAM_NLE", "type": "java.lang.String"},\r
+ {"name": "octopusOutputFolder", "value": "OCTOPUS", "type": "java.lang.String"},\r
+ {"name": "genericOutputFolder", "value": "ARCHIVE_RESTORE", "type": "java.lang.String"},\r
+ {"name": "onlineOutputFolder", "value": "ONLINE", "type": "java.lang.String"},\r
+ {"name": "killDateDays", "value": 7, "type": "java.lang.Integer"},\r
+ {"name": "nexioAgency", "value": "ARCHIVE_RESTORE", "type": "java.lang.String"},\r
+ {"name": "nexioPort", "value": 2098, "type": "java.lang.Integer"},\r
+ {"name": "nexioUserName", "value": "administrator", "type": "java.lang.String"},\r
+ {"name": "nexioPassword", "value": "system", "type": "java.lang.String"}\r
+ ]\r
+ },\r
+ {\r
+ "name" : "SYS: common-copy",\r
+ "template": "common-copy.xml",\r
+ "active": false,\r
+ "executeimmediate": false\r
+ },\r
+ {\r
+ "template": "create-lowres-ondemand.xml",\r
+ "active": false,\r
+ "executeimmediate": false,\r
+ "parameters": [ \r
+ {"name": "globalRetrievePath", "value": "file://10.11.1.90/data", "type": "java.lang.String"},\r
+ {"name": "localRetrievePath", "value": "/mediacube/data", "type": "java.lang.String"},\r
+ {"name": "localHiresPath", "value": "/mediacube/data", "type": "java.lang.String" },\r
+ {"name": "globalHiresPath", "value": "\\\\10.11.1.90\\data", "type": "java.lang.String" },\r
+ {"name": "localLowresPath", "value": "/mediacube/data/TRANSCODER_OUT", "type": "java.lang.String" },\r
+ {"name": "transcoderAddress", "value": "http://10.11.1.111:65445/api/json/v1/", "type": "java.lang.String"},\r
+ {"name": "transcoderTemplateName", "value": "MP4", "type": "java.lang.String"}\r
+ ]\r
+ },\r
+ \r
+]}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.nio.file.DirectoryStream;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.util.LinkedList;\r
+import java.util.List;\r
+\r
+import org.apache.commons.lang.StringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+/**\r
+ * Az archivalhato mediak listazasa MediaFileWrapper objektumokban. A listazott media allomanyokat megjeloli .catched signal allomannyal, hogy a legkozelebbi\r
+ * listazas figyelmen kivul hagyja.\r
+ *\r
+ * @author robi\r
+ */\r
+public class ArchiveListBuilderStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ // private static final String UTF8 = "utf-8";\r
+ private static final String STATUSFOLDER = ".STATUS";\r
+ private static final String JSONEXT = ".json";\r
+ private static final String CATCHEDEXT = ".catched";\r
+\r
+ public static final String ITEM_TITLE = "itemTitle";\r
+ public static final String ITEM_HOUSEID = "itemHouseId";\r
+ public static final String ITEM_DESCRIPTION = "itemDescription";\r
+ public static final String MEDIA_HOUSEID = "mediaHouseId";\r
+ public static final String MEDIA_TITLE = "mediaTitle";\r
+ public static final String MEDIA_DESCRIPTION = "mediaDescription";\r
+ public static final String MEDIA_TYPE = "mediaType";\r
+ private static final String DURATION = "duration";\r
+ private static final String EXISTING_MEDIAID = "existingMediaId";\r
+ private static final String TAGS = "tags";\r
+\r
+ private Marker marker;\r
+\r
+ private ArchiveItem createArchiveItem(Path jsonFilePath, Path mediaFilePath, Path catchedFilePath) {\r
+ ArchiveItem result = null;\r
+ try {\r
+ result = ArchiveItem.fromFile(jsonFilePath);\r
+ result.setMediaFile(mediaFilePath.toString());\r
+ result.setCatchedFile(catchedFilePath.toString());\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+ private void createCatchedFile(Path catchedFilePath) {\r
+ try {\r
+ Files.createFile(catchedFilePath);\r
+ //Files.write(catchedFilePath, CATCHED.getBytes(UTF8), StandardOpenOption.CREATE);\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(String sourcePath, int limit, IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
+ marker = jobRuntime.getSessionMarker();\r
+ List<ArchiveItem> archiveList = new LinkedList<ArchiveItem>();\r
+ DirectoryStream<Path> directoryStream = null;\r
+ try {\r
+ DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(sourcePath));\r
+ for (Path p : stream) {\r
+ processPathItem(p, archiveList);\r
+ }\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ logger.error(marker, "Az '{}' mappa elérése sikertelen. A rendszer hibaüzenete: {}", e.getMessage());\r
+ } finally {\r
+ if (directoryStream != null) {\r
+ try {\r
+ directoryStream.close();\r
+ } catch (IOException e) {\r
+ }\r
+ }\r
+ }\r
+\r
+ if (limit > 0 && archiveList.size() > limit) {\r
+ archiveList = archiveList.subList(0, limit);\r
+ logger.info(marker, "A folyamat alkalmazza a beállított {} limitet.", limit);\r
+ }\r
+\r
+ if (archiveList.size() == 0)\r
+ logger.info(marker, "Nincs archiválandó anyag.");\r
+ else\r
+ logger.info(marker, "Az archiváló folyamat {} új anyagot érzékelt.", archiveList == null ? 0 : archiveList.size());\r
+\r
+ for (ArchiveItem archiveItem : archiveList) {\r
+ createCatchedFile(Paths.get(archiveItem.getCatchedFile()));\r
+ }\r
+\r
+ return new Object[] { archiveList };\r
+ }\r
+\r
+ private boolean processPathItem(Path mediaFilePath, final List<ArchiveItem> archiveList) {\r
+ File mediaFile = mediaFilePath.toFile();\r
+\r
+ // if (mediaFile.length() > 0)\r
+ // return false;\r
+\r
+ if (mediaFile.isDirectory()) {\r
+ return false;\r
+ }\r
+\r
+ Path dotStorePath = Paths.get(mediaFilePath.getParent().toString(), STATUSFOLDER);\r
+ Path catchedFilePath = Paths.get(dotStorePath.toString(), mediaFile.getName() + CATCHEDEXT);\r
+ File catchedFile = catchedFilePath.toFile();\r
+ if (catchedFile.exists()) {\r
+ logger.warn("{} file is already catched.", mediaFile.getName());\r
+ return false;\r
+ }\r
+\r
+ Path jsonFilePath = Paths.get(dotStorePath.toString(), mediaFile.getName() + JSONEXT);\r
+ File jsonFile = jsonFilePath.toFile();\r
+ if (!jsonFile.exists()) {\r
+ logger.warn("{} has no json metadata.", mediaFile.getName());\r
+ return false;\r
+ }\r
+\r
+ ArchiveItem archiveItem = createArchiveItem(jsonFilePath, mediaFilePath, catchedFilePath);\r
+\r
+ if (archiveItem == null) {\r
+ logger.warn("{} has no metadata specified.", mediaFile.getName());\r
+ return false;\r
+ }\r
+\r
+ if (StringUtils.isBlank(archiveItem.getItemHouseId())) {\r
+ logger.warn("{} has no Item HouseID specified in metadata.", mediaFile.getName());\r
+ return false;\r
+ }\r
+\r
+ if (StringUtils.isBlank(archiveItem.getItemTitle())) {\r
+ logger.warn("{} has no Item Title specified in metadata.", mediaFile.getName());\r
+ return false;\r
+ }\r
+\r
+ if (StringUtils.isBlank(archiveItem.getMediaHouseId())) {\r
+ logger.warn("{} has no Media HouseID specified in metadata.", mediaFile.getName());\r
+ return false;\r
+ }\r
+\r
+ if (StringUtils.isBlank(archiveItem.getMediaTitle())) {\r
+ logger.warn("{} has no Media Title specified in metadata.", mediaFile.getName());\r
+ return false;\r
+ }\r
+\r
+ //A tenyleges archivalast vesszuk elore\r
+ if (mediaFile.length() == 0)\r
+ archiveList.add(archiveItem);\r
+ else\r
+ archiveList.add(0, archiveItem);\r
+ //createCatchedFile(catchedFilePath);\r
+ return true;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.util.List;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.commons.ListUtils;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class ArchiveMaterialSubmitStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private static final String JOBTEMPLATE = "archive-material.xml";\r
+ private static final String KILL_DATE_DAYS = "killDateDays";\r
+ private static final String ARCHIVE = "Archiválás";\r
+ private static final String ARCHIVE_ITEM = "archiveItem";\r
+ private Marker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(List<ArchiveItem> archiveList, int killDateDays, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ marker = jobRuntime.getSessionMarker();\r
+ if (archiveList == null || archiveList.size() == 0)\r
+ return null;\r
+\r
+ if (jobRuntime.forkPrepare()) {\r
+ for (int i = 0; i < archiveList.size(); i++) {\r
+ ArchiveItem archiveItem = archiveList.get(i);\r
+ try {\r
+ IJobRuntime runtime = jobEngine.submit(jobRuntime, null, JOBTEMPLATE, ARCHIVE,\r
+ ListUtils.asMap(ARCHIVE_ITEM, archiveItem, KILL_DATE_DAYS, killDateDays));\r
+ setProgress((i + 1) * 100 / archiveList.size());\r
+ //TODO kivezetni a submit hibaüzenetet\r
+ if (runtime == null)\r
+ throw new Exception("Submit returned null runtime");\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ String fileName = new File(archiveItem.getMediaFile()).getName();\r
+ logger.error(marker, "Az '{}' állomány archiválási kísérlete sikertelen. A rendszer üzenete: {}", fileName, e.getMessage());\r
+ if (!archiveItem.removeCatchedFile())\r
+ logger.error(marker, "Az '{}' állomány .catched jelző állománya nem törölhető.", fileName);\r
+ throw e;\r
+ }\r
+ }\r
+ }\r
+ jobRuntime.forkWaitComplete();\r
+ return null;\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.nio.file.FileVisitResult;\r
+import java.nio.file.FileVisitor;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.nio.file.attribute.BasicFileAttributes;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Arrays;\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import org.apache.commons.io.FilenameUtils;\r
+import org.apache.commons.lang.StringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import com.ibm.nosql.json.api.BasicDBObject;\r
+\r
+import user.commons.JobStatus;\r
+import user.commons.ListUtils;\r
+import user.commons.mediatool.MediaInfo;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+import user.mediacube.metadata.interfaces.IMetadata;\r
+import user.mediacube.metadata.interfaces.IMetadataProvider;\r
+import user.mediacube.metadata.interfaces.IMetadataProviderFactory;\r
+import user.mediacube.metadata.interfaces.MetadataProviderType;\r
+import user.mediacube.metadata.interfaces.MetadataType;\r
+import user.mediacube.metadata.interfaces.PlanAirMetadataListOptions;\r
+\r
+public class ArchiveRecursive extends JobStep implements FileVisitor<Path> {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private static final String JOBTEMPLATE = "archive-material.xml";\r
+ private static final String ITEM_TITLE = "itemTitle";\r
+ private static final String ITEM_HOUSEID = "itemHouseId";\r
+ private static final String MEDIA_HOUSEID = "mediaHouseId";\r
+ private static final String MEDIA_TITLE = "mediaTitle";\r
+ private static final String MEDIA_DESCRIPTION = "mediaDescription";\r
+ private static final String MEDIA_TYPE = "mediaType";\r
+ private static final String ARCHIVE = "Archiválás";\r
+ private static final String ARCHIVE_ITEM = "archiveItem";\r
+ private static final String KILL_DATE_DAYS = "killDateDays";\r
+ private SimpleDateFormat df = new SimpleDateFormat("yyyy.MM.dd");\r
+\r
+ private List<String> skipPathNames = Arrays.asList("!ARCHIVALAS_ALATT", "VASAROLT", EscortFiles.STATUSFOLDER, EscortFiles.CONFLICTFOLDER);\r
+ private int limit;\r
+ private int submitted;\r
+ private int killDateDays;\r
+\r
+ private boolean canReadMediaInfo(Path mediaFilePath) {\r
+ boolean result = false;\r
+ try {\r
+ MediaInfo mi = new MediaInfo(mediaFilePath);\r
+ mi.process();\r
+ result = true;\r
+ } catch (Exception e) {\r
+ logger.warn(getSessionMarker(), e.getMessage());\r
+ }\r
+ return result;\r
+ }\r
+\r
+ private void checkArchiveItem(ArchiveItem archiveItem, Path mediaPath) throws Exception {\r
+ if (archiveItem == null)\r
+ throw new Exception(mediaPath + " has no metadata specified.");\r
+\r
+ if (StringUtils.isBlank(archiveItem.getItemHouseId()))\r
+ throw new Exception(mediaPath + " has no Item HouseID specified in metadata.");\r
+\r
+ if (StringUtils.isBlank(archiveItem.getItemTitle()))\r
+ throw new Exception(mediaPath + " has no Item Title specified in metadata.");\r
+\r
+ if (StringUtils.isBlank(archiveItem.getMediaHouseId()))\r
+ throw new Exception(mediaPath + " has no Media HouseID specified in metadata.");\r
+\r
+ if (StringUtils.isBlank(archiveItem.getMediaTitle()))\r
+ throw new Exception(mediaPath + " has no Media Title specified in metadata.");\r
+ }\r
+\r
+ private ArchiveItem createArchiveItem(Path filePath) throws Exception {\r
+ ArchiveItem result = null;\r
+\r
+ String fileName = filePath.getFileName().toString();\r
+ String mediaHouseId = FilenameUtils.removeExtension(fileName);\r
+ try {\r
+ result = getPlanAirMetadata(mediaHouseId);\r
+ } catch (Exception e) {\r
+\r
+ logger.error("PlanAir metadata error", e);\r
+ //nem latja a drivert pl.\r
+ throw e;\r
+ }\r
+\r
+ if (result == null) {\r
+ result = new ArchiveItem();\r
+ BasicFileAttributes attr = Files.readAttributes(filePath, BasicFileAttributes.class);\r
+ result.setItemHouseId(df.format(attr.lastModifiedTime().toMillis()));\r
+ result.setItemTitle(filePath.getParent().toString());\r
+ result.setMediaHouseId(mediaHouseId);\r
+ result.setMediaTitle(fileName);\r
+ //TODO kesobb kivenni\r
+ //result.setMediaDescription("/OMARCHIVE");\r
+ result.setMediaType("Generic");\r
+ }\r
+\r
+ result.setMediaFile(filePath.toString());\r
+ return result;\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(String sourcePath, int killDateDays, int limit) throws Exception {\r
+ this.killDateDays = killDateDays;\r
+ this.limit = limit;\r
+ try {\r
+ if (getJobRuntime().forkPrepare()) {\r
+ Files.walkFileTree(Paths.get(sourcePath), this);\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error(getSessionMarker(), "Az '{}' mappa elérése sikertelen. A rendszer hibaüzenete: {}", sourcePath, e.getMessage());\r
+ } finally {\r
+ if (submitted > 0)\r
+ getJobRuntime().forkWaitComplete();\r
+ else\r
+ getJobRuntime().cancelForkPrepare();\r
+\r
+ }\r
+ return null;\r
+ }\r
+\r
+ private ArchiveItem getPlanAirMetadata(String mediaHouseId) throws Exception {\r
+ PlanAirMetadataListOptions opt = new PlanAirMetadataListOptions();\r
+ opt.setSearch(mediaHouseId);\r
+ opt.setType(MetadataType.Material);\r
+\r
+ BasicDBObject json = null;\r
+ List<IMetadata> data = null;\r
+\r
+ IMetadataProviderFactory factory = getService(IMetadataProviderFactory.class);\r
+ IMetadataProvider planairProvider = factory.getProvider(MetadataProviderType.PLANAIR);\r
+\r
+ ArchiveItem result = null;\r
+ data = planairProvider.list(opt);\r
+ if (data.size() != 0)\r
+ json = data.get(0).asJSON();\r
+ else {\r
+ opt.setType(MetadataType.Promo);\r
+ data = planairProvider.list(opt);\r
+ if (data.size() != 0)\r
+ json = data.get(0).asJSON();\r
+ else {\r
+ opt.setType(MetadataType.AD);\r
+ data = planairProvider.list(opt);\r
+ if (data.size() != 0)\r
+ json = data.get(0).asJSON();\r
+ }\r
+ }\r
+ if (json != null) {\r
+ result = new ArchiveItem();\r
+ result.setItemHouseId(json.getString(ITEM_HOUSEID));\r
+ result.setItemTitle(json.getString(ITEM_TITLE));\r
+ result.setMediaHouseId(json.getString(MEDIA_HOUSEID));\r
+ result.setMediaTitle(json.getString(MEDIA_TITLE));\r
+ result.setMediaDescription(json.getString(MEDIA_DESCRIPTION));\r
+ result.setMediaType(json.getString(MEDIA_TYPE));\r
+ }\r
+ return result;\r
+ }\r
+\r
+ private boolean handleArchiveConflict(Path mediaPath) throws Exception {\r
+ boolean result = false;\r
+ String sourceFileName = mediaPath.getFileName().toString();\r
+ if (getManager().isMediaFileExists(sourceFileName)) {\r
+ EscortFiles.createMediaCatch(mediaPath);\r
+ result = true;\r
+\r
+ // try {\r
+ // Path parent = sourcePath.getParent();\r
+ // Path conflictPath = Paths.get(parent.toString(), CONFLICT);\r
+ // File folder = conflictPath.toFile();\r
+ // if (!folder.exists() || !folder.isDirectory()) {\r
+ // Set<PosixFilePermission> perms = PosixFilePermissions.fromString("rwxrwxrwx");\r
+ // FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);\r
+ // try {\r
+ // Files.createDirectories(conflictPath, attr);\r
+ // } catch (Exception e) {\r
+ // try {\r
+ // Files.createDirectory(conflictPath);\r
+ // } catch (Exception e1) {\r
+ // logger.catching(e);\r
+ // throw e;\r
+ // }\r
+ // }\r
+ // }\r
+ //\r
+ // Path conflictFile = Paths.get(conflictPath.toString(), sourceFileName);\r
+ // if (conflictFile.toFile().exists())\r
+ // conflictFile = Paths.get(conflictPath.toString(), sourceFileName + (new Date()).getTime());\r
+ // Files.move(sourcePath, conflictFile);\r
+ // result = true;\r
+ // } catch (Exception e1) {\r
+ // logger.error(getSessionMarker(), "Hiba az '{}' állomány mappába mozgatásakor. A rendszer üzenete: {}", CONFLICT, e1.getMessage());\r
+ // }\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult postVisitDirectory(Path paramT, IOException paramIOException) throws IOException {\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes paramBasicFileAttributes) throws IOException {\r
+ Path dirName = dir.getFileName();\r
+ logger.info("PreVisit {}", dir);\r
+\r
+ if (skipPathNames.contains(dirName.toString()))\r
+ return FileVisitResult.SKIP_SUBTREE;\r
+ else\r
+ logger.info("PreVisit {}", dir);\r
+\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+\r
+ private boolean processPathItem(Path mediaPath) throws Exception {\r
+ if (submitted == limit)\r
+ return false;\r
+\r
+ // if (!"Transfered".equals(mediaPath.getParent().getFileName().toString()))\r
+ // return false;\r
+\r
+ if (mediaPath.getFileName().toString().startsWith("."))\r
+ return false;\r
+\r
+ File mediaFile = mediaPath.toFile();\r
+ if (mediaFile.isDirectory())\r
+ return false;\r
+\r
+ if (EscortFiles.isMediaCatched(mediaPath))\r
+ return false;\r
+\r
+ if (handleArchiveConflict(mediaPath))\r
+ return false;\r
+\r
+ if (!canReadMediaInfo(mediaPath))\r
+ return false;\r
+\r
+ ArchiveItem archiveItem = createArchiveItem(mediaPath);\r
+\r
+ try {\r
+ checkArchiveItem(archiveItem, mediaPath);\r
+ submitted++;\r
+\r
+ Map<String, Object> parameters = ListUtils.asMap(ARCHIVE_ITEM, archiveItem, KILL_DATE_DAYS, killDateDays);\r
+ IJobRuntime runtime = getEngine().submit(getJobRuntime(), e -> {\r
+ if (e.getStatus().equals(JobStatus.CANCELED) || e.getStatus().equals(JobStatus.SUSPENDED))\r
+ EscortFiles.removeMediaCatch(mediaPath);\r
+ }, JOBTEMPLATE, ARCHIVE, 1, IJobEngine.DEFAULT_OWNER, parameters);\r
+ if (runtime == null)\r
+ throw new Exception("Submit returned null runtime");\r
+ runtime.setRelated(mediaPath.toString());\r
+ EscortFiles.createMediaCatch(mediaPath);\r
+ } catch (Exception e) {\r
+ String fileName = new File(archiveItem.getMediaFile()).getName();\r
+ logger.error(getSessionMarker(), "Az '{}' állomány archiválási kísérlete sikertelen. A rendszer üzenete: {}", fileName, e.getMessage());\r
+ }\r
+\r
+ return true;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult visitFile(Path filePath, BasicFileAttributes paramBasicFileAttributes) throws IOException {\r
+ //logger.info("Will archived {}", filePath);\r
+ try {\r
+ processPathItem(filePath);\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult visitFileFailed(Path filePath, IOException paramIOException) throws IOException {\r
+ logger.info("Error archive {}", filePath);\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.MediaCubeFinishMarker;\r
+import user.commons.MediaCubeMarker;\r
+import user.jobengine.db.ArchivedMedia;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+import user.jobengine.server.scheduler.ScheduledJob;\r
+\r
+public class BatchRetrieveForkStep extends JobStep {\r
+ private static final String TARGET_PATH_TYPE = "targetPathType";\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private static final String CHILD_TEMPLATE = "retrieve-ondemand.xml";\r
+ private static final String ARCHIVEDMEDIA = "archivedMedia";\r
+ private static final String RECIPIENT = "successRecipient";\r
+ private static final String HOUSEID = "houseId";\r
+ private MediaCubeMarker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(List<ArchivedMedia> basket, String houseId, String recipient, String targetPathType, IJobEngine jobEngine, IJobRuntime jobRuntime)\r
+ throws Exception {\r
+ marker = (MediaCubeMarker) jobRuntime.getSessionMarker();\r
+\r
+ //session szinten csak a finishMarker cimzettje az erdekes, es ezt a cimet pluszban hasznalja a konfigban megadott cimmel\r
+ //a finishMarker orokli a cim bellitast a sessionMarkertol\r
+ marker.setTo(recipient);\r
+\r
+ ((MediaCubeMarker) jobRuntime.getFinishMarker()).setTo(recipient);\r
+\r
+ if (basket == null || basket.size() == 0)\r
+ return null;\r
+ setProgress(10);\r
+\r
+ MediaCubeMarker mailMarker = new MediaCubeMarker(recipient);\r
+ mailMarker.setSessionName("Archívum viszatöltés");\r
+ mailMarker.setSessionID(houseId);\r
+ logger.info(mailMarker, "A visszatöltések elindultak az alábbi állományokra:");\r
+\r
+ if (jobRuntime.forkPrepare()) {\r
+ for (ArchivedMedia archivedMedia : basket) {\r
+ logger.info(mailMarker, archivedMedia.getMedia().getMediaFilesName());\r
+ submit(archivedMedia, recipient, houseId, targetPathType, jobEngine, jobRuntime);\r
+ }\r
+ }\r
+ setProgress(50);\r
+ logger.info(new MediaCubeFinishMarker(mailMarker), "A visszatöltések végeztével megerősítő üzenetet küldünk.");\r
+ jobRuntime.forkWaitComplete();\r
+ setProgress(100);\r
+ return null;\r
+ }\r
+\r
+ public void submit(ArchivedMedia archivedMedia, String recipient, String houseId, String targetPathType, IJobEngine jobEngine, IJobRuntime jobRuntime)\r
+ throws Exception {\r
+ try {\r
+ ScheduledJob scheduledJob = jobEngine.getScheduledJob(CHILD_TEMPLATE);\r
+ Map<String, Object> parameters = scheduledJob.getJobParameters();\r
+ parameters.put(ARCHIVEDMEDIA, archivedMedia);\r
+ parameters.put(HOUSEID, houseId);\r
+ parameters.put(RECIPIENT, recipient);\r
+ parameters.put(TARGET_PATH_TYPE, targetPathType);\r
+ IJobRuntime child = jobEngine.submit(jobRuntime, null, CHILD_TEMPLATE, String.format("Visszatöltés %s részére", recipient), parameters);\r
+ ((MediaCubeMarker) child.getSessionMarker()).setTo(recipient);\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ logger.error(marker, "Hiba a kötegelt visszatöltésben. A rendszer üzenete: {}", e.getMessage());\r
+ }\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import org.apache.commons.net.ftp.FTPClient;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+import org.apache.logging.log4j.MarkerManager;\r
+\r
+import user.commons.StoreUri;\r
+import user.commons.remotestore.FtpDirectoryLister;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+\r
+public class CancelableStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ int count = 10;\r
+\r
+ @StepEntry\r
+ public Object[] execute(int param) throws Exception {\r
+ try {\r
+ logger.info("{}", EscortFiles.DOT_CATCHED);\r
+\r
+ getJobRuntime().setRelated("TESZT1");\r
+\r
+ // ftpTest();\r
+\r
+ Marker marker = MarkerManager.getMarker("MEDIAPROFILE");\r
+\r
+ for (int i = 0; i < count; i++) {\r
+ if (getJobRuntime().isWaitingCancel())\r
+ break;\r
+ Thread.sleep(500);\r
+ int progress = (i + 1) * 100 / count;\r
+ setProgress(progress);\r
+ logger.info(marker, "{}", i);\r
+ }\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ throw e;\r
+ }\r
+ return null;\r
+ }\r
+\r
+ void ftpTest() throws Exception {\r
+ StoreUri source = null;\r
+ StoreUri target = null;\r
+ try {\r
+ source = getManager().getStoreUri("MEDIACUBE_UPLOADS", RemoteStoreProtocol.LOCAL);\r
+ target = getManager().getStoreUri("NEXIO1", RemoteStoreProtocol.FTP);\r
+ source.addProgressListener(e -> setProgress(e.getProgress()));\r
+ logger.info("Uploading file PART_TEST.mxf");\r
+ source.transferFrom(target, "PART_TEST.mxf", "PART_TEST.mxf");\r
+ FTPClient client = ((FtpDirectoryLister) target.getLister()).connect();\r
+ logger.info("Renaming file PART_TEST.mxf to RENAME_TEST.mxf");\r
+ client.rename("PART_TEST.mxf", "RENAME_TEST.mxf");\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ } finally {\r
+ if (target != null)\r
+ target.cleanUp();\r
+ if (source != null)\r
+ source.cleanUp();\r
+ }\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.nio.file.DirectoryStream;\r
+import java.nio.file.FileVisitResult;\r
+import java.nio.file.FileVisitor;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.nio.file.SimpleFileVisitor;\r
+import java.nio.file.attribute.BasicFileAttributes;\r
+import java.text.ParseException;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.Date;\r
+import java.util.List;\r
+\r
+import org.apache.commons.io.FileUtils;\r
+import org.apache.commons.lang.StringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.commons.RemoteFile;\r
+import user.commons.StoreUri;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.jobengine.db.Store;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class CleanupMountedLocationStep extends JobStep implements FileVisitor<Path> {\r
+\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private static final String PROJECTFOLDER = "PROJECT";\r
+ private static final String DATEFORMAT = "yyyyMMdd";\r
+ private static final String DOT = ".";\r
+ private static final String STATUSFOLDER = ".STATUS";\r
+ private static final String EWC2EXT = ".ewc2";\r
+ private static final String XMPEXT = ".xmp";\r
+ private static final String CATCHEDEXT = ".catched";\r
+ private static final String KILLDATEEXT = ".killdate";\r
+ private static final String JSONEXT = ".json";\r
+\r
+ private static boolean isEmpty(final Path directory) throws IOException {\r
+ try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(directory)) {\r
+ final int[] count = new int[] { 0 };\r
+ final int[] specialCount = new int[] { 0 };\r
+ dirStream.forEach(p -> {\r
+ count[0]++;\r
+ // if (p.getFileName().toString().toLowerCase().equals(PROJECTFOLDER.toLowerCase()))\r
+ // specialCount[0]++;\r
+ if (p.getFileName().toString().toLowerCase().equals(STATUSFOLDER.toLowerCase()))\r
+ specialCount[0]++;\r
+\r
+ });\r
+ if (specialCount[0] == count[0])\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private Marker marker;\r
+\r
+ final int[] allCount = new int[] { 0 };\r
+ final int[] currentCount = new int[] { 0 };\r
+\r
+ private Path sourcePath;\r
+ private SimpleDateFormat dateFormat;\r
+ private StoreUri tsmStoreUri;\r
+\r
+ private Date checkExpiration(List<Path> killDateFiles) {\r
+ Date killDate = null;\r
+ for (Path killDateFile : killDateFiles) {\r
+ Date currentKillDate = getKillDate(killDateFile);\r
+ if (currentKillDate == null)\r
+ continue;\r
+ if ((killDate != null && currentKillDate.after(killDate)) || killDate == null)\r
+ killDate = currentKillDate;\r
+ }\r
+ return new Date().after(killDate) ? killDate : null;\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(String sourceFolder, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ marker = getSessionMarker();\r
+ sourcePath = Paths.get(sourceFolder);\r
+ DirectoryStream<Path> directoryStream = null;\r
+ if (StringUtils.isBlank(sourcePath.toString())) {\r
+ logger.error(marker, "A folyamat 'sourcePath' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'sourceFolder' input parameter missing.");\r
+ }\r
+\r
+ if (!sourcePath.toFile().exists() || !sourcePath.toFile().isDirectory()) {\r
+ logger.error(marker, "A {} mappa nem létezik.", sourceFolder);\r
+ throw new NullPointerException(String.format("Directory %s not exists.", sourceFolder));\r
+ }\r
+\r
+ Store tsmStore = getManager().getSystemStore(false);\r
+ if (tsmStore == null)\r
+ throw new NullPointerException("A TSM bejegyzés nem található!");\r
+\r
+ tsmStoreUri = tsmStore.getSourceStoreUri(RemoteStoreProtocol.TSM);\r
+ if (tsmStoreUri == null)\r
+ throw new NullPointerException("A TSM forrás elérése nem található!");\r
+\r
+ try {\r
+ setProgress(1);\r
+ dateFormat = new SimpleDateFormat(DATEFORMAT);\r
+\r
+ Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {\r
+ @Override\r
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\r
+ allCount[0]++;\r
+ return super.visitFile(file, attrs);\r
+ }\r
+ });\r
+ Files.walkFileTree(sourcePath, this);\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ logger.error(marker, "Hiba a '{}' mappa feldolgozásában. A rendszer hibaüzenete: {}", sourcePath, e.getMessage());\r
+ throw e;\r
+ } finally {\r
+ if (directoryStream != null) {\r
+ try {\r
+ directoryStream.close();\r
+ } catch (IOException e) {\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ private Date getKillDate(Path killDateFile) {\r
+ String fileName = killDateFile.getFileName().toString();\r
+ int end = fileName.lastIndexOf(DOT);\r
+ if (end < 1)\r
+ return null;\r
+ int start = fileName.lastIndexOf(DOT, end - 1);\r
+ if (start < 0)\r
+ return null;\r
+ String strKillDate = fileName.substring(start + 1, end);\r
+ Date result = null;\r
+ if (StringUtils.isNumeric(strKillDate)) {\r
+ try {\r
+ result = dateFormat.parse(strKillDate);\r
+ } catch (ParseException e) {\r
+ logger.error(marker, "A {} fájl 'killdate' állománya hibás formátumú, a {} karaktersorozat nem konvertálható dátummá.", fileName, strKillDate);\r
+ return null;\r
+ }\r
+ } else\r
+ logger.error(marker, "A {} fájl 'killdate' állománya hibás formátumú, az dátum helyett ez áll: '{}'.", fileName, strKillDate);\r
+ return result;\r
+ }\r
+\r
+ private List<Path> getKillDateFiles(Path filePath) {\r
+ String killDateFilePattern = String.format("%s.*%s", filePath.getFileName().toString(), KILLDATEEXT);\r
+ List<Path> result = new ArrayList<>();\r
+ Path statusPath = null;\r
+ try {\r
+ statusPath = Paths.get(filePath.getParent().toString(), STATUSFOLDER);\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ return null;\r
+ }\r
+ File statusPathFile = statusPath.toFile();\r
+ if (statusPathFile.exists() && statusPathFile.isDirectory()) {\r
+ try (DirectoryStream<Path> stream = Files.newDirectoryStream(statusPath, killDateFilePattern)) {\r
+ stream.forEach(p -> result.add(p));\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+ }\r
+ Collections.sort(result);\r
+ return result;\r
+ }\r
+\r
+ private boolean isArchived(Path filePath) {\r
+ boolean result = false;\r
+ String name = filePath.getFileName().toString();\r
+ String[] tsmName = new String[] { null };\r
+ String query = String.format("SELECT relativepath FROM MEDIAFILE WHERE houseid = '%s'", name);\r
+ getManager().executeQuery(query, rs -> {\r
+ tsmName[0] = rs.getString("relativepath");\r
+ return false;\r
+ }, null);\r
+\r
+ if (tsmName[0] != null) {\r
+ try {\r
+ RemoteFile remoteFile = tsmStoreUri.getRemoteFile(tsmName[0]);\r
+ result = remoteFile != null;\r
+ } catch (Exception e) {\r
+ logger.error(e.getMessage());\r
+ } finally {\r
+ tsmStoreUri.cleanUp();\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {\r
+ if (!dir.equals(sourcePath) && isEmpty(dir)) {\r
+ if (!removeExistingSpecialDirectory(dir, PROJECTFOLDER))\r
+ return FileVisitResult.CONTINUE;\r
+ if (!removeExistingSpecialDirectory(dir, STATUSFOLDER))\r
+ return FileVisitResult.CONTINUE;\r
+ if (removeFile(dir))\r
+ logger.info(marker, "A {} üres mappa törlése sikeres.", dir);\r
+\r
+ }\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\r
+\r
+ //A .-al kezdodo mappakat kihagyjuk\r
+ if (dir.getFileName().toString().startsWith("."))\r
+ return FileVisitResult.SKIP_SUBTREE;\r
+\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+\r
+ private void processPathItem(Path filePath) {\r
+ currentCount[0]++;\r
+\r
+ if (filePath.getFileName().toString().startsWith("."))\r
+ return;\r
+\r
+ int progress = currentCount[0] * 100 / allCount[0];\r
+ setProgress(progress);\r
+\r
+ logger.info("Checking {}", filePath);\r
+ List<Path> killDateFiles = getKillDateFiles(filePath);\r
+ if (killDateFiles == null || killDateFiles.size() == 0) {\r
+ logger.warn(marker, "A {} fájlhoz nem található 'killdate' állomány.", filePath);\r
+ return;\r
+ }\r
+\r
+ if (killDateFiles.size() != 1)\r
+ logger.warn(marker, "A {} fájlhoz több 'killdate' állomány található, a legújabb dátum határozza meg a törlés időpontját.", filePath);\r
+\r
+ Date killDate = checkExpiration(killDateFiles);\r
+ if (killDate == null)\r
+ return;\r
+\r
+ if (!isArchived(filePath)) {\r
+ logger.error(marker, "A(z) {} anyag törlésre van kijelölve, de nem található az archívumban.", filePath);\r
+ return;\r
+ }\r
+\r
+ if (removeFiles(filePath, killDateFiles))\r
+ logger.info(marker, "A {} fájl és kapcsolódó állományai a {} killdate bejegyzés alapján sikeresen törlődtek.", filePath.getFileName(),\r
+ dateFormat.format(killDate));\r
+ else\r
+ logger.warn(marker, "A {} fájl és kapcsolódó állományai a {} killdate bejegyzés alapján csak részlegesen vagy egyáltalán nem törlődtek.",\r
+ filePath.getFileName(), dateFormat.format(killDate));\r
+ }\r
+\r
+ private boolean removeExistingSpecialDirectory(Path dir, String folderName) throws IOException {\r
+ File projectPath = Paths.get(dir.toString(), folderName).toFile();\r
+ if (projectPath.exists() && projectPath.isDirectory()) {\r
+ FileUtils.deleteDirectory(projectPath);\r
+ if (projectPath.exists()) {\r
+ logger.warn(marker, "A {} alatti {} mappa törlése nem sikerült.", dir, folderName);\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private boolean removeFile(Path filePath) {\r
+ boolean result = false;\r
+ try {\r
+ //logger.error("REMOVE {}", filePath);\r
+ File file = filePath.toFile();\r
+ if (file.exists())\r
+ result = file.delete();\r
+ } catch (Exception e) {\r
+ logger.error(marker, "A {} fájl nem törölhető. A rendszer hibaüzenete: {}", filePath, e.getMessage());\r
+ }\r
+ return result;\r
+ }\r
+\r
+ private boolean removeFiles(Path filePath, List<Path> killDateFiles) {\r
+ if (!removeFile(filePath))\r
+ return false;\r
+\r
+ removeFile(Paths.get(filePath.toString() + EWC2EXT));\r
+ removeFile(Paths.get(filePath.toString() + XMPEXT));\r
+ removeFile(Paths.get(filePath.getParent().toString(), STATUSFOLDER, filePath.getFileName().toString() + CATCHEDEXT));\r
+ removeFile(Paths.get(filePath.getParent().toString(), STATUSFOLDER, filePath.getFileName().toString() + JSONEXT));\r
+\r
+ boolean result = true;\r
+ for (Path killDateFile : killDateFiles) {\r
+ if (!removeFile(killDateFile))\r
+ result = false;\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\r
+ processPathItem(file);\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+\r
+ @Override\r
+ public FileVisitResult visitFileFailed(Path file, IOException e) throws IOException {\r
+ logger.error(marker, "A {} fájl nem érhető el. A rendszer hibaüzenete: {}", file.toString(), e.getMessage());\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import com.ibm.nosql.json.api.BasicDBObject;\r
+import com.ibm.nosql.json.api.DB;\r
+import com.ibm.nosql.json.api.DBCollection;\r
+\r
+import user.commons.nosql.NoSQLUtils;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.db.Store;\r
+\r
+public class CreateArchiveItemStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ @StepEntry\r
+ public Object[] execute(Media mediaCubeMedia, String localHiresPath) throws Exception {\r
+ DB db = NoSQLUtils.getNoSQLDB();\r
+ DBCollection collection = db.getCollection("missing_lowres");\r
+ Store highResStore = getManager().getSystemStore(false);\r
+\r
+ ArchiveItem archiveItem = null;\r
+ try {\r
+ if (mediaCubeMedia.getMediaFilesCount() != 1)\r
+ throw new Exception("Expected media count is 1, found " + mediaCubeMedia.getMediaFilesCount());\r
+ if (mediaCubeMedia.getMediaFiles().get(0).getStoreId() != highResStore.getId())\r
+ throw new Exception("Expected media store is a high-res store");\r
+\r
+ String name = mediaCubeMedia.getMediaFileRealName();\r
+ archiveItem = new ArchiveItem();\r
+ archiveItem.setMediaFile(Paths.get(localHiresPath, name).toString());\r
+ collection.save(new BasicDBObject("name", name));\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ logger.info(getMarker(), e.getMessage());\r
+ throw e;\r
+ } finally {\r
+ setProgress(100);\r
+ }\r
+ return new Object[] { archiveItem };\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import com.ibm.nosql.json.api.BasicDBObject;\r
+import com.ibm.nosql.json.api.DB;\r
+import com.ibm.nosql.json.api.DBCollection;\r
+\r
+import user.commons.MediaCubeMarker;\r
+import user.commons.MediaCubeUndoMarker;\r
+import user.commons.nosql.NoSQLUtils;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class CreateMissingLowresStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private MediaCubeMarker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(String localHiresPath, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ Object[] result = new Object[] { null, null, "%s", null, 0, true };\r
+ marker = (MediaCubeMarker) jobRuntime.getSessionMarker();\r
+ DB db = NoSQLUtils.getNoSQLDB();\r
+ DBCollection collection = db.getCollection("missing_lowres");\r
+ IItemManager manager = jobEngine.getItemManager();\r
+ Media media = getFirstUntranscodedMedia(manager, collection);\r
+\r
+ try {\r
+ if (media == null) {\r
+ logger.info(new MediaCubeUndoMarker(marker.getSessionID()), "Nincs feldolgozandó hiány.");\r
+ // throw new Exception("Nincs feldolgozandó hiány.");\r
+ cancel();\r
+ return null;\r
+ }\r
+\r
+ String name = media.getMediaFileRealName();\r
+ result[0] = media;\r
+ ArchiveItem archiveItem = new ArchiveItem();\r
+ archiveItem.setMediaFile(Paths.get(localHiresPath, name).toString());\r
+ result[1] = archiveItem;\r
+ collection.save(new BasicDBObject("name", name));\r
+ logger.info(marker, "Hiányzó lowres mediaId: {}", media.getId());\r
+\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ logger.info(marker, e.getMessage());\r
+ throw e;\r
+ } finally {\r
+ setProgress(100);\r
+ }\r
+ return result;\r
+ }\r
+\r
+ private Media getFirstUntranscodedMedia(IItemManager manager, DBCollection collection) {\r
+ Media[] result = new Media[] { null };\r
+ 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 FETCH FIRST ROW ONLY";\r
+ manager.executeQuery(query, rs -> {\r
+ try {\r
+ long mediaId = rs.getLong(1);\r
+ Media media = manager.getMedia(mediaId);\r
+ //a nevgeneralas miatt az eredeti MediaFilesName nem jo, a pontos nev kell nekunk\r
+ String name = media.getMediaFileRealName();\r
+ long existing = collection.find(new BasicDBObject("name", name)).count();\r
+ if (existing > 0)\r
+ return true;\r
+\r
+ result[0] = media;\r
+ } catch (Exception e) {\r
+ logger.error(e);\r
+ }\r
+ return false;\r
+ }, null);\r
+ return result[0];\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.commons.StoreUri;\r
+import user.commons.remotestore.IProgressEventListener;\r
+import user.commons.remotestore.ProgressEvent;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class FileCopyStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private IItemManager manager;\r
+ private Marker marker;\r
+\r
+ private void check(String sourceProtocol, String sourcePath, String sourceFileName, String targetProtocol, String targetPath, String targetFileName,\r
+ IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
+ if (jobEngine == null) {\r
+ logger.error(marker, "A folyamatkezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing JobEngine reference.");\r
+ }\r
+ manager = jobEngine.getItemManager();\r
+ if (manager == null) {\r
+ logger.error(marker, "Az adatbáziskezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing ItemManager reference.");\r
+ }\r
+ if (sourceProtocol == null) {\r
+ logger.error(marker, "A forrás protokol bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'sourceProtocol' input parameter missing.");\r
+ }\r
+ if (sourcePath == null) {\r
+ logger.error(marker, "A forrás fájl elérés bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'sourcePath' input parameter missing.");\r
+ }\r
+ if (sourceFileName == null) {\r
+ logger.error(marker, "A forrás fájlnév bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'sourceFileName' input parameter missing.");\r
+ }\r
+ if (targetProtocol == null) {\r
+ logger.error(marker, "A cél protokol bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'targetProtocol' input parameter missing.");\r
+ }\r
+ if (targetPath == null) {\r
+ logger.error(marker, "A cél fájl elérés bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'targetPath' input parameter missing.");\r
+ }\r
+ if (targetFileName == null) {\r
+ logger.error(marker, "A cél fájlnév bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'targetFileName' input parameter missing.");\r
+ }\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(String sourceProtocol, String sourcePath, String sourceFileName, String targetProtocol, String targetPath, String targetFileName,\r
+ int killDateDays, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ marker = jobRuntime.getSessionMarker();\r
+\r
+ check(sourceProtocol, sourcePath, sourceFileName, targetProtocol, targetPath, targetFileName, jobEngine, jobRuntime);\r
+\r
+ StoreUri source = null;\r
+ StoreUri target = null;\r
+\r
+ try {\r
+ source = manager.createStoreUri(Enum.valueOf(RemoteStoreProtocol.class, sourceProtocol), sourcePath);\r
+ target = manager.createStoreUri(Enum.valueOf(RemoteStoreProtocol.class, targetProtocol), targetPath);\r
+ source.addProgressListener(new IProgressEventListener() {\r
+ @Override\r
+ public void progressChanged(ProgressEvent evt) {\r
+ jobRuntime.incrementProgress(evt.getProgress());\r
+ }\r
+ });\r
+\r
+ source.transferFrom(target, sourceFileName, targetFileName);\r
+ if (killDateDays > -1)\r
+ EscortFiles.createUNCKillDate(targetPath, targetFileName, killDateDays, marker);\r
+\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ throw e;\r
+ } finally {\r
+ if (source != null) {\r
+ source.cleanUp();\r
+ }\r
+ if (target != null) {\r
+ target.cleanUp();\r
+ }\r
+ }\r
+\r
+ return null;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.BufferedInputStream;\r
+import java.io.BufferedOutputStream;\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.FileOutputStream;\r
+import java.io.IOException;\r
+import java.io.InputStream;\r
+import java.io.OutputStream;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.nio.file.attribute.BasicFileAttributes;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Arrays;\r
+import java.util.LinkedHashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import org.apache.commons.io.FilenameUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import com.ibm.nosql.json.api.BasicDBObject;\r
+import com.ibm.nosql.json.api.DB;\r
+import com.ibm.nosql.json.api.DBCollection;\r
+import com.ibm.nosql.json.api.QueryBuilder;\r
+\r
+import user.commons.IEntityBase;\r
+import user.commons.MediaCubeMarker;\r
+import user.commons.nosql.NoSQLUtils;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.db.MediaFile;\r
+import user.jobengine.db.MediaFileDAO;\r
+import user.mediacube.metadata.interfaces.IMetadata;\r
+import user.mediacube.metadata.interfaces.IMetadataProvider;\r
+import user.mediacube.metadata.interfaces.IMetadataProviderFactory;\r
+import user.mediacube.metadata.interfaces.MetadataProviderType;\r
+import user.mediacube.metadata.interfaces.MetadataType;\r
+import user.mediacube.metadata.interfaces.PlanAirMetadataListOptions;\r
+\r
+public class HSMMigrateStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private static final String MXFEXT = ".mxf";\r
+ private static final String MOVEXT = ".mov";\r
+ private Marker marker = null;\r
+ private IMetadataProvider hsmProvider;\r
+ private Map<String, BasicDBObject> tapeContents = new LinkedHashMap<>();\r
+ private DBCollection excludes;\r
+ private DBCollection fileHistory;\r
+ private DBCollection volumeHistory;\r
+ private DB db;\r
+ private IMetadataProvider planairProvider;\r
+ private SimpleDateFormat df = new SimpleDateFormat("yyyy.MM.dd");\r
+\r
+ private void cleanupHistory() {\r
+ if (db == null)\r
+ db = NoSQLUtils.getNoSQLDB();\r
+ if (fileHistory == null)\r
+ fileHistory = db.getCollection("hsm_migrate_file_history");\r
+ if (volumeHistory == null)\r
+ volumeHistory = db.getCollection("hsm_migrate_volume_history");\r
+ fileHistory.drop();\r
+ volumeHistory.drop();\r
+ }\r
+\r
+ private BasicDBObject createMetadata(String volumeName, String fileName) throws Exception {\r
+\r
+ Path filePath = Paths.get(fileName);\r
+ String mediaHouseId = FilenameUtils.removeExtension(filePath.getFileName().toString());\r
+ BasicDBObject result = null;\r
+ try {\r
+ result = getPlanAirMetadata(mediaHouseId);\r
+ } catch (Exception e) {\r
+\r
+ logger.error("PlanAir metadata error", e);\r
+ //nem latja a drivert pl.\r
+ //throw e;\r
+ }\r
+\r
+ if (result == null) {\r
+ result = new BasicDBObject();\r
+ BasicFileAttributes attr = Files.readAttributes(filePath, BasicFileAttributes.class);\r
+ result.put("itemHouseId", df.format(attr.lastModifiedTime().toMillis()));\r
+ result.put("itemTitle", filePath.getParent().toString());\r
+ result.put("mediaHouseId", mediaHouseId);\r
+ result.put("mediaTitle", fileName);\r
+ result.put("mediaDescription", volumeName);\r
+ result.put("mediaType", "Generic");\r
+ }\r
+ result.put("userName", "mediacube");\r
+ return result;\r
+ }\r
+\r
+ @SuppressWarnings("serial")\r
+ @StepEntry\r
+ public Object[] execute(String sourceLocation, String targetLocation) throws Exception {\r
+ marker = getJobRuntime().getSessionMarker();\r
+ //remove from prod\r
+ //cleanupHistory();\r
+ hsmProvider = getMetadataProvider(MetadataProviderType.HSM);\r
+ if (hsmProvider == null)\r
+ throw new NullPointerException("No HSM metadata provider available");\r
+ planairProvider = getMetadataProvider(MetadataProviderType.PLANAIR);\r
+ if (planairProvider == null)\r
+ throw new NullPointerException("No PLANAIR metadata provider available");\r
+ Path targetPath = Paths.get(targetLocation);\r
+ try {\r
+ List<IMetadata> volumes = hsmProvider.list(new BasicDBObject());\r
+ for (IMetadata volume : volumes) {\r
+ String volumeName = volume.getTitle();\r
+\r
+ BasicDBObject historyResult = queryVolumeHistory(volumeName);\r
+ if (historyResult != null) {\r
+ logger.info(marker, "A kazetta már feldolgozásra került: {}", volumeName);\r
+ continue;\r
+ }\r
+ logger.info(marker, "A kazetta feldolgozása elindul: {}", volumeName);\r
+ List<IMetadata> contents = getContents(volumeName);\r
+ int p = 0;\r
+ boolean oneSuccess = false;\r
+ boolean hasError = false;\r
+ for (IMetadata content : contents) {\r
+ BasicDBObject c = content.asJSON();\r
+ String hsmFileName = c.getString("fileName");\r
+ long contentFileSize = NoSQLUtils.asLong(c, "fileSize");\r
+ if (!tapeContents.containsKey(hsmFileName)) {\r
+ tapeContents.put(hsmFileName, c);\r
+ Path sourceFilePath = Paths.get(sourceLocation, hsmFileName);\r
+ if (contentFileSize < Files.getFileStore(targetPath).getUsableSpace()) {\r
+ Path targetFilePath = Paths.get(targetLocation, sourceFilePath.getFileName().toString());\r
+\r
+ try {\r
+ if (processHSMFile(volumeName, hsmFileName, sourceFilePath, targetFilePath)) {\r
+ oneSuccess = true;\r
+ }\r
+ } catch (Exception e) {\r
+ hasError = true;\r
+ }\r
+ }\r
+ }\r
+ setProgress(p++ * 100 / contents.size());\r
+\r
+ if (getJobRuntime().isWaitingCancel()) {\r
+ logger.info("Job canceled by user");\r
+ //ne mentsuk a szalagot meg\r
+ return null;\r
+ }\r
+\r
+ }\r
+\r
+ if (oneSuccess && !hasError) {\r
+ saveVolumeHistory(volumeName);\r
+ String subject = "A kazetta eltávolítható a HSM rendszerből: " + volumeName;\r
+ logger.info(new MediaCubeMarker() {\r
+ {\r
+ setSubject(subject);\r
+ }\r
+ }, subject);\r
+ }\r
+\r
+ //ha mar sikerult valamit archivalni kilepunk\r
+ if (oneSuccess)\r
+ break;\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error(marker, "Hiba a migráció során. A rendszer hibaüzenete: {}", e.getMessage());\r
+ throw e;\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+ private List<IMetadata> getContents(String volumeName) throws Exception {\r
+ List<IMetadata> contents = null;\r
+ contents = hsmProvider.list(new BasicDBObject("volumeName", volumeName));\r
+ return contents;\r
+ }\r
+\r
+ protected IMetadataProvider getMetadataProvider(MetadataProviderType type) {\r
+ IMetadataProviderFactory factory = getService(IMetadataProviderFactory.class);\r
+ if (factory == null)\r
+ return null;\r
+ return factory.getProvider(type);\r
+ }\r
+\r
+ private BasicDBObject getPlanAirMetadata(String mediaHouseId) throws Exception {\r
+ PlanAirMetadataListOptions opt = new PlanAirMetadataListOptions();\r
+ opt.setSearch(mediaHouseId);\r
+\r
+ List<IMetadata> result = null;\r
+ opt.setType(MetadataType.Material);\r
+ result = planairProvider.list(opt);\r
+ if (result.size() != 0)\r
+ return result.get(0).asJSON();\r
+\r
+ opt.setType(MetadataType.Promo);\r
+ result = planairProvider.list(opt);\r
+ if (result.size() != 0)\r
+ return result.get(0).asJSON();\r
+\r
+ opt.setType(MetadataType.AD);\r
+ result = planairProvider.list(opt);\r
+ if (result.size() != 0)\r
+ return result.get(0).asJSON();\r
+\r
+ return null;\r
+ }\r
+\r
+ //true if need copy\r
+ public boolean prepareCopy(String hsmFileName, Path source, Path target) throws IOException {\r
+ boolean result = true;\r
+ BasicDBObject excludeResult = queryExclude(hsmFileName);\r
+ if (excludeResult != null) {\r
+ logger.warn(marker, "Kivételként megjelölt: {}", hsmFileName);\r
+ return false;\r
+ }\r
+\r
+ File sourceFile = source.toFile();\r
+ File targetFile = target.toFile();\r
+\r
+ if (!sourceFile.exists()) {\r
+ logger.warn(marker, "A forrás nem elérhető: {}", source);\r
+ return false;\r
+ }\r
+\r
+ // BasicDBObject historyResult = queryFileHistory(contentFileName);\r
+ // if (historyResult != null)\r
+ // return false;\r
+\r
+ // if (!mediaFile.getName().toLowerCase().endsWith(MOVEXT.toLowerCase()) && !mediaFile.getName().toLowerCase().endsWith(MXFEXT.toLowerCase()))\r
+ // return;\r
+ // logger.info("Start copy from {} to {}", sourceFilePath, targetFilePath);\r
+\r
+ boolean targetExists = targetFile.exists();\r
+\r
+ long targetLength = targetFile.length();\r
+ long sourceLength = sourceFile.length();\r
+\r
+ if (targetLength == sourceLength) {\r
+ logger.warn(marker, "A fájl már fel van dolgozva: {}, {} -> {}", source, sourceLength, targetLength);\r
+ return false;\r
+ }\r
+\r
+ if (targetLength > sourceLength) {\r
+ logger.warn(marker, "A célfájl nagyobb, törlöm: {}", target);\r
+ Files.delete(target);\r
+ targetLength = 0;\r
+ targetExists = false;\r
+ }\r
+\r
+ if (targetExists) {\r
+ logger.warn(marker, "A fájl már létezik, a másolás folytatódik: {}, {} -> {}", target, sourceLength, targetLength);\r
+ } else\r
+ logger.warn(marker, "Migrálás: {}, {} -> {}", source, sourceLength, targetLength);\r
+\r
+ return result;\r
+ }\r
+\r
+ private boolean processHSMFile(String volumeName, String hsmFileName, Path sourceFilePath, Path targetFilePath) throws Exception {\r
+ int repeat = 4;\r
+ boolean successCopy = false;\r
+\r
+ IItemManager manager = getManager();\r
+ MediaFileDAO mfDAO = (MediaFileDAO) manager.getBaseDAO(MediaFile.class);\r
+ List<IEntityBase> mediaFiles = mfDAO.getByHouseId(sourceFilePath.getFileName().toString());\r
+ if (mediaFiles != null && mediaFiles.size() > 0) {\r
+ logger.warn(marker, "Már archivált: {}", hsmFileName);\r
+ return false;\r
+ }\r
+\r
+ if (prepareCopy(hsmFileName, sourceFilePath, targetFilePath)) {\r
+ while (repeat > 0) {\r
+ try {\r
+ resumeableCopy(sourceFilePath, targetFilePath);\r
+ repeat = 0;\r
+ successCopy = true;\r
+ } catch (Exception e) {\r
+ if (Files.exists(targetFilePath) && targetFilePath.toFile().length() == 0)\r
+ Files.delete(targetFilePath);\r
+ //logger.warn(marker, "Hiba a másolás során: {} ({})", sourceFilePath, e.getMessage());\r
+ repeat--;\r
+ }\r
+ }\r
+ }\r
+ String metadataFileName = sourceFilePath.getFileName() + EscortFiles.DOT_JSON;\r
+ Path metadataPath = Paths.get(targetFilePath.getParent().toString(), EscortFiles.STATUSFOLDER, metadataFileName);\r
+ boolean createMetadata = Files.exists(targetFilePath) && !Files.exists(metadataPath);\r
+\r
+ if (successCopy || createMetadata) {\r
+ String metadata = null;\r
+ try {\r
+ metadata = createMetadata(volumeName, hsmFileName).toPrettyString("");\r
+ EscortFiles.createMetadata(targetFilePath.getParent().toString(), targetFilePath.getFileName().toString(), metadata);\r
+ //saveFileHistory(contentFileName);\r
+\r
+ } catch (Exception e) {\r
+ logger.error(marker, "Metadata error", e);\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ logger.error(marker, "A fájl másolása nem lehetséges: {}", sourceFilePath);\r
+ return false;\r
+ }\r
+\r
+ public BasicDBObject queryExclude(String fileName) {\r
+ if (db == null)\r
+ db = NoSQLUtils.getNoSQLDB();\r
+ if (excludes == null)\r
+ excludes = db.getCollection("hsm_migrate_exclude");\r
+ Path filePath = Paths.get(fileName);\r
+ String pureFileName = FilenameUtils.removeExtension(filePath.getFileName().toString());\r
+ QueryBuilder qb = QueryBuilder.start("name").in(Arrays.asList(fileName, pureFileName));\r
+ BasicDBObject exceptionResult = NoSQLUtils.asSingle(excludes.find(qb.get()));\r
+ return exceptionResult;\r
+ }\r
+\r
+ public BasicDBObject queryFileHistory(String fileName) {\r
+ if (db == null)\r
+ db = NoSQLUtils.getNoSQLDB();\r
+ if (fileHistory == null)\r
+ fileHistory = db.getCollection("hsm_migrate_file_history");\r
+ QueryBuilder qb = QueryBuilder.start("name").in(Arrays.asList(fileName));\r
+ BasicDBObject historyResult = NoSQLUtils.asSingle(fileHistory.find(qb.get()));\r
+ return historyResult;\r
+ }\r
+\r
+ public BasicDBObject queryVolumeHistory(String volumeName) {\r
+ if (db == null)\r
+ db = NoSQLUtils.getNoSQLDB();\r
+ if (volumeHistory == null)\r
+ volumeHistory = db.getCollection("hsm_migrate_volume_history");\r
+ QueryBuilder qb = QueryBuilder.start("name").in(Arrays.asList(volumeName));\r
+ BasicDBObject historyResult = NoSQLUtils.asSingle(volumeHistory.find(qb.get()));\r
+ return historyResult;\r
+ }\r
+\r
+ public void resumeableCopy(Path source, Path target) throws Exception {\r
+ File sourceFile = source.toFile();\r
+ File targetFile = target.toFile();\r
+ boolean targetExists = targetFile.exists();\r
+\r
+ long targetLength = targetFile.length();\r
+ long sourceLength = sourceFile.length();\r
+\r
+ try (InputStream in = new BufferedInputStream(new FileInputStream(sourceFile));\r
+ OutputStream out = new BufferedOutputStream(new FileOutputStream(targetFile, targetExists))) {\r
+\r
+ byte[] buffer = new byte[128 * 1024];\r
+ int lengthRead;\r
+\r
+ if (targetExists)\r
+ in.skip(targetLength);\r
+\r
+ while ((lengthRead = in.read(buffer)) > 0) {\r
+ out.write(buffer, 0, lengthRead);\r
+ out.flush();\r
+ targetLength = targetFile.length();\r
+ if (targetLength > sourceLength) {\r
+ throw new Exception("Hiba! A fájl túl nagy lett.");\r
+ }\r
+\r
+ if (getJobRuntime().isWaitingCancel()) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ targetLength = targetFile.length();\r
+ sourceLength = sourceFile.length();\r
+ if (targetLength != sourceLength) {\r
+ throw new Exception("Hiba! A fájl mérete nem egyezik.");\r
+ }\r
+ }\r
+ }\r
+\r
+ private void saveFileHistory(String fileName) {\r
+ if (db == null)\r
+ db = NoSQLUtils.getNoSQLDB();\r
+ if (fileHistory == null)\r
+ fileHistory = db.getCollection("hsm_migrate_file_history");\r
+ BasicDBObject item = new BasicDBObject();\r
+ item.put("name", fileName);\r
+ fileHistory.save(item);\r
+\r
+ }\r
+\r
+ private void saveVolumeHistory(String volumeName) {\r
+ if (db == null)\r
+ db = NoSQLUtils.getNoSQLDB();\r
+ if (volumeHistory == null)\r
+ volumeHistory = db.getCollection("hsm_migrate_volume_history");\r
+ BasicDBObject item = new BasicDBObject();\r
+ item.put("name", volumeName);\r
+ volumeHistory.save(item);\r
+\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import org.apache.commons.lang.StringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.commons.RemoteFile;\r
+import user.commons.StoreUri;\r
+import user.commons.remotestore.IProgressEventListener;\r
+import user.commons.remotestore.ProgressEvent;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+//import user.jobengine.db.Media;\r
+import user.jobengine.db.ArchivedMedia;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.db.Store;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class MXFCutterStep extends JobStep {\r
+ private static final String TARGETNAMEPATTERN = "-ARCH-%s";\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private IItemManager manager;\r
+ private StoreUri tempTargetUri;\r
+ private StoreUri tempSourceUri;\r
+ private String sourceFileName;\r
+ private Marker marker;\r
+ private int nexioPort;\r
+ private String nexioUserName, nexioPassword;\r
+ private String nexioHost;\r
+\r
+ protected void checkTargetPath(String targetPath) {\r
+ if (StringUtils.isBlank(targetPath)) {\r
+ logger.error(marker, "A folyamat 'targetPath' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'targetPath' input parameter missing.");\r
+ }\r
+ }\r
+\r
+ protected StoreUri createTargetUri(IItemManager manager, String targetPath) throws NullPointerException {\r
+ StoreUri result = null;\r
+ result = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ result.setPortNumber(nexioPort);\r
+ result.setUserName(nexioUserName);\r
+ result.setPassword(nexioPassword);\r
+\r
+ return result;\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(ArchivedMedia archivedMedia, String targetPath, String houseId, String successRecipient, int killDateDays, boolean useNexioTarget,\r
+ String nexioAgency, int nexioPort, String nexioUserName, String nexioPassword, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ this.nexioPort = nexioPort;\r
+ this.nexioUserName = nexioUserName;\r
+ this.nexioPassword = nexioPassword;\r
+ nexioHost = System.getProperty("nexio.host");\r
+ marker = jobRuntime.getSessionMarker();\r
+\r
+ if (useNexioTarget && archivedMedia.getTcIn() != null && archivedMedia.getTcOut() != null) {\r
+ setAndCheck(archivedMedia, houseId, targetPath, useNexioTarget, jobEngine);\r
+\r
+ final IJobRuntime runtime = jobRuntime;\r
+ sourceFileName = houseId + TARGETNAMEPATTERN;\r
+ tempSourceUri.addProgressListener(new IProgressEventListener() {\r
+ @Override\r
+ public void progressChanged(ProgressEvent evt) {\r
+ runtime.incrementProgress(evt.getProgress());\r
+ }\r
+ });\r
+\r
+ RemoteFile result = tempSourceUri.transferFrom(tempTargetUri, sourceFileName, sourceFileName);\r
+\r
+ EscortFiles.setNEXIOKillDate(killDateDays, houseId, nexioAgency, tempTargetUri);\r
+\r
+ logger.info("A {} videó kivágva {}s - {}s", sourceFileName, archivedMedia.getTcIn(), archivedMedia.getTcOut());\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+ // private String getSourceFileName(ArchivedMedia archivedMedia, Store\r
+ // store) {\r
+ // List<MediaFile> mediaFiles = archivedMedia.getMedia().getMediaFiles();\r
+ // if (mediaFiles == null)\r
+ // return null;\r
+ // for (MediaFile mediaFile : mediaFiles) {\r
+ // if (mediaFile.getStore().getId() == store.getId())\r
+ // return mediaFile.getRelativePath();\r
+ // }\r
+ // return null;\r
+ // }\r
+\r
+ private void setAndCheck(ArchivedMedia archivedMedia, String houseId, String targetPath, boolean useNexioTarget, IJobEngine jobEngine) {\r
+ if (jobEngine == null) {\r
+ logger.error(marker, "A folyamatkezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing JobEngine reference.");\r
+ }\r
+ manager = jobEngine.getItemManager();\r
+ if (manager == null) {\r
+ logger.error(marker, "Az adatbáziskezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing ItemManager reference.");\r
+ }\r
+ if (archivedMedia == null) {\r
+ logger.error(marker, "A folyamat 'mediaCubeMedia' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'mediaCubeMedia' input parameter missing.");\r
+ }\r
+ checkTargetPath(targetPath);\r
+ if (StringUtils.isBlank(houseId)) {\r
+ logger.error(marker, "A folyamat 'houseId' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'houseId' input parameter missing.");\r
+ }\r
+ Store tsmStore = manager.getSystemStore(false);\r
+ if (tsmStore == null) {\r
+ logger.error(marker, "A TSM rendszer beállítás nem elérhető.");\r
+ throw new NullPointerException("System is not configured properly, missing TSM Store.");\r
+ }\r
+\r
+ tempSourceUri = manager.createStoreUri(RemoteStoreProtocol.LOCAL, targetPath);\r
+ if (tempSourceUri == null) {\r
+ logger.error(marker, "A TSM rendszer beállítás paraméterei nem elérhetőek.");\r
+ throw new NullPointerException("System is not configured properly, missing TSM StoreUri.");\r
+ }\r
+ tempTargetUri = createTargetUri(manager, targetPath);\r
+ // sourceFileName = getSourceFileName(archivedMedia, tsmStore);\r
+ if (sourceFileName == null) {\r
+ logger.error(marker, "Adatbázis bejegyzés hiba, a visszatöltendő fájl neve nem található.");\r
+ throw new NullPointerException("Database error, missing MediaFile 'relativePath'.");\r
+ }\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.commons.mediatool.MediaInfo;\r
+import user.jobengine.db.Media;\r
+\r
+public class MediaToolStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private Marker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia) throws Exception {\r
+ marker = getSessionMarker();\r
+\r
+ //TODO ez most minden esetben ujranezi\r
+ // if (mediaCubeMedia.getLength() > 0)\r
+ // return null;\r
+\r
+ Path filePath = Paths.get(archiveItem.getMediaFile());\r
+ MediaInfo mi = new MediaInfo(filePath);\r
+ try {\r
+ mi.process();\r
+ long frames = mi.getFrames();\r
+ if (frames > 0) {\r
+ mediaCubeMedia.setLength(frames);\r
+ getManager().modify(mediaCubeMedia);\r
+ }\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ logger.error(marker, "A '{}' média analizálása sikertelen. A rendszer üzenete: {}", filePath, e.getMessage());\r
+ }\r
+ return null;\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.nio.file.attribute.FileAttribute;\r
+import java.nio.file.attribute.PosixFilePermission;\r
+import java.nio.file.attribute.PosixFilePermissions;\r
+import java.util.Date;\r
+import java.util.Set;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import com.ibm.nosql.json.api.BasicDBList;\r
+\r
+import user.jobengine.db.Item;\r
+import user.jobengine.db.ItemManager;\r
+import user.jobengine.db.ItemType;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+/**\r
+ * Itemek es mediak krealasa a ArchiveItem objektum alapjan.\r
+ *\r
+ * @author robi\r
+ */\r
+public class MetadataTransformStep extends JobStep {\r
+ private static final String CONFLICT = ".CONFLICT";\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private static final String ITEM_MANAGER_IS_NULL = "ItemManager is null";\r
+ public static final String DEFAULT_MEDIATYPE = "Generic";\r
+ private ItemManager itemManager;\r
+\r
+ private Marker marker;;\r
+\r
+ private void addTags(ArchiveItem archiveItem, Media mediaCubeMedia) {\r
+ BasicDBList tags = archiveItem.getTags();\r
+ if (tags != null) {\r
+ for (Object tag : tags) {\r
+\r
+ try {\r
+ String tagText = String.valueOf(tag);\r
+ itemManager.addMediaTag(tagText, mediaCubeMedia.getId());\r
+ System.out.println();\r
+\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ private void checkDuplicates(ArchiveItem archiveItem, String sourceFileName) throws Exception {\r
+ if (itemManager.isMediaFileExists(sourceFileName)) {\r
+ try {\r
+ Path sourcePath = Paths.get(archiveItem.getMediaFile());\r
+ Path parent = sourcePath.getParent();\r
+ Path conflictPath = Paths.get(parent.toString(), CONFLICT);\r
+ File folder = conflictPath.toFile();\r
+ if (!folder.exists() || !folder.isDirectory()) {\r
+ Set<PosixFilePermission> perms = PosixFilePermissions.fromString("rwxrwxrwx");\r
+ FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);\r
+ try {\r
+ Files.createDirectories(conflictPath, attr);\r
+ } catch (Exception e) {\r
+ try {\r
+ Files.createDirectory(conflictPath);\r
+ } catch (Exception e1) {\r
+ logger.catching(e);\r
+ throw e;\r
+ }\r
+ }\r
+ }\r
+\r
+ Files.move(sourcePath, Paths.get(conflictPath.toString(), sourceFileName + (new Date()).getTime()));\r
+ } catch (Exception e1) {\r
+ logger.catching(e1);\r
+ logger.error(marker, "Hiba az '{}' állomány mappába másolásakor. A rendszer üzenete: {}", CONFLICT, e1.getMessage());\r
+ }\r
+ throw new Exception("Az '" + sourceFileName + "' állomány már megtalálható az archívumban, archiválása nem lehetséges.");\r
+ }\r
+ }\r
+\r
+ private Item createItem(ArchiveItem archiveItem) {\r
+ Item mediaCubeItem = getExistingItem(archiveItem.getItemHouseId(), archiveItem.getItemTitle());\r
+ if (mediaCubeItem == null)\r
+ mediaCubeItem = itemManager.createItem(DEFAULT_MEDIATYPE, archiveItem.getItemTitle(), archiveItem.getItemDescription(),\r
+ archiveItem.getItemHouseId());\r
+ return mediaCubeItem;\r
+ }\r
+\r
+ private Media createMedia(ArchiveItem archiveItem, Item mediaCubeItem, String mediaType) {\r
+ Media mediaCubeMedia;\r
+ mediaCubeMedia = itemManager.createMedia(mediaType, archiveItem.getMediaTitle(), archiveItem.getMediaDescription(), archiveItem.getMediaHouseId());\r
+ mediaCubeMedia.setLength(archiveItem.getDuration());\r
+ mediaCubeItem.appendMedia(mediaCubeMedia);\r
+\r
+ return mediaCubeMedia;\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(ArchiveItem archiveItem, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ marker = jobRuntime.getSessionMarker();\r
+ Media mediaCubeMedia = null;\r
+ itemManager = (ItemManager) jobEngine.getItemManager();\r
+ if (itemManager == null)\r
+ throw new NullPointerException(ITEM_MANAGER_IS_NULL);\r
+ try {\r
+ File sourceMediaFile = new File(archiveItem.getMediaFile());\r
+ String sourceFileName = sourceMediaFile.getName();\r
+ checkDuplicates(archiveItem, sourceFileName);\r
+ Item mediaCubeItem = createItem(archiveItem);\r
+ jobRuntime.incrementProgress(50);\r
+ String mediaType = getCreateType(archiveItem);\r
+ mediaCubeMedia = createMedia(archiveItem, mediaCubeItem, mediaType);\r
+ //ha itemid 0 akkor merge, egyebkent media insert\r
+\r
+ if (mediaCubeItem.getId() == 0)\r
+ itemManager.mergeItemStructure(mediaCubeItem);\r
+ else {\r
+ mediaCubeMedia.setItemId(mediaCubeItem.getId());\r
+ mediaCubeMedia.add();\r
+ }\r
+\r
+ addTags(archiveItem, mediaCubeMedia);\r
+\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ String fileName = new File(archiveItem.getMediaFile()).getName();\r
+ logger.error(marker, "Az '{}' állomány nem archiválható, mert a metaadat transzformáció sikertelen. A rendszer üzenete: {}", fileName,\r
+ e.getMessage());\r
+ if (!archiveItem.removeCatchedFile())\r
+ logger.error(marker, "Az '{}' állomány .catched jelző állománya nem törölhető.", fileName);\r
+ throw e;\r
+ } finally {\r
+ jobRuntime.incrementProgress(100);\r
+ }\r
+ return new Object[] { mediaCubeMedia };\r
+ }\r
+\r
+ private String getCreateType(ArchiveItem archiveItem) {\r
+ String mediaType = archiveItem.getMediaType();\r
+ if (mediaType == null || mediaType.length() == 0)\r
+ mediaType = DEFAULT_MEDIATYPE;\r
+ else {\r
+ ItemType mediaItemType = itemManager.getItemType(mediaType);\r
+ if (mediaItemType == null)\r
+ itemManager.createItemType(mediaType, mediaType).add();\r
+ }\r
+ return mediaType;\r
+ }\r
+\r
+ private Item getExistingItem(String itemHouseId, String itemTitle) {\r
+ Item[] result = new Item[] { null };\r
+ String sql = String.format("select id from item where houseid='%s' and title='%s'", itemHouseId, itemTitle);\r
+ itemManager.executeQuery(sql, rs -> {\r
+ long id = rs.getLong("id");\r
+ result[0] = itemManager.getItem(id);\r
+ return true;\r
+ }, null);\r
+ return result[0];\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.IOException;\r
+import java.nio.file.FileVisitResult;\r
+import java.nio.file.FileVisitor;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.nio.file.SimpleFileVisitor;\r
+import java.nio.file.attribute.BasicFileAttributes;\r
+\r
+import org.apache.commons.lang.StringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.jobengine.db.ArchivedMedia;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class OutputPathAndNameSelectorStep extends JobStep {\r
+\r
+ private static final String TARGETNAMEPATTERN = "-ARCH-%s";\r
+\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ private Marker marker;\r
+\r
+ private void check(String localRetrievePath, String materialOutputFolder, String promoOutputFolder, String advertisementOutputFolder,\r
+ String octopusOutputFolder, String genericOutputFolder, String houseId, String targetPathType) {\r
+ if (StringUtils.isBlank(localRetrievePath)) {\r
+ logger.error(marker, "A folyamat 'localRetrievePath' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'localRetrievePath' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(materialOutputFolder)) {\r
+ logger.error(marker, "A folyamat 'materialOutputFolder' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'materialOutputFolder' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(promoOutputFolder)) {\r
+ logger.error(marker, "A folyamat 'promoOutputFolder' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'promoOutputFolder' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(advertisementOutputFolder)) {\r
+ logger.error(marker, "A folyamat 'advertisementOutputFolder' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'advertisementOutputFolder' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(octopusOutputFolder)) {\r
+ logger.error(marker, "A folyamat 'octopusOutputFolder' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'octopusOutputFolder' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(genericOutputFolder)) {\r
+ logger.error(marker, "A folyamat 'genericOutputFolder' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'genericOutputFolder' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(houseId)) {\r
+ logger.error(marker, "A folyamat 'houseId' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'houseId' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(targetPathType)) {\r
+ logger.error(marker, "A folyamat 'targetPathType' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'targetPathType' input parameter missing.");\r
+ }\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(String localRetrievePath, String materialOutputFolder, String promoOutputFolder, String advertisementOutputFolder,\r
+ String octopusOutputFolder, String genericOutputFolder, String onlineOutputFolder, String houseId, String targetPathType,\r
+ ArchivedMedia archivedMedia, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ marker = jobRuntime.getSessionMarker();\r
+ check(localRetrievePath, materialOutputFolder, promoOutputFolder, advertisementOutputFolder, octopusOutputFolder, genericOutputFolder, houseId,\r
+ targetPathType);\r
+ Object[] result = null;\r
+ switch (Integer.parseInt(targetPathType)) {\r
+ case 0:\r
+ String outputFolder = getFolderById(materialOutputFolder, promoOutputFolder, advertisementOutputFolder, octopusOutputFolder, genericOutputFolder,\r
+ houseId, archivedMedia);\r
+ result = localTargetInit(localRetrievePath, outputFolder, houseId, jobRuntime);\r
+ break;\r
+ case 1:\r
+ result = localTargetInit(localRetrievePath, onlineOutputFolder, houseId, jobRuntime);\r
+ break;\r
+ case 2:\r
+\r
+ if (archivedMedia.getTcIn() != null && archivedMedia.getTcOut() != null)\r
+ result = new Object[] { genericOutputFolder, houseId, true };\r
+ else\r
+ result = new Object[] { null, houseId, true };\r
+ break;\r
+ }\r
+ return result;\r
+ }\r
+\r
+ private String getFolderById(String materialOutputFolder, String promoOutputFolder, String advertisementOutputFolder, String octopusOutputFolder,\r
+ String genericOutputFolder, String houseId, ArchivedMedia archivedMedia) throws Exception {\r
+ String id = houseId.toUpperCase();\r
+ MetadataType mdType = MetadataTypeDetector.GuessMetadataType(id);\r
+ String result = null;\r
+\r
+ //a groovy nem latja enumnak, hanem az objektum tulajdonsaganak\r
+ switch (mdType.toString()) {\r
+ case "OctopusPlaceholder":\r
+ case "OctopusStory":\r
+ result = octopusOutputFolder;\r
+ break;\r
+ case "TrafficMaterial":\r
+ result = materialOutputFolder;\r
+ break;\r
+ case "TrafficPromo":\r
+ result = promoOutputFolder;\r
+ break;\r
+ case "TrafficAD":\r
+ result = advertisementOutputFolder;\r
+ break;\r
+ case "Generic":\r
+ result = genericOutputFolder;\r
+ break;\r
+ }\r
+ return result;\r
+ }\r
+\r
+ private String getPossiblePath(String id, Path targetPath) throws IOException {\r
+ String[] result = new String[] { targetPath.toString() };\r
+ FileVisitor<Path> matcherVisitor = new SimpleFileVisitor<Path>() {\r
+ @Override\r
+ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\r
+ String dirName = dir.getFileName().toString();\r
+ if (dirName.startsWith(id + "-") || dirName.equals(id)) {\r
+ result[0] = dir.toString();\r
+ return FileVisitResult.TERMINATE;\r
+ }\r
+ return FileVisitResult.CONTINUE;\r
+ }\r
+ };\r
+ Files.walkFileTree(targetPath.getParent(), matcherVisitor);\r
+ return result[0];\r
+ }\r
+\r
+ private Object[] localTargetInit(String localRetrievePath, String outputFolder, String houseId, IJobRuntime jobRuntime) throws IOException {\r
+ String id = houseId.toUpperCase();\r
+ String targetPath = getPossiblePath(id, Paths.get(localRetrievePath, outputFolder, id)).toString();\r
+ String targetNamePattern = houseId + TARGETNAMEPATTERN;\r
+ try {\r
+ EscortFiles.ensureUNCFolder(Paths.get(targetPath));\r
+ } catch (Exception e) {\r
+ logger.error(jobRuntime.getSessionMarker(), "A cél mappa '{}' nem létezik és nem hozható létre. A rendszer hibaüzenete: {}", targetPath,\r
+ e.getMessage());\r
+ throw e;\r
+ }\r
+ return new Object[] { targetPath, targetNamePattern, false };\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.nio.file.Files;\r
+import java.nio.file.attribute.BasicFileAttributes;\r
+import java.sql.Timestamp;\r
+import java.util.Date;\r
+import java.util.List;\r
+\r
+import org.apache.commons.lang.RandomStringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+import org.apache.logging.log4j.message.Message;\r
+import org.apache.logging.log4j.message.ParameterizedMessage;\r
+\r
+import user.commons.RemoteFile;\r
+import user.commons.StoreUri;\r
+import user.commons.mediatool.Timecode;\r
+import user.commons.mediatool.Timecode.Type;\r
+import user.commons.remotestore.IProgressEventListener;\r
+import user.commons.remotestore.IStatusEventListener;\r
+import user.commons.remotestore.ProgressEvent;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.commons.remotestore.StatusEvent;\r
+import user.jobengine.db.FileType;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.db.MediaFile;\r
+import user.jobengine.db.Store;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+import user.jobengine.server.JobEngineException;\r
+\r
+public class TSMBackupStep extends JobStep {\r
+ private static final String MXFEXT = ".MXF";\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private IItemManager manager;\r
+ private File sourceMediaFile;\r
+ private Store tsmStore;\r
+ private StoreUri targetUri;\r
+ private FileType fileType;\r
+ private Marker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, int killDateDays) throws Exception {\r
+ marker = getSessionMarker();\r
+\r
+ File sourceMediaFile = new File(archiveItem.getMediaFile());\r
+ String sourceFileName = sourceMediaFile.getName();\r
+ Timecode timecode = new Timecode(mediaCubeMedia.getLength(), Type.PAL);\r
+ String details = String.format("%s (%s, %d bytes)", sourceFileName, timecode.toString(), sourceMediaFile.length());\r
+ getJobRuntime().setDescription(details);\r
+ try {\r
+\r
+ setAndCheck(archiveItem, mediaCubeMedia, getEngine());\r
+\r
+ //TODO mxf helyett az osszes kiterjesztest!!!!!\r
+ //A dupla ellenorzes a napon beluli ismetlesek miatt kell\r
+ long existingMediaId = archiveItem.getExistingMediaId();\r
+ if (sourceMediaFile.length() == 0 && existingMediaId == 0) {\r
+ existingMediaId = ItemManagerExtensions.getExistingRundownMedia(manager, sourceFileName.replace(MXFEXT, ""));\r
+ if (existingMediaId == 0)\r
+ existingMediaId = -1;\r
+ }\r
+\r
+ if (existingMediaId == 0)\r
+ existingMediaId = ItemManagerExtensions.getExistingRundownMedia(manager, sourceFileName.replace(MXFEXT, ""));\r
+\r
+ boolean randomizeName = Boolean.parseBoolean(System.getProperty("jobengine.randomize.archives", "false"));\r
+\r
+ String targetFileName;\r
+ if (randomizeName) {\r
+ // a-z, A-Z, 0-9. For example: WRMcpIk7, s57JwCVA\r
+ //veletlenszeru neveket adunk!\r
+ targetFileName = String.format("%s-%s", RandomStringUtils.randomAlphanumeric(8), sourceFileName);\r
+ } else\r
+ targetFileName = sourceFileName;\r
+\r
+ if (existingMediaId == 0) {\r
+ StoreUri sourceUri = manager.createStoreUri(RemoteStoreProtocol.LOCAL, sourceMediaFile.getParent().toString());\r
+\r
+ final IJobRuntime runtime = getJobRuntime();\r
+ sourceUri.addProgressListener(new IProgressEventListener() {\r
+ @Override\r
+ public void progressChanged(ProgressEvent evt) {\r
+ runtime.incrementProgress(evt.getProgress());\r
+ }\r
+ });\r
+ sourceUri.addStatusListener(new IStatusEventListener() {\r
+ @Override\r
+ public void statusChanged(StatusEvent evt) {\r
+ evt.setCancel(!canContinue());\r
+ }\r
+ });\r
+\r
+ RemoteFile remoteFile = sourceUri.transferFrom(targetUri, sourceFileName, targetFileName);\r
+ }\r
+\r
+ if (existingMediaId > 0)\r
+ logger.info(marker, "Az '{}' TSM mentése nem szükséges, mert már megtalálható az archívumban.", sourceFileName);\r
+\r
+ //Fel kell szabadítani, hogy a kovetkezo archivalaskor is nekifusson\r
+ if (existingMediaId == -1) {\r
+ logger.info(marker, "Az '{}' mentése jelenleg nem lehetséges, mert a szükséges metaadat még nem található meg az archívumban.", sourceFileName);\r
+ if (!archiveItem.removeCatchedFile())\r
+ logger.error(marker,\r
+ "Az '{}' állomány .catched jelző állománya nem törölhető. Az újabb archiválási kísérlethez annak kézi eltávolítása szükséges!",\r
+ sourceMediaFile.getName());\r
+ mediaCubeMedia.remove();\r
+ } else {\r
+ saveMetadata(mediaCubeMedia, sourceMediaFile, targetFileName, existingMediaId);\r
+ logger.info(marker, "Az '{}' archiválása sikeres.", sourceFileName);\r
+ if (killDateDays != 0)\r
+ EscortFiles.createUNCKillDate(sourceMediaFile.getParent(), sourceFileName, killDateDays, marker);\r
+ }\r
+\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ Message m = new ParameterizedMessage("Az '{}' állomány archiválása sikertelen. A rendszer hibaüzenete: {}", details, e.getMessage());\r
+ logger.error(marker, m);\r
+ if (!archiveItem.removeCatchedFile())\r
+ logger.error(marker,\r
+ "Az '{}' állomány .catched jelző állománya nem törölhető. Az újabb archiválási kísérlethez annak kézi eltávolítása szükséges!",\r
+ sourceMediaFile.getName());\r
+ throw new Exception(m.getFormattedMessage());\r
+ }\r
+ return null;\r
+ }\r
+\r
+ private void saveMetadata(Media mediaCubeMedia, File sourceFile, String targetFileName, long existingMediaId) {\r
+\r
+ if (existingMediaId == 0) {\r
+ MediaFile mediaFile = manager.createMediaFile(targetFileName, fileType, tsmStore, mediaCubeMedia);\r
+ mediaFile.setHouseId(sourceFile.getName());\r
+ mediaFile.add();\r
+ } else {\r
+ Media existingMedia = manager.getMedia(existingMediaId);\r
+ List<MediaFile> mediaFiles = existingMedia.getMediaFiles();\r
+ if (mediaFiles != null) {\r
+ for (MediaFile mf : mediaFiles) {\r
+ mf.setPersister(manager);\r
+ mf.setId(0);\r
+ mf.setMedia(mediaCubeMedia);\r
+ mf.add();\r
+ }\r
+ }\r
+ }\r
+ mediaCubeMedia.setPersister(manager);\r
+\r
+ try {\r
+ BasicFileAttributes attr = Files.readAttributes(sourceFile.toPath(), BasicFileAttributes.class);\r
+ mediaCubeMedia.setArchived(new Timestamp(attr.creationTime().toMillis()));\r
+ } catch (IOException e) {\r
+ logger.catching(e);\r
+ mediaCubeMedia.setArchived(new Timestamp(new Date().getTime()));\r
+ }\r
+\r
+ mediaCubeMedia.modify();\r
+ }\r
+\r
+ private void setAndCheck(ArchiveItem archiveItem, Media mediaCubeMedia, IJobEngine jobEngine) throws JobEngineException, IOException {\r
+ if (jobEngine == null) {\r
+ logger.error(marker, "Az folyamatkezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing JobEngine reference.");\r
+ }\r
+ manager = jobEngine.getItemManager();\r
+ if (manager == null) {\r
+ logger.error(marker, "Az adatbáziskezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing ItemManager reference.");\r
+ }\r
+ if (archiveItem == null) {\r
+ logger.error(marker, "A folyamat 'archiveItem' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, missing 'archiveItem' input parameter.");\r
+ }\r
+ sourceMediaFile = new File(archiveItem.getMediaFile());\r
+ if (sourceMediaFile == null) {\r
+ logger.error(marker, "A folyamat 'archiveItem' bemeneti paraméter 'mediaFile' értéke üres.");\r
+ throw new NullPointerException("System is not configured properly, missing 'mediaFile' value in 'archiveItem' input parameter.");\r
+ }\r
+ if (!sourceMediaFile.exists()) {\r
+ logger.error(marker, "Az {} állomány nem létezik vagy nem érhető el.", sourceMediaFile.getName());\r
+ throw new IOException(String.format("Input file {} not exists or unreachable.", sourceMediaFile.getName()));\r
+ }\r
+ tsmStore = manager.getSystemStore(false);\r
+ if (tsmStore == null) {\r
+ logger.error(marker, "A TSM rendszer beállítás nem elérhető.");\r
+ throw new NullPointerException("System is not configured properly, missing TSM Store.");\r
+ }\r
+ targetUri = tsmStore.getSourceStoreUri(RemoteStoreProtocol.TSM);\r
+ if (targetUri == null) {\r
+ logger.error(marker, "A TSM rendszer beállítás paraméterei nem elérhetőek.");\r
+ throw new NullPointerException("System is not configured properly, missing TSM StoreUri.");\r
+ }\r
+ fileType = manager.getFileType("High-res");\r
+ if (fileType == null) {\r
+ logger.error(marker, "Adatbázis bejegyzés hiba, a 'High-res' FileType nem található.");\r
+ throw new NullPointerException("System is not configured properly, missing 'High-res' FileType.");\r
+ }\r
+ if (mediaCubeMedia == null) {\r
+ logger.error(marker, "A folyamat 'mediaCubeMedia' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'mediaCubeMedia' input parameter missing.");\r
+ }\r
+\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import user.commons.StoreUri;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.jobengine.db.ArchivedMedia;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class TSMExtendedRetrieveStep extends TSMRestoreStep {\r
+ private boolean useNexioTarget;\r
+ private int nexioPort;\r
+ private String nexioUserName, nexioPassword;\r
+ private String nexioHost;\r
+ private String nexioAgency;\r
+\r
+ @Override\r
+ protected void afterRestore(StoreUri targetUri, String targetPath, int killDateDays, String targetFileName) throws Exception {\r
+ if (useNexioTarget) {\r
+ EscortFiles.setNEXIOKillDate(killDateDays, targetFileName, nexioAgency, targetUri);\r
+ } else {\r
+ super.afterRestore(targetUri, targetPath, killDateDays, targetFileName);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ protected void beforeRestore(StoreUri targetURI, String targetName) throws Exception {\r
+ String newTargetName = targetName;\r
+ if (targetName.contains("."))\r
+ newTargetName = targetName.substring(0, targetName.lastIndexOf('.'));\r
+ if (useNexioTarget)\r
+ if (targetURI.fileExists(newTargetName + ".mxf"))\r
+ throw new Exception(String.format("%s-The newly created file name is existed.", getClass().getSimpleName()));\r
+ }\r
+\r
+ @Override\r
+ protected void checkTargetPath(String targetPath) {\r
+ if (!useNexioTarget)\r
+ super.checkTargetPath(targetPath);\r
+ }\r
+\r
+ @Override\r
+ protected StoreUri createTargetUri(IItemManager manager, String targetPath) throws NullPointerException {\r
+ StoreUri result = null;\r
+ if (useNexioTarget) {\r
+ nexioHost = System.getProperty("nexio.host");\r
+ if (nexioHost == null) {\r
+ throw new NullPointerException("Missing system property on 'nexio.host' name");\r
+ }\r
+ result = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ result.setPortNumber(nexioPort);\r
+ result.setUserName(nexioUserName);\r
+ result.setPassword(nexioPassword);\r
+ } else\r
+ result = super.createTargetUri(manager, targetPath);\r
+ return result;\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(ArchivedMedia archivedMedia, String targetPath, String targetNamePattern, String successRecipient, int killDateDays,\r
+ String localRetrievePath, String globalRetrievePath, boolean useNexioTarget, String nexioAgency, int nexioPort, String nexioUserName,\r
+ String nexioPassword, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ this.useNexioTarget = useNexioTarget;\r
+ this.nexioAgency = nexioAgency;\r
+ this.nexioPort = nexioPort;\r
+ this.nexioUserName = nexioUserName;\r
+ this.nexioPassword = nexioPassword;\r
+ if (nexioPort == 0) {\r
+ throw new NullPointerException("System is not configured properly, 'nexioPort' input parameter missing.");\r
+ }\r
+ if (nexioUserName == null) {\r
+ throw new NullPointerException("System is not configured properly, 'nexioUserName' input parameter missing.");\r
+ }\r
+ if (nexioPassword == null) {\r
+ throw new NullPointerException("System is not configured properly, 'nexioPassword' input parameter missing.");\r
+ }\r
+ if (nexioAgency == null) {\r
+ throw new NullPointerException("System is not configured properly, 'nexioAgency' input parameter missing.");\r
+ }\r
+\r
+ return super.execute(archivedMedia.getMedia(), targetPath, targetNamePattern, successRecipient, killDateDays, localRetrievePath, globalRetrievePath,\r
+ jobEngine, jobRuntime);\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.IOException;\r
+import java.nio.file.Paths;\r
+import java.util.List;\r
+\r
+import org.apache.commons.lang.StringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+import org.apache.logging.log4j.message.Message;\r
+\r
+import user.commons.LogUtils;\r
+import user.commons.RemoteFile;\r
+import user.commons.StoreUri;\r
+import user.commons.mediatool.Timecode;\r
+import user.commons.mediatool.Timecode.Type;\r
+import user.commons.remotestore.IProgressEventListener;\r
+import user.commons.remotestore.IStatusEventListener;\r
+import user.commons.remotestore.ProgressEvent;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.commons.remotestore.StatusEvent;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.db.MediaFile;\r
+import user.jobengine.db.Store;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class TSMRestoreStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private IItemManager manager;\r
+ private StoreUri targetUri;\r
+ private StoreUri sourceUri;\r
+ private String sourceFileName;\r
+ private Marker marker;\r
+\r
+ protected void afterRestore(StoreUri targetUri, String targetPath, int killDateDays, String targetFileName) throws IOException, Exception {\r
+ if (killDateDays > 0)\r
+ EscortFiles.createUNCKillDate(targetPath, targetFileName, killDateDays, marker);\r
+ }\r
+\r
+ protected void beforeRestore(StoreUri targetURI, String targetFileName) throws Exception {\r
+ }\r
+\r
+ protected void checkTargetPath(String targetPath) {\r
+ if (StringUtils.isBlank(targetPath)) {\r
+ logger.error(marker, "A folyamat 'targetPath' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'targetPath' input parameter missing.");\r
+ }\r
+ }\r
+\r
+ protected StoreUri createTargetUri(IItemManager manager, String targetPath) {\r
+ return manager.createStoreUri(RemoteStoreProtocol.LOCAL, targetPath);\r
+ }\r
+\r
+ @StepEntry\r
+ public Object[] execute(Media mediaCubeMedia, String targetPath, String targetNamePattern, String successRecipient, int killDateDays,\r
+ String localRetrievePath, String globalRetrievePath, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ marker = jobRuntime.getSessionMarker();\r
+ setAndCheck(mediaCubeMedia, targetPath, targetNamePattern, localRetrievePath, globalRetrievePath, jobEngine);\r
+ String targetFileName = String.format(targetNamePattern, sourceFileName);\r
+ Timecode timecode = new Timecode(mediaCubeMedia.getLength(), Type.PAL);\r
+ try {\r
+ String details = String.format("%s (%s)", sourceFileName, timecode.toString());\r
+ jobRuntime.setDescription(details);\r
+ beforeRestore(targetUri, targetNamePattern);\r
+ final IJobRuntime runtime = jobRuntime;\r
+ sourceUri.addProgressListener(new IProgressEventListener() {\r
+ @Override\r
+ public void progressChanged(ProgressEvent evt) {\r
+ runtime.incrementProgress(evt.getProgress());\r
+ }\r
+ });\r
+ sourceUri.addStatusListener(new IStatusEventListener() {\r
+ @Override\r
+ public void statusChanged(StatusEvent evt) {\r
+ evt.setCancel(!canContinue());\r
+ }\r
+ });\r
+ RemoteFile result = sourceUri.transferFrom(targetUri, sourceFileName, targetFileName);\r
+\r
+ String globalTargetPath = Paths.get(targetPath, targetFileName).getParent().toString().replace(Paths.get(localRetrievePath).toString(),\r
+ globalRetrievePath);\r
+\r
+ logger.info(marker,\r
+ "Az '{}' állomány visszatöltése sikeres volt '{}' néven. A célmappa a <a href='{}' target='_blank'>ide kattintva</a> nyitható meg.",\r
+ sourceFileName, targetFileName, globalTargetPath);\r
+ afterRestore(targetUri, targetPath, killDateDays, targetFileName);\r
+\r
+ } catch (Exception e) {\r
+ Message msg = LogUtils.format("Az '{}' állomány visszatöltése sikertelen. A rendszer hibaüzenete: {}", sourceFileName, e.getMessage());\r
+ logger.error(marker, msg);\r
+ // logger.error(jobRuntime.marker, msg);\r
+ logger.catching(e);\r
+ throw e;\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+ private String getSourceFileName(Media mediaCubeMedia, Store store) {\r
+ List<MediaFile> mediaFiles = mediaCubeMedia.getMediaFiles();\r
+ if (mediaFiles == null)\r
+ return null;\r
+ for (MediaFile mediaFile : mediaFiles) {\r
+ if (mediaFile.getStore().getId() == store.getId())\r
+ return mediaFile.getRelativePath();\r
+ }\r
+ return null;\r
+ }\r
+\r
+ private void setAndCheck(Media mediaCubeMedia, String targetPath, String targetNamePattern, String localRetrievePath, String globalRetrievePath,\r
+ IJobEngine jobEngine) {\r
+ if (jobEngine == null) {\r
+ logger.error(marker, "Az folyamatkezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing JobEngine reference.");\r
+ }\r
+ manager = jobEngine.getItemManager();\r
+ if (manager == null) {\r
+ logger.error(marker, "Az adatbáziskezelő réteg nem elérhető.");\r
+ throw new NullPointerException("Internal error, missing ItemManager reference.");\r
+ }\r
+ if (mediaCubeMedia == null) {\r
+ logger.error(marker, "A folyamat 'mediaCubeMedia' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'mediaCubeMedia' input parameter missing.");\r
+ }\r
+ checkTargetPath(targetPath);\r
+ if (StringUtils.isBlank(targetNamePattern)) {\r
+ logger.error(marker, "A folyamat 'targetNamePattern' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'targetNamePattern' input parameter missing.");\r
+ }\r
+ Store tsmStore = manager.getSystemStore(false);\r
+ if (tsmStore == null) {\r
+ logger.error(marker, "A TSM rendszer beállítás nem elérhető.");\r
+ throw new NullPointerException("System is not configured properly, missing TSM Store.");\r
+ }\r
+ sourceUri = tsmStore.getSourceStoreUri(RemoteStoreProtocol.TSM);\r
+ if (sourceUri == null) {\r
+ logger.error(marker, "A TSM rendszer beállítás paraméterei nem elérhetőek.");\r
+ throw new NullPointerException("System is not configured properly, missing TSM StoreUri.");\r
+ }\r
+ targetUri = createTargetUri(manager, targetPath);\r
+ sourceFileName = getSourceFileName(mediaCubeMedia, tsmStore);\r
+ if (sourceFileName == null) {\r
+ logger.error(marker, "Adatbázis bejegyzés hiba, a visszatöltendő fájl neve nem található.");\r
+ throw new NullPointerException("Database error, missing MediaFile 'relativePath'.");\r
+ }\r
+\r
+ if (StringUtils.isBlank(localRetrievePath)) {\r
+ logger.error(marker, "A folyamat 'localRetrievePath' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'localRetrievePath' input parameter missing.");\r
+ }\r
+ if (StringUtils.isBlank(globalRetrievePath)) {\r
+ logger.error(marker, "A folyamat 'globalRetrievePath' bemeneti paramétere üres.");\r
+ throw new NullPointerException("System is not configured properly, 'globalRetrievePath' input parameter missing.");\r
+ }\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Files;\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.StoreUri;\r
+import user.commons.mediatool.Timecode;\r
+import user.commons.mediatool.Timecode.Type;\r
+import user.commons.remotestore.IProgressEventListener;\r
+import user.commons.remotestore.IStatusEventListener;\r
+import user.commons.remotestore.ProgressEvent;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.commons.remotestore.StatusEvent;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.db.MediaFile;\r
+import user.jobengine.db.Store;\r
+\r
+public class TSMSimpleRestoreStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ @StepEntry\r
+ public Object[] execute(long mediaId, String targetPath) throws Exception {\r
+ String fileName = null;\r
+ try {\r
+ Media media = getManager().getMedia(mediaId);\r
+ MediaFile mediaFile = getManager().getSystemMediaFile(media);\r
+ fileName = mediaFile.getRelativePath();\r
+ Timecode timecode = new Timecode(media.getLength(), Type.PAL);\r
+ getJobRuntime().setDescription(String.format("%s (%s)", fileName, timecode.toString()));\r
+ Store tsmStore = getManager().getSystemStore(false);\r
+ StoreUri sourceStoreUri = getManager().getStoreUri(tsmStore.getName(), RemoteStoreProtocol.TSM);\r
+ sourceStoreUri.addProgressListener(new IProgressEventListener() {\r
+ @Override\r
+ public void progressChanged(ProgressEvent evt) {\r
+ setProgress(evt.getProgress());\r
+ }\r
+ });\r
+ sourceStoreUri.addStatusListener(new IStatusEventListener() {\r
+ @Override\r
+ public void statusChanged(StatusEvent evt) {\r
+ evt.setCancel(!canContinue());\r
+ }\r
+ });\r
+ StoreUri targetStoreUri = getManager().createStoreUri(RemoteStoreProtocol.LOCAL, targetPath);\r
+ sourceStoreUri.transferFrom(targetStoreUri, fileName, fileName + ".part");\r
+ Files.move(Paths.get(targetPath, fileName + ".part"), Paths.get(targetPath, fileName));\r
+ } catch (Exception e) {\r
+ logger.error("Az '{}' állomány visszatöltése sikertelen. A rendszer üzenete: {}", fileName, e.getMessage());\r
+ throw e;\r
+ }\r
+\r
+ return null;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.IJob;\r
+import user.commons.JobStatus;\r
+import user.commons.ListUtils;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class TestForkCancelableStep extends JobStep {\r
+ private static final String CHILD_TEMPLATE = "cancelable.xml";\r
+ private static final Logger logger = LogManager.getLogger();\r
+ int count = 5;\r
+\r
+ @StepEntry\r
+ public Object[] execute(IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ jobRuntime.forkPrepare();\r
+ for (int i = 0; i < count; i++) {\r
+ if (getJobRuntime().isWaitingCancel())\r
+ break;\r
+ //jobEngine.submit(jobRuntime, null, CHILD_TEMPLATE, CHILD_TITLE, ListUtils.asMap("itemID", i));\r
+ // IJobRuntime runtime = jobEngine.submit(jobRuntime, null, CHILD_TEMPLATE, "JOB " + i, ListUtils.asMap("param", i));\r
+ IJobRuntime runtime = getEngine().submit(getJobRuntime(), e -> {\r
+ if (e.getStatus().equals(JobStatus.CANCELED) || e.getStatus().equals(JobStatus.SUSPENDED))\r
+ logger.info("Cleanup occured because status is {} {}", e.getStatus(), ((IJob) e.getSource()).getId());\r
+ }, CHILD_TEMPLATE, "JOB " + i, 0, IJobEngine.DEFAULT_OWNER, ListUtils.asMap("param", i));\r
+\r
+ runtime.setRelated("TEST" + runtime.getId());\r
+ }\r
+\r
+ jobRuntime.forkWaitComplete();\r
+ logger.info("Done");\r
+ return null;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.commons.io.FilenameUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+import org.apache.logging.log4j.message.Message;\r
+import org.apache.logging.log4j.message.ParameterizedMessage;\r
+\r
+import user.commons.FFAStransAPI;\r
+import user.commons.IFFAStransAPI;\r
+import user.commons.StoreUri;\r
+import user.commons.mediatool.Timecode;\r
+import user.commons.mediatool.Timecode.Type;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.jobengine.db.FileType;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.db.Store;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+\r
+public class TranscodeFFAStranStep extends JobStep {\r
+ private static final int POLL_INTERVALL = 3000;\r
+ private static final String MP4EXT = ".MP4";\r
+ private static final String MXFEXT = ".MXF";\r
+ private static final String LOWRES_FILETYPE = "Low-res";\r
+ private static final Logger logger = LogManager.getLogger("TranscodeFFAStranStep");\r
+ private IItemManager manager;\r
+ private Store store;\r
+ private FileType fileType;\r
+ private Media mediaCubeMedia;\r
+ private Marker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, String transcoderAddress, String transcoderTemplateName,\r
+ String globalHiresSourcePath, String localLowresTargetPath, boolean deleteSource, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+\r
+ this.marker = jobRuntime.getSessionMarker();\r
+ this.manager = jobEngine.getItemManager();\r
+ this.store = check(manager.getCurrentLowresStore(), "lowres Store");\r
+ this.fileType = check(manager.getFileType(LOWRES_FILETYPE), "lowres FileType");\r
+ this.mediaCubeMedia = check(mediaCubeMedia, "mediaCubeMedia");\r
+ check(archiveItem, "archiveItem");\r
+ check(transcoderAddress, "transcoderAddress");\r
+ check(transcoderTemplateName, "transcoderTemplateName");\r
+ check(globalHiresSourcePath, "globalHiresSourcePath");\r
+ check(localLowresTargetPath, "localLowresTargetPath");\r
+\r
+ File sourceMediaFile = new File(archiveItem.getMediaFile());\r
+ logger.info("Transcoding {}", archiveItem.getMediaFile());\r
+ String sourceFileName = sourceMediaFile.getName();\r
+ Timecode timecode = new Timecode(mediaCubeMedia.getLength(), Type.PAL);\r
+\r
+ String details = String.format("%s (%s, %d bytes)", sourceFileName, timecode.toString(), sourceMediaFile.length());\r
+\r
+ StoreUri storeUri = store.getTargetStoreUri(RemoteStoreProtocol.LOCAL);\r
+ if (storeUri == null)\r
+ throw new Exception("Can not detect proxy folder.");\r
+\r
+ String webPath = storeUri.toString(true);\r
+\r
+ Path targetPath = null;\r
+ try {\r
+ String targetFileName = FilenameUtils.removeExtension(sourceFileName) + MP4EXT;\r
+ targetPath = Paths.get(localLowresTargetPath, targetFileName);\r
+ if (!targetPath.toFile().exists()) {\r
+ // jobRuntime.setDescription(String.format("%s: %s", jobRuntime.getDescription(), details));\r
+ jobRuntime.setDescription(String.format("%s transzkódolása", details));\r
+ String sourceFile = Paths.get(globalHiresSourcePath, sourceFileName).toString();\r
+ IFFAStransAPI api = new FFAStransAPI(transcoderAddress, p -> {\r
+ if (p <= 100)\r
+ jobRuntime.incrementProgress(p);\r
+ });\r
+\r
+ api.submit(transcoderTemplateName, sourceFile);\r
+ api.monitor(POLL_INTERVALL);\r
+ }\r
+\r
+ //a sikeres transzkod utan nem mindig van ott egybol a fajl\r
+ long started = System.currentTimeMillis();\r
+ while (!targetPath.toFile().exists()) {\r
+ long current = System.currentTimeMillis();\r
+ //max 5 perc varakozas\r
+ if (current - started > 5 * 60 * 1000)\r
+ throw new Exception("Transcode job target file access timed out");\r
+ Thread.sleep(POLL_INTERVALL);\r
+ }\r
+\r
+ postprocess(targetPath, webPath);\r
+\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ Message m = new ParameterizedMessage("{} átkódolás hiba: {}", sourceFileName, e.getMessage());\r
+ logger.error(marker, m);\r
+ throw new Exception(m.getFormattedMessage());\r
+ } finally {\r
+ try {\r
+ if (deleteSource && sourceMediaFile != null && sourceMediaFile.exists())\r
+ sourceMediaFile.delete();\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+ try {\r
+ if (deleteSource && targetPath != null && targetPath.toFile().exists())\r
+ Files.delete(targetPath);\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ private void postprocess(Path transcodedFilePath, String webPath) throws IOException {\r
+ Path lowresPath = null;\r
+ try {\r
+ String transcodedFileName = transcodedFilePath.getFileName().toString();\r
+ String targetPath = null;\r
+ if (transcodedFileName.indexOf(".") > 2) {\r
+ Path subdir = Paths.get(transcodedFileName.substring(0, 1), transcodedFileName.substring(1, 2), transcodedFileName.substring(2, 3));\r
+ EscortFiles.ensureUNCFolder(webPath, subdir.toString());\r
+ targetPath = Paths.get(subdir.toString(), transcodedFileName).toString();\r
+ } else {\r
+ targetPath = transcodedFileName;\r
+ }\r
+ lowresPath = Paths.get(webPath, targetPath);\r
+ int version = 1;\r
+ while (lowresPath.toFile().exists()) {\r
+ String fileName = transcodedFileName + version + MP4EXT;\r
+ lowresPath = Paths.get(lowresPath.toString().replace(transcodedFileName, fileName));\r
+ targetPath = targetPath.replace(transcodedFileName, fileName);\r
+ transcodedFileName = fileName;\r
+ version++;\r
+ }\r
+\r
+ Files.move(transcodedFilePath, lowresPath);\r
+ manager.createMediaFile(targetPath, fileType, store, mediaCubeMedia).add();\r
+ } catch (IOException e) {\r
+ logger.catching(e);\r
+ logger.error(marker, "A '{}' állomány mozgatása a '{}' helyre nem sikerült.", transcodedFilePath, lowresPath);\r
+ throw e;\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.util.List;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.jobengine.db.IItemManager;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.db.MediaFile;\r
+import user.jobengine.db.Store;\r
+import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
+import user.jobengine.server.steps.MetadataTypeDetector.MetadataType;\r
+\r
+public class UpdateGhostMediaDataStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private Marker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(Media mediaCubeMedia, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ marker = jobRuntime.getSessionMarker();\r
+\r
+ IItemManager manager = jobEngine.getItemManager();\r
+ //Refresh from db\r
+ List<MediaFile> mediaFiles = manager.getMedia(mediaCubeMedia.getId()).getMediaFiles();\r
+ if (mediaFiles != null && mediaFiles.size() == 2) {\r
+ MediaFile lowres = null;\r
+ MediaFile highres = null;\r
+\r
+ for (MediaFile mf : mediaFiles) {\r
+ if (mf.getStore().getSourceStoreUri(RemoteStoreProtocol.HTTP) != null)\r
+ lowres = mf;\r
+ else\r
+ highres = mf;\r
+ }\r
+\r
+ if (highres == null) {\r
+ logger.info(marker, "Nincs highres mediaId: {}", mediaCubeMedia.getId());\r
+ return null;\r
+ }\r
+ if (lowres == null) {\r
+ logger.info(marker, "Nincs lowres mediaId: {}", mediaCubeMedia.getId());\r
+ return null;\r
+ }\r
+\r
+ String id = MetadataTypeDetector.truncateExtension(highres.getRelativePath());\r
+ id = MetadataTypeDetector.truncateVersion(id);\r
+ boolean detect = MetadataTypeDetector.GuessMetadataType(id) == MetadataType.OctopusPlaceholder\r
+ || MetadataTypeDetector.GuessMetadataType(id) == MetadataType.OctopusStory;\r
+ if (!detect) {\r
+ logger.info(marker, "Nem bejátszó mediaId: {}, file: {}", mediaCubeMedia.getId(), highres.getRelativePath());\r
+ return null;\r
+ }\r
+\r
+ Store highresStore = manager.getSystemStore(false);\r
+ final long sourceMediaId = lowres.getId();\r
+ final long highresMediaFileId = highres.getId();\r
+ final String highresRealtivePath = highres.getRelativePath();\r
+\r
+ manager.executeQuery("SELECT mediaid FROM mediafile WHERE relativepath=? and storeid=? and id!=?", rs -> {\r
+ long mediaId = rs.getLong(1);\r
+ Media media = manager.getMedia(mediaId);\r
+ if (media.getMediaFilesCount() == 1) {\r
+ logger.info(marker, "Hiányzó szellem lowres hozzáadása {} alapján", media.getId());\r
+\r
+ MediaFile mf = (MediaFile) manager.get(MediaFile.class, sourceMediaId);\r
+ mf.setMedia(media);\r
+ mf.setId(0);\r
+ manager.add(mf);\r
+ media.setLength(mediaCubeMedia.getLength());\r
+ manager.modify(media);\r
+ }\r
+ return true;\r
+ }, st -> {\r
+ st.setString(1, highresRealtivePath);\r
+ st.setLong(2, highresStore.getId());\r
+ st.setLong(3, highresMediaFileId);\r
+ });\r
+\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+}\r
</variables>\r
</declarations>\r
<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.MetadataTransformStep" weight="1">\r
+ <calljobstep id="id1" type="MetadataTransformStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="archiveItem" />\r
</output>\r
</outputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.MediaToolStep" weight="1">\r
+ <calljobstep type="MediaToolStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="archiveItem" />\r
</input>\r
</inputs>\r
</calljobstep> \r
- <calljobstep id="id2" type="user.jobengine.server.steps.TSMBackupStep" weight="1">\r
+ <calljobstep id="id2" type="TSMBackupStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="archiveItem" />\r
</variables>\r
</declarations>\r
<commands>\r
- <calljobstep id="step1" type="user.jobengine.server.steps.ArchiveListBuilderStep" weight="1">\r
+ <calljobstep id="step1" type="ArchiveListBuilderStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="sourcePath" />\r
</outputs>\r
</calljobstep>\r
\r
- <calljobstep id="step2" type="user.jobengine.server.steps.ArchiveMaterialSubmitStep" weight="1">\r
+ <calljobstep id="step2" type="ArchiveMaterialSubmitStep.java" weight="1">\r
<inputs>\r
<input>\r
<variable name="archiveList" />\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<jobtemplate name="Felhasználói archiválás" useSessionLog="false">\r
+ <declarations>\r
+ <parameters>\r
+ <parameter name="sourcePath" type="java.lang.String" />\r
+ <parameter name="killDateDays" type="java.lang.Integer" />\r
+ <parameter name="limit" type="java.lang.Integer" />\r
+ </parameters>\r
+ </declarations>\r
+ <commands>\r
+ <calljobstep id="step1" type="ArchiveRecursive.java" weight="1">\r
+ <inputs>\r
+ <input>\r
+ <parameter name="sourcePath" />\r
+ </input>\r
+ <input>\r
+ <parameter name="killDateDays" />\r
+ </input>\r
+ <input>\r
+ <parameter name="limit" />\r
+ </input>\r
+ </inputs>\r
+ </calljobstep>\r
+ </commands>\r
+</jobtemplate>
\ No newline at end of file
</parameters>\r
</declarations>\r
<commands>\r
- <calljobstep type="user.jobengine.server.steps.BatchRetrieveForkStep" weight="1">\r
+ <calljobstep type="BatchRetrieveForkStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="basket" />\r
<parameters>\r
<parameter name="param" type="java.lang.Integer" />\r
</parameters>\r
- <variables>\r
- <variable name="var" type="java.lang.Integer" />\r
- </variables>\r
</declarations>\r
<commands>\r
<calljobstep remote="true" type="CancelableStep.java" weight="1" >\r
<parameter name="param" />\r
</input>\r
</inputs>\r
- <outputs>\r
- <output>\r
- <variable name="var" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep remote="true" type="CancelableStep.java" weight="1" >\r
- <inputs>\r
- <input>\r
- <variable name="var" />\r
- </input>\r
- </inputs>\r
</calljobstep>\r
</commands>\r
</jobtemplate>
\ No newline at end of file
</parameters>\r
</declarations>\r
<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.FileCopyStep" weight="1">\r
+ <calljobstep id="id1" type="FileCopyStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="sourceProtocol" />\r
</variables>\r
</declarations>\r
<commands>\r
- <calljobstep type="user.jobengine.server.steps.CreateArchiveItemStep" weight="1">\r
+ <calljobstep type="CreateArchiveItemStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="mediaCubeMedia" />\r
</output>\r
</outputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.TSMRestoreStep" weight="1">\r
+ <calljobstep type="TSMRestoreStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="mediaCubeMedia" />\r
</input>\r
</inputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.MediaToolStep" weight="1">\r
+ <calljobstep type="MediaToolStep.java" weight="1">\r
<inputs>\r
<input>\r
<variable name="archiveItem" />\r
</input>\r
</inputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.TranscodeFFAStranStep" weight="1">\r
+ <calljobstep type="TranscodeFFAStranStep.java" weight="1">\r
<inputs>\r
<input>\r
<variable name="archiveItem" />\r
</input>\r
</inputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.UpdateGhostMediaData" weight="1">\r
+ <calljobstep type="UpdateGhostMediaDataStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="mediaCubeMedia" />\r
</parameters>\r
</declarations>\r
<commands>\r
- <calljobstep id="id1" type="user.jobengine.server.steps.CleanupMountedLocationStep" weight="1">\r
+ <calljobstep id="id1" type="CleanupMountedLocationStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="sourcePath" />\r
</parameters>\r
</declarations>\r
<commands>\r
- <calljobstep id="step1" type="user.jobengine.server.steps.HSMMigrateStep" weight="1">\r
+ <calljobstep id="step1" type="HSMMigrateStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="sourceLocation" />\r
</variables>\r
</declarations>\r
<commands>\r
- <calljobstep type="user.jobengine.server.steps.OutputPathAndNameSelectorStep" weight="1">\r
+ <calljobstep type="OutputPathAndNameSelectorStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="localRetrievePath" />\r
</output>\r
</outputs> \r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.TSMExtendedRetrieveStep" weight="1">\r
+ <calljobstep type="TSMExtendedRetrieveStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="archivedMedia" />\r
</input>\r
</inputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.MXFCutterStep" weight="1">\r
+ <calljobstep type="MXFCutterStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="archivedMedia" />\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<jobtemplate name="Archivált anyag visszatöltése" multiInstance="true" useSessionLog="false">\r
+ <declarations>\r
+ <parameters>\r
+ <parameter name="mediaId" type="java.lang.Long" />\r
+ <parameter name="targetPath" type="java.lang.String" />\r
+ </parameters>\r
+ </declarations>\r
+ <commands>\r
+ <calljobstep type="TSMSimpleRestoreStep.java" weight="1">\r
+ <inputs>\r
+ <input>\r
+ <parameter name="mediaId" />\r
+ </input>\r
+ <input>\r
+ <parameter name="targetPath" />\r
+ </input>\r
+ </inputs>\r
+ </calljobstep>\r
+ </commands>\r
+</jobtemplate>
\ No newline at end of file
</variables>\r
</declarations>\r
<commands>\r
- <calljobstep type="user.jobengine.server.steps.CreateMissingLowresStep" weight="1">\r
+ <calljobstep type="CreateMissingLowresStep.java" weight="1">\r
<inputs>\r
<input>\r
<parameter name="localHiresPath" />\r
</output>\r
</outputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.TSMRestoreStep" weight="1">\r
+ <calljobstep type="TSMRestoreStep.java" weight="1">\r
<inputs>\r
<input>\r
<variable name="mediaCubeMedia" />\r
</input>\r
</inputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.MediaToolStep" weight="1">\r
+ <calljobstep type="MediaToolStep.java" weight="1">\r
<inputs>\r
<input>\r
<variable name="archiveItem" />\r
</input>\r
</inputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.TranscodeFFAStranStep" weight="1">\r
+ <calljobstep type="TranscodeFFAStranStep.java" weight="1">\r
<inputs>\r
<input>\r
<variable name="archiveItem" />\r
</input>\r
</inputs>\r
</calljobstep>\r
- <calljobstep type="user.jobengine.server.steps.UpdateGhostMediaData" weight="1">\r
+ <calljobstep type="UpdateGhostMediaDataStep.java" weight="1">\r
<inputs>\r
<input>\r
<variable name="mediaCubeMedia" />\r
--- /dev/null
+@echo off\r
+if exist tmp rmdir tmp /s /q\r
+mkdir tmp\r
+java ^\r
+-Dclean ^\r
+-Dorg.eclipse.epp.logging.aeri.skipReports=true ^\r
+-Declipse.ignoreApp=true ^\r
+-Dosgi.noShutdown=true ^\r
+-Dlog4j.configurationFile=configuration/log4j2.xml ^\r
+-Djetty.home=configuration/jetty ^\r
+-Djetty.etc.config.urls=jetty.xml,jetty-ssl.xml,jetty-ssl-context.xml,jetty-http.xml,jetty-https.xml ^\r
+-Djava.io.tmpdir=tmp ^\r
+-jar plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar ^\r
+-Xms512m ^\r
+-Xmx1024m ^\r
+-console 5555\r
--- /dev/null
+rm -fr tmp/*
+rm -fr configuration/org.eclipse.osgi
+export DSMI_CONFIG=/opt/mediacube/configuration/dsm.opt
+export DSMI_DIR=/opt/tivoli/tsm/client/api/bin64
+export DSMI_LOG=/opt/mediacube/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 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
+export PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64/bin:$PATH
+java \
+-Dclean \
+-Dorg.eclipse.epp.logging.aeri.skipReports=true \
+-Declipse.ignoreApp=true \
+-Dosgi.noShutdown=true \
+-Dlog4j.configurationFile=configuration/log4j2.xml \
+-Djetty.home=configuration/jetty \
+-Djetty.etc.config.urls=jetty.xml,jetty-ssl.xml,jetty-ssl-context.xml,jetty-http.xml,jetty-https.xml \
+-Djava.io.tmpdir=tmp \
+-jar plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar \
+-Xms512m \
+-Xmx1024m \
+-console 5555
+++ /dev/null
-winscp.com /command\r
-\r
- <argument>"echo STARTING DEPLOY TO: ${remote.address}"</argument>\r
- <argument>"open ${remote.address} -hostkey=""${remote.hostkey}"""</argument>\r
- <argument>"lcd ${local.location}/plugins"</argument>\r
- <argument>"cd ${remote.location}/plugins"</argument>\r
- <argument>"synchronize remote"</argument>\r
- <argument>"lcd ${local.location}/configuration"</argument>\r
- <argument>"cd ${remote.location}/configuration"</argument>\r
- <argument>"synchronize remote -filemask=config.ini"</argument>\r
- <argument>"exit"</argument>\r
-</arguments>\r
\r
import user.commons.CalendarUtils;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
import user.commons.octopus.OctopusAPI;\r
private static final String UTF_8 = "utf-8";\r
private static final String JSON_EXT = ".json";\r
private static final String XML_EXT = ".xml";\r
- private static final String DURATION = "duration";\r
private static final String MXFEXT = ".MXF";\r
- private static final String NEXIOCLIPS = "nexioclips";\r
- private static final String LONGNAMEID = "longnameid";\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
private static final String ID = "id";\r
private static final String MEDIATYPE = "Hír bejátszó";\r
private OctopusAPI octopusAPI;\r
logger.error(systemMarker, "Az adatbáziskezelő réteg nem elérhető.");\r
throw new NullPointerException("Internal error, missing ItemManager reference.");\r
}\r
- String nexioHost = System.getProperty("nexio.host");\r
- if (StringUtils.isBlank(nexioHost)) {\r
+ if (StringUtils.isBlank(NEXIO_HOST)) {\r
logger.error(systemMarker, "A 'nexio.host' rendszer paraméter nem található.");\r
throw new NullPointerException("System is not configured properly, 'jobengine.selenio.address' startup parameter missing.");\r
}\r
this.nexioKillDateDays = nexioKillDateDays;\r
this.nexioAgency = nexioAgency;\r
\r
- sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
sourceUri.setPortNumber(nexioPort);\r
sourceUri.setUserName(nexioUserName);\r
sourceUri.setPassword(nexioPassword);\r
\r
import java.io.File;\r
import java.io.IOException;\r
-import java.lang.management.ManagementFactory;\r
-import java.lang.management.ThreadInfo;\r
-import java.lang.management.ThreadMXBean;\r
import java.lang.reflect.Method;\r
import java.nio.file.DirectoryStream;\r
import java.nio.file.FileStore;\r
import groovy.lang.GroovyClassLoader;\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.IConfiguration;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.mediaarea.StreamKind;\r
import user.commons.mediatool.Timecode;\r
import user.commons.mediatool.Timecode.Type;\r
\r
@Test\r
public void test99998() throws Exception {\r
- ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();\r
-\r
- for (Long threadID : threadMXBean.getAllThreadIds()) {\r
- ThreadInfo info = threadMXBean.getThreadInfo(threadID);\r
- System.out.println("Thread name: " + info.getThreadName());\r
- System.out.println("Thread State: " + info.getThreadState());\r
- long cpuTime = threadMXBean.getThreadCpuTime(threadID);\r
- System.out.println(String.format("CPU time: %.2f %%", cpuTime == 0 ? cpuTime : cpuTime * 100 / 1000000000d));\r
- }\r
+ System.setProperty("user.dir", "c:/_workspace/USER/MediaCube/deploy/");\r
+ IConfiguration conf = SystemConfiguration.getInstance();\r
+\r
+ String za = conf.value("z.a");\r
+ System.out.println(za);\r
+\r
+ int zb = conf.value("z.b");\r
+ System.out.println(zb);\r
+\r
+ int zc = conf.value("z.c", 2);\r
+ System.out.println(zc);\r
+\r
+ String zc1 = conf.value("z.c", "2");\r
+ System.out.println(zc1);\r
+\r
+ int zc2 = conf.value("z.d", 100);\r
+ System.out.println(zc2);\r
+\r
+ List<String> k = conf.value("k");\r
+ List<Integer> l = conf.value("l");\r
}\r
}\r
import com.ibm.nosql.json.api.QueryBuilder;\r
\r
import user.commons.ListUtils;\r
-import user.commons.logging.LogUtils;\r
import user.commons.nosql.NoSQLUtils;\r
import user.jobengine.db.IItemManager;\r
import user.jobengine.db.Item;\r
// System.setProperty("jobengine.nosql.db.user", "db2admin");\r
// System.setProperty("jobengine.nosql.db.password", "password");\r
System.setProperty("nexio.host", "10.10.1.55");\r
- System.setProperty(ItemManager.DBURL, "jdbc:db2://10.228.212.42:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty(ItemManager.DBUSERNAME, "blobtest");\r
- System.setProperty(ItemManager.DBPASSWORD, "blobtest");\r
- System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
+ // System.setProperty(ItemManager.DBURL, "jdbc:db2://10.228.212.42:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty(ItemManager.DBUSERNAME, "blobtest");\r
+ // System.setProperty(ItemManager.DBPASSWORD, "blobtest");\r
// System.setProperty(ItemManager.DBURL,\r
\r
manager = new ItemManager();\r
\r
@BeforeClass\r
static public void setUpConnection() {\r
- System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.11.1.90:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty("jobengine.nosql.db.user", "db2admin");\r
- System.setProperty("jobengine.nosql.db.password", "password");\r
- System.setProperty(ItemManager.DBURL, "jdbc:db2://10.11.1.90:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
- System.setProperty(ItemManager.DBPASSWORD, "password");\r
+ // System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.11.1.90:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty("jobengine.nosql.db.user", "db2admin");\r
+ // System.setProperty("jobengine.nosql.db.password", "password");\r
+ // System.setProperty(ItemManager.DBURL, "jdbc:db2://10.11.1.90:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
+ // System.setProperty(ItemManager.DBPASSWORD, "password");\r
manager = new ItemManager();\r
manager.connect();\r
}\r
import org.junit.BeforeClass;\r
import org.junit.Test;\r
\r
-import user.commons.logging.LogUtils;\r
import user.jobengine.db.IItemManager;\r
import user.jobengine.db.IResultSetConsumer;\r
import user.jobengine.db.IStatementDecorator;\r
// System.setProperty("jobengine.octopus.rundowns.name", "test_rundowns");\r
// System.setProperty("jobengine.octopus.stories.name", "test_stories");\r
// System.setProperty("jobengine.octopus.storyfolders.name", "test_storyfolders");\r
- System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
- System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
- System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
-\r
- System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty("jobengine.nosql.db.user", "db2admin");\r
- System.setProperty("jobengine.nosql.db.password", "password");\r
- System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
- System.setProperty(ItemManager.DBPASSWORD, "password");\r
- System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
+ // System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
+ // System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
+ // System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
+ //\r
+ // System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty("jobengine.nosql.db.user", "db2admin");\r
+ // System.setProperty("jobengine.nosql.db.password", "password");\r
+ // System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
+ // System.setProperty(ItemManager.DBPASSWORD, "password");\r
// System.setProperty(ItemManager.DBURL,\r
\r
manager = new ItemManager();\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<Configuration status="INFO">\r
+ <Appenders>\r
+ <Console name="LogToConsole" target="SYSTEM_OUT">\r
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>\r
+ </Console>\r
+ </Appenders>\r
+ <Loggers>\r
+ <Root level="INFO">\r
+ <AppenderRef ref="LogToConsole"/>\r
+ </Root>\r
+ </Loggers>\r
+</Configuration>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<Configuration status="INFO">\r
+ <Appenders>\r
+ <Console name="LogToConsole" target="SYSTEM_OUT">\r
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>\r
+ </Console>\r
+ </Appenders>\r
+ <Loggers>\r
+ <Root level="INFO">\r
+ <AppenderRef ref="LogToConsole"/>\r
+ </Root>\r
+ </Loggers>\r
+</Configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>\r
<classpath>\r
<classpathentry kind="src" path="src"/>\r
- <classpathentry excluding="obsolate" kind="src" path="obsolate"/>\r
<classpathentry kind="src" path="amc"/>\r
<classpathentry kind="src" path="mediavivantis"/>\r
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
public class FileValidatorStep extends JobStep {\r
private static final String COLORSPACE = "COLORSPACE";\r
private static final Logger logger = LogManager.getLogger();\r
- private static final String testSimulate = System.getProperty("test.simulate");\r
\r
@StepEntry\r
public Object[] execute(StoreUri sourceStoreUri, String fileName, long expectedFrameNumber, long expectedSize, String exceptedColorSpace, String escortFile)\r
\r
public class HarrisMissingMaterialCheckerStep extends JobStep {\r
private static final Logger logger = LogManager.getLogger(HarrisMissingMaterialCheckerStep.class);\r
- private static final String lineFormat = System.getProperty("harris.vic.lineformat",\r
- "A TTTTTTTT LLLLLLLLLLL MMMMMMMMMMMMMMMMMMMMMMM X DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD");\r
- private static final String validTypeCodes = System.getProperty("harris.vic.validtypecodes", "SPACE,E");\r
- private static final String appendExtension = System.getProperty("missingmaterial.appendextension", ".mxf");\r
+ private static final String lineFormat = "A TTTTTTTT LLLLLLLLLLL MMMMMMMMMMMMMMMMMMMMMMM X DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD";\r
+ private static final String validTypeCodes = "SPACE,E";\r
+ private static final String appendExtension = ".mxf";\r
\r
@StepEntry\r
public Object[] execute(BasicDBList vicFiles, String escortStoreName, String targetStoreName, String targetProtocol) throws Exception {\r
import org.w3c.dom.NodeList;\r
import org.xml.sax.InputSource;\r
\r
+import user.commons.configuration.SystemConfiguration;\r
+\r
public class PBQuery {\r
public class MMMedia {\r
private final String name;\r
private static final int SOCKET_TIMEOUT = 5000;\r
public static final String GETMEDIAUSAGEBYUTRANGE = "/getMediaUsageByUTRange";\r
public static final String GETCUSTOMVIEW = "/getCustomView";\r
-\r
- public static final String SOAP_TEMPLATE_ROOT = System.getProperty("jobengine.soap.template.root", "/opt/mediacube/configuration/soap");\r
+ public static final String SOAP_TEMPLATE_ROOT = SystemConfiguration.getInstance().value("services.peablebeach.template-root", "configuration/soap");\r
\r
private static Document toDocument(String xml) {\r
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r
\r
public class PeableBeachMissingMaterialCheckerStep extends JobStep {\r
private static final Logger logger = LogManager.getLogger();\r
- private static final String appendExtension = System.getProperty("missingmaterial.appendextension", ".mxf");\r
+ private static final String appendExtension = ".mxf";\r
\r
@StepEntry\r
public Object[] execute(String escortStoreName, BasicDBList lookupStoreNames, String targetStoreName, String targetProtocol, String primaryEndPoint,\r
}\r
/*\r
if (1 == 1) {\r
-\r
+ \r
logger.info(getMarker(), "Kikapcsolva");\r
return null;\r
}\r
\r
public class RegisterUserRestoreStep extends JobStep {\r
private static final Logger logger = LogManager.getLogger();\r
- private static final String appendExtension = System.getProperty("missingmaterial.appendextension", ".mxf");\r
+ private static final String appendExtension = ".mxf";\r
\r
@StepEntry\r
public Object[] execute(String escortStoreName, String targetStoreName, List<ArchivedMedia> basket, String recipient) throws Exception {\r
\r
public class RegisterVODRestoreStep extends JobStep {\r
private static final Logger logger = LogManager.getLogger();\r
- private static final String appendExtension = System.getProperty("missingmaterial.appendextension", ".mxf");\r
+ private static final String appendExtension = ".mxf";\r
\r
@StepEntry\r
public Object[] execute(String targetStoreName, BasicDBList basket) throws Exception {\r
String relativeTargetPath = item.getString("path");\r
\r
Media media = getManager().getMedia(mediaTitle);\r
- \r
+\r
if (media == null) {\r
logger.error("Media {} is not available", mediaTitle);\r
return;\r
}\r
- \r
+\r
String fileName = media.getTitle();\r
if (StringUtils.isNotBlank(appendExtension))\r
fileName += appendExtension;\r
public class TransferStep extends JobStep {\r
private static final String DOT_PART = ".part";\r
private static final Logger logger = LogManager.getLogger();\r
- private static final boolean simulateTransferToTSM = Boolean.parseBoolean(System.getProperty("test.simulate.transfer.tsm", "false"));\r
protected StoreUri targetStoreUri;\r
\r
@StepEntry\r
String description = String.format("%s -> %s : %s", sourceStore.getName(), targetStore.getName(), sourceFileName);\r
getJobRuntime().setDescription(description);\r
\r
- //logger.info(getSessionMarker(), String.valueOf(isSimulateTSMWrite(sourceStoreUri, targetStoreUri)));\r
- if (isSimulateTSMWrite(sourceStoreUri, targetStoreUri)) {\r
- logger.info(getMarker(), "Skipping real TSM write of {} from {} to {}", sourceFileName, sourceStoreUri, targetStoreUri);\r
- return null;\r
- }\r
-\r
sourceStoreUri.addProgressListener(e -> setProgress(e.getProgress()));\r
\r
this.targetStoreUri = getTargetStoreUri();\r
return DOT_PART;\r
}\r
\r
- private boolean isSimulateTSMWrite(StoreUri sourceStoreUri, StoreUri targetStoreUri) {\r
- return simulateTransferToTSM && (RemoteStoreProtocol.TSM.equals(targetStoreUri.getProtocol()));\r
- }\r
-\r
private void tryCopy(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
String currentTargetFileName = targetFileName;\r
\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<executors>\r
- <executor className="CancelableStep.java" maxConcurrent="10" isRemote="true" />\r
- <executor className="TestForkCancelableStep.java" maxConcurrent="1" isRemote="false" />\r
-</executors>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate multiInstance="true" useSessionLog="false">\r
-<declarations>\r
- <parameters>\r
- <parameter name="itemID" type="java.lang.Long"/>\r
- </parameters>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="step3" type="user.jobengine.server.steps.FakeStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="itemID" />\r
- </input>\r
- </inputs>\r
- <commands>\r
- <calljobstep id="step2" type="user.jobengine.server.steps.FakeStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="itemID" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
- </commands>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate multiInstance="true" name="Fake" useSessionLog="false">\r
-<declarations>\r
- <parameters>\r
- <parameter name="itemID" type="java.lang.Long"/>\r
- </parameters>\r
- <parameters>\r
- <parameter name="iter" type="java.lang.Iterable"/>\r
- </parameters>\r
- <variables>\r
- <variable name="resultID" type="java.lang.Long"/>\r
- <variable name="resultID1" type="java.lang.Long"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <calljobstep type="FakeStep.java" weight="5" forEach="iter">\r
- <inputs>\r
- <input>\r
- <parameter name="itemID" />\r
- </input>\r
- <input>\r
- <parameter name="iter" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="resultID" />\r
- </output>\r
- <output>\r
- <variable name="resultID1" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- <calljobstep type="MergeStep.java" weight="1">\r
- <inputs>\r
- <input>\r
- <variable name="resultID" />\r
- </input>\r
- <input>\r
- <variable name="resultID1" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate multiInstance="true" name="Fake" useSessionLog="false">\r
-<declarations>\r
- <parameters>\r
- <parameter name="itemID" type="java.lang.Long"/>\r
- </parameters>\r
- <variables>\r
- <variable name="resultID" type="java.lang.Long"/>\r
- <variable name="resultID1" type="java.lang.Long"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <calljobstep type="FakeStep.java" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="itemID" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="resultID" />\r
- </output>\r
- <output>\r
- <variable name="resultID1" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
-</commands>\r
-</jobtemplate>
\ No newline at end of file
+++ /dev/null
-package obsolate;\r
-\r
-import java.text.ParseException;\r
-import java.text.SimpleDateFormat;\r
-import java.util.Date;\r
-import java.util.List;\r
-\r
-import org.apache.commons.lang.StringUtils;\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.commons.RemoteFile;\r
-import user.commons.StoreUri;\r
-import user.commons.remotestore.RemoteStoreProtocol;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class DeleteMaterialsStep extends JobStep {\r
- private static final Logger logger = LogManager.getLogger();\r
- private static final String STATUSFOLDER = ".STATUS";\r
- private static final String KILLDATE = ".killdate";\r
- private static final String MXFFILTER = "*.mxf";\r
- private StoreUri sourceUri;\r
-\r
- @StepEntry\r
- public Object[] execute(String sourceFolder, String userName, String password, IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
- if (StringUtils.isBlank(sourceFolder)) {\r
- logger.error(getMarker(), "A folyamat 'sourceFolder' bemeneti paramétere üres.");\r
- throw new NullPointerException("System is not configured properly, 'sourceFolder' input parameter missing.");\r
- }\r
-\r
- IItemManager manager = jobEngine.getItemManager();\r
- sourceUri = manager.createStoreUri(RemoteStoreProtocol.SMB, sourceFolder);\r
- sourceUri.setUserName(userName);\r
- sourceUri.setPassword(password);\r
- try {\r
- sourceUri.getRemoteFiles(MXFFILTER, f -> processPathItem(f));\r
- } catch (Exception e) {\r
- logger.error(getMarker(), "Általános folyamat hiba. A rendszer hibaüzenete: {}", e.getMessage());\r
- }\r
- return null;\r
- }\r
-\r
- private boolean processPathItem(RemoteFile remoteFile) {\r
- //KILLDATE\r
- String killDateFileName = String.format("%s.*%s", remoteFile.getName(), KILLDATE);\r
- logger.debug("Checking {}", killDateFileName);\r
- List<RemoteFile> remoteKillDateFiles = null;\r
- try {\r
- sourceUri.setCurrentPath(STATUSFOLDER);\r
- remoteKillDateFiles = sourceUri.getRemoteFiles(killDateFileName);\r
- } catch (Exception e) {\r
- //logger.error(getMarker(), "A {} fájl 'killdate' állományai nem kérdezhetőek le. A rendszer hibaüzenete: {}", remoteFile.getName(), e.getMessage());\r
- return true;\r
- }\r
-\r
- if (remoteKillDateFiles == null || remoteKillDateFiles.size() == 0)\r
- return true;\r
-\r
- if (remoteKillDateFiles.size() != 1) {\r
- logger.error(getMarker(), "A {} fájlhoz több 'killdate' állomány található, így nem eldönthető törölhető e.", remoteFile.getName());\r
- return true;\r
- }\r
- RemoteFile killDateFile = remoteKillDateFiles.get(0);\r
- String strKillDate = killDateFile.getName().toLowerCase().replace(remoteFile.getName().toLowerCase() + ".", "").replace(KILLDATE.toLowerCase(), "");\r
- if (!StringUtils.isNumeric(strKillDate)) {\r
- logger.error(getMarker(), "A {} fájl 'killdate' állománya hibás formátumú, az dátum helyett ez áll: '{}'.", remoteFile.getName(), strKillDate);\r
- return true;\r
- }\r
-\r
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");\r
- Date killDate = null;\r
- try {\r
- killDate = dateFormat.parse(strKillDate);\r
- } catch (ParseException e) {\r
- logger.error(getMarker(), "A {} fájl 'killdate' állománya hibás formátumú, a {} karaktersorozat nem konvertálható dátummá.", remoteFile.getName(),\r
- strKillDate);\r
- return true;\r
- }\r
-\r
- if (killDate.after(new Date()))\r
- return true;\r
-\r
- try {\r
- sourceUri.setCurrentPath(null);\r
- sourceUri.delete(remoteFile);\r
- } catch (Exception e) {\r
- logger.error(getMarker(), "A {} fájl nem törölhető. A rendszer hibaüzenete: {}", remoteFile.getName(), e.getMessage());\r
- return true;\r
- }\r
-\r
- try {\r
- sourceUri.setCurrentPath(STATUSFOLDER);\r
- sourceUri.delete(killDateFile);\r
- } catch (Exception e) {\r
- logger.error(getMarker(), "A {} 'killdate' állománya nem törölhető. A rendszer hibaüzenete: {}", killDateFile.getName(), e.getMessage());\r
- }\r
-\r
- logger.info(getMarker(), "A {} fájl törlése a {} killdate alapján sikeresen megtörtént.", remoteFile.getName(), killDateFile.getName());\r
-\r
- return true;\r
- }\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.util.UUID;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.commons.RemoteFile;\r
-import user.commons.StoreUri;\r
-import user.commons.remotestore.IProgressEventListener;\r
-import user.commons.remotestore.IStatusEventListener;\r
-import user.commons.remotestore.ProgressEvent;\r
-import user.commons.remotestore.RemoteStoreProtocol;\r
-import user.commons.remotestore.StatusEvent;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.Store;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.JobEngineException;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class DownloadStep extends JobStep {\r
- private static final Logger logger = LogManager.getLogger();\r
-\r
- StoreUri sourceUri = null;\r
-\r
- @StepEntry\r
- public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, IJobEngine jobEngine,\r
- IJobRuntime jobRuntime) throws Exception {\r
- RemoteFile result = null;\r
- final IJobRuntime runtime = jobRuntime;\r
- IItemManager manager = jobEngine.getItemManager();\r
- Store systemStore = manager.getSystemStore(false);\r
-\r
- if (sourceStoreUri.getStoreId() == systemStore.getId()) {\r
- logger.info("File is available on system store: " + sourceFileName);\r
- sourceUri = systemStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL);\r
- result = sourceUri.getRemoteFile(sourceFileName);\r
- if (result == null)\r
- throw new JobEngineException("RemoteFile is null");\r
- runtime.incrementProgress(100);\r
- } else {\r
- sourceUri = sourceStoreUri;\r
- StoreUri target = systemStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL);\r
- if (target == null)\r
- throw new JobEngineException("Target StoreUri is null");\r
-\r
- sourceUri.addProgressListener(new IProgressEventListener() {\r
- @Override\r
- public void progressChanged(ProgressEvent evt) {\r
- runtime.incrementProgress(evt.getProgress());\r
- logger.info("Progress:" + evt.getProgress());\r
- }\r
- });\r
- sourceUri.addStatusListener(new IStatusEventListener() {\r
- @Override\r
- public void statusChanged(StatusEvent evt) {\r
- evt.setCancel(!canContinue());\r
- }\r
- });\r
-\r
- result = sourceUri.transferFrom(target, sourceFileName, UUID.randomUUID().toString());\r
- }\r
- return new Object[] { result };\r
- }\r
-\r
- @Override\r
- public void cleanup() {\r
- if (sourceUri != null)\r
- sourceUri.clearListeners();\r
- }\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import user.commons.ItemSource;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.Scene;\r
-import user.jobengine.db.SceneContent;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class GetItemSourcesStep extends JobStep {\r
-\r
- @StepEntry\r
- public Object[] execute(List<String> sourceFileName, long sceneId, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
- List<ItemSource> result = new ArrayList<ItemSource>();\r
- final IJobRuntime runtime = jobRuntime;\r
- IItemManager manager = jobEngine.getItemManager();\r
- if (manager != null && sceneId != 0 && sourceFileName == null) {\r
- Scene scene = (Scene) manager.get(Scene.class, sceneId);\r
- if (scene != null) {\r
- for (SceneContent sceneContent : scene.getSceneContents()) {\r
- ItemSource itemSource = new ItemSource();\r
- // itemSource.setName(sceneContent.getShot().getMedia().getMediaFiles().get(0).getRelativePath());\r
- itemSource.setId(sceneContent.getShot().getInPoint());\r
- itemSource.setId(sceneContent.getShot().getOutPoint());\r
- result.add(itemSource);\r
- }\r
- }\r
- } else {\r
- if (sourceFileName != null) {\r
- ItemSource itemSource = new ItemSource();\r
- // itemSource.setName(sourceFileName);\r
- result.add(itemSource);\r
- }\r
- }\r
- runtime.incrementProgress(100);\r
- return new Object[] { result };\r
- }\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.util.List;\r
-\r
-import user.jobengine.db.FileType;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.Item;\r
-import user.jobengine.db.Media;\r
-import user.jobengine.db.MediaFile;\r
-import user.jobengine.db.Store;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class ImportWriteDataToDBStep extends JobStep {\r
- \r
- @StepEntry\r
- public Object[] execute(Item item, List<Media> medias, IJobEngine jobEngine) {\r
- try {\r
- IItemManager manager = jobEngine.getItemManager(); \r
- if (manager != null) {\r
- configure(manager, item, medias); \r
- item.add(); \r
- }\r
- } catch (Exception e) {\r
- e.printStackTrace();\r
- }\r
- Object[] result = new Object[]{ item };\r
- return result;\r
- }\r
- \r
- private void configure(IItemManager manager, Item item, List<Media> medias) {\r
- Store store = manager.getStore("Arch�vum gyorst�r");\r
- item.setMedias(medias);\r
- if (medias != null) {\r
- for (Media media : medias) {\r
- FileType fileType = manager.getFileType(media.getTitle());\r
- if (fileType == null)\r
- fileType = manager.getFileType("bin�ris");\r
- List<MediaFile> files = media.getMediaFiles();\r
- for (MediaFile file: files) {\r
- file.setFileType(fileType);\r
- file.setStoreId(store.getId());\r
- String relativePath = file.getRelativePath();\r
- String name = relativePath.substring(relativePath.lastIndexOf('\\') + 1);\r
- file.setRelativePath(item.getHouseId()+ "/" + name);\r
- }\r
- }\r
- }\r
- }\r
-\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.util.List;\r
-\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.Media;\r
-import user.jobengine.db.MediaFile;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.JobEngineException;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class MediaDBWriterStep extends JobStep {\r
- \r
- @StepEntry\r
- public Object[] execute(long itemId, Media media, List<MediaFile> mediaFiles, IJobEngine jobEngine) throws Exception {\r
- if (itemId == 0)\r
- throw new JobEngineException("Item ID can't be 0.");\r
- if (media == null)\r
- throw new JobEngineException("Media can't be null.");\r
-\r
- IItemManager manager = jobEngine.getItemManager();\r
- media.setPersister(manager);\r
- media.setItemId(itemId);\r
- media.setMediaFiles(mediaFiles);\r
- media.setIsPartialEnabled(true);\r
- media.add();\r
- return null;\r
- }\r
-\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.util.UUID;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.commons.RemoteFile;\r
-import user.commons.StoreUri;\r
-import user.commons.remotestore.IProgressEventListener;\r
-import user.commons.remotestore.IStatusEventListener;\r
-import user.commons.remotestore.ProgressEvent;\r
-import user.commons.remotestore.RemoteStoreProtocol;\r
-import user.commons.remotestore.StatusEvent;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.MediaFile;\r
-import user.jobengine.db.Store;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.JobEngineException;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class MediaDownloadStep extends JobStep {\r
- private static final Logger logger = LogManager.getLogger();\r
-\r
- StoreUri sourceUri = null;\r
-\r
- @StepEntry\r
- public Object[] execute(MediaFile mediaFile, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
- RemoteFile result = null;\r
- final IJobRuntime runtime = jobRuntime;\r
- IItemManager manager = jobEngine.getItemManager();\r
- Store systemStore = manager.getSystemStore(false);\r
-\r
- if (mediaFile.getStore().getId() == systemStore.getId()) {\r
- logger.info("File is available on system store");\r
- sourceUri = systemStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL);\r
- result = sourceUri.getRemoteFile(mediaFile.getRelativePath());\r
- if (result == null)\r
- throw new JobEngineException("RemoteFile is null");\r
- runtime.incrementProgress(100);\r
- } else {\r
- sourceUri = mediaFile.getStore().getSourceStoreUri(RemoteStoreProtocol.FTP);\r
- result = sourceUri.getRemoteFile(mediaFile.getRelativePath());\r
- StoreUri target = systemStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL);\r
- if (target == null)\r
- throw new JobEngineException("Target StoreUri is null");\r
-\r
- sourceUri.addProgressListener(new IProgressEventListener() {\r
- @Override\r
- public void progressChanged(ProgressEvent evt) {\r
- runtime.incrementProgress(evt.getProgress());\r
- logger.info("Progress:" + evt.getProgress());\r
- }\r
- });\r
- sourceUri.addStatusListener(new IStatusEventListener() {\r
- @Override\r
- public void statusChanged(StatusEvent evt) {\r
- evt.setCancel(!canContinue());\r
- }\r
- });\r
-\r
- result = sourceUri.transferFrom(target, result, UUID.randomUUID().toString());\r
- }\r
- return new Object[] { result };\r
- }\r
-\r
- @Override\r
- public void cleanup() {\r
- if (sourceUri != null)\r
- sourceUri.clearListeners();\r
- }\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.util.List;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.commons.RemoteFile;\r
-import user.commons.StoreUri;\r
-import user.commons.remotestore.IProgressEventListener;\r
-import user.commons.remotestore.IStatusEventListener;\r
-import user.commons.remotestore.ProgressEvent;\r
-import user.commons.remotestore.RemoteStoreProtocol;\r
-import user.commons.remotestore.StatusEvent;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.MediaFile;\r
-import user.jobengine.db.Store;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class MediaUploadStep extends JobStep {\r
- private static final Logger logger = LogManager.getLogger();\r
-\r
- StoreUri sourceUri = null;\r
-\r
- @StepEntry\r
- public Object[] execute(StoreUri targetUri, List<MediaFile> mediaFiles, IJobEngine jobEngine,\r
- IJobRuntime jobRuntime) throws Exception {\r
- IItemManager manager = jobEngine.getItemManager();\r
- Store lowresStore = manager.getSystemStore(true);\r
- MediaFile currentMediaFile = null;\r
- if (mediaFiles != null) {\r
- for (MediaFile mediaFile : mediaFiles) {\r
- if (mediaFile.getStoreId() == lowresStore.getId()) {\r
- currentMediaFile = mediaFile;\r
- break;\r
- }\r
-\r
- }\r
- }\r
-\r
- if (currentMediaFile != null) {\r
- Store sourceStore = currentMediaFile.getStore();\r
- sourceUri = sourceStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL);\r
- if (sourceUri == null)\r
- sourceUri = sourceStore.getSourceStoreUri(RemoteStoreProtocol.FTP);\r
- if (sourceUri != null) {\r
- final IJobRuntime runtime = jobRuntime;\r
- sourceUri.addProgressListener(new IProgressEventListener() {\r
- @Override\r
- public void progressChanged(ProgressEvent evt) {\r
- runtime.incrementProgress(evt.getProgress());\r
- logger.info("Progress:" + evt.getProgress());\r
- }\r
- });\r
- sourceUri.addStatusListener(new IStatusEventListener() {\r
- @Override\r
- public void statusChanged(StatusEvent evt) {\r
- evt.setCancel(!canContinue());\r
- }\r
- });\r
-\r
- RemoteFile remoteFile = sourceUri.getRemoteFile(currentMediaFile.getRelativePath());\r
- sourceUri.transferFrom(targetUri, remoteFile, currentMediaFile.getRelativePath());\r
- }\r
- }\r
- return null;\r
- }\r
-\r
- @Override\r
- public void cleanup() {\r
- if (sourceUri != null)\r
- sourceUri.clearListeners();\r
- }\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.commons.nexio.NexioDataMiner;\r
-import user.commons.remotestore.IProgressEventListener;\r
-import user.commons.remotestore.ProgressEvent;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class NexioDataMinerStep extends JobStep {\r
- private static final Logger logger = LogManager.getLogger();\r
- private IProgressEventListener progressListener;\r
-\r
- @StepEntry\r
- public Object[] execute(IJobEngine jobEngine, final IJobRuntime jobRuntime) {\r
- NexioDataMiner dataMiner = null;\r
- try {\r
- progressListener = createListener(jobRuntime);\r
- dataMiner = new NexioDataMiner();\r
- dataMiner.addProgressListener(progressListener);\r
- dataMiner.run();\r
- } catch (Exception e) {\r
- logger.error(e);\r
- } finally {\r
- if (dataMiner != null)\r
- dataMiner.removeProgressListener(progressListener);\r
- }\r
- return null;\r
- }\r
-\r
- private IProgressEventListener createListener(final IJobRuntime jobRuntime) {\r
- return new IProgressEventListener() {\r
- @Override\r
- public void progressChanged(ProgressEvent evt) {\r
- logger.info("Progress changed to " + evt.getProgress() + "%");\r
- jobRuntime.incrementProgress(evt.getProgress());\r
- }\r
- };\r
- }\r
-\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.sql.Timestamp;\r
-import java.util.Date;\r
-import java.util.List;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.Media;\r
-import user.jobengine.db.MediaFile;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.JobEngineException;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class SetArchivedStep extends JobStep {\r
- private static final Logger logger = LogManager.getLogger();\r
-\r
- @StepEntry\r
- public Object[] execute(Media media, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
- if (media == null)\r
- throw new JobEngineException("Missing Media parameter.");\r
- IItemManager manager = jobEngine.getItemManager();\r
- if (manager == null)\r
- throw new JobEngineException("Missing ItemManager.");\r
- List<MediaFile> mediaFiles = media.getMediaFiles();\r
- if (mediaFiles == null || mediaFiles.size() != 1)\r
- throw new JobEngineException("Missing media file(s) from Media record.");\r
- MediaFile mediaFile = null;\r
- for (MediaFile mf : mediaFiles) {\r
- //StoreUri storeUri = mf.getStore().getTargetStoreUri(RemoteStoreProtocol.TSM);\r
- if (mf.getId() > 0)\r
- continue;\r
- mediaFile = mf;\r
- }\r
- if (mediaFile == null)\r
- throw new JobEngineException("Missing archived media file with empty ID from Media record.");\r
-\r
- mediaFile.add();\r
-\r
- media.setPersister(manager);\r
- media.setArchived(new Timestamp(new Date().getTime()));\r
- media.modify();\r
- logger.info("Media {} is archived at {}", mediaFile.getRelativePath(), media.getArchived());\r
- return null;\r
- }\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.commons.RemoteFile;\r
-import user.commons.StoreUri;\r
-import user.commons.remotestore.IProgressEventListener;\r
-import user.commons.remotestore.IStatusEventListener;\r
-import user.commons.remotestore.ProgressEvent;\r
-import user.commons.remotestore.RemoteStoreProtocol;\r
-import user.commons.remotestore.StatusEvent;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.Media;\r
-import user.jobengine.db.MediaFile;\r
-import user.jobengine.db.Store;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class TSMBackupStep_orig extends JobStep {\r
- // @StepEntry\r
- // public Object[] execute(Media media, IJobEngine jobEngine,\r
- // IJobRuntime jobRuntime) throws Exception {\r
- // TSMClient tsm = null;\r
- // tsm = new TSMClient("JobEngine");\r
- // tsm.connect(null, null);\r
- // log_info("Connected to TSM");\r
- // try {\r
- // log_info("Trying register filespace");\r
- // tsm.registerFilespace(File.separator + "JOBENGINE", "JOBENGINE",\r
- // 'C', "JOBENGINE", 10L * 1024L * 1024L * 1024L, 0);\r
- // } catch (Exception e) {\r
- // log_info(e.getMessage());\r
- // }\r
- //\r
- // IItemManager manager = jobEngine.getItemManager();\r
- // final IJobRuntime runtime = jobRuntime;\r
- //\r
- // Store systemStore = manager.getSystemStore(false);\r
- // Store mfStore = null;\r
- // MediaFile mediaFile = null;\r
- // for (MediaFile mf : media.getMediaFiles()) {\r
- // mediaFile = mf;\r
- // mfStore = mf.getStore();\r
- // if (mfStore.getId() == systemStore.getId())\r
- // break;\r
- // }\r
- //\r
- // if (mediaFile == null)\r
- // throw new Exception("Can not find HIRES media file");\r
- // if (mfStore == null)\r
- // throw new Exception("Can not find HIRES store");\r
- //\r
- // String path = mediaFile.getRelativePath();\r
- // int pos = path.lastIndexOf("/");\r
- // String fileName = pos > -1 ? path.substring(pos, path.length() - pos)\r
- // : path;\r
- //\r
- // try {\r
- // TSMBackupFileObject backupObject = new TSMBackupFileObject(\r
- // File.separator + "JOBENGINE", File.separator + "JOBENGINE",\r
- // File.separator + fileName);\r
- // StoreUri uri = mfStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL);\r
- // // TODO RemoteFile konverzi�, MediaFile-ba be�p�teni\r
- //\r
- // String sourceFilePath = DirectoryUtils.combine(uri.getFullPath(),\r
- // fileName);\r
- // final File file = new File(sourceFilePath);\r
- // if (!file.exists())\r
- // throw new Exception("File not exists: " + sourceFilePath);\r
- // final long fileSize = file.length();\r
- // log_info("Saving: " + sourceFilePath + ", size:" + fileSize);\r
- // backupObject.setLocalFilePath(sourceFilePath);\r
- // backupObject.setListener(new TSMObjectListener() {\r
- // private long transferredBytes;\r
- // private int lastProgress;\r
- //\r
- // public void bytesWorked(long bytes) {\r
- // transferredBytes += bytes;\r
- // int progress = fileSize == 0 ? 100\r
- // : (int) (transferredBytes * 100 / fileSize);\r
- // if (progress > lastProgress + 4) {\r
- // log_info("incrementProgress: " + progress);\r
- // runtime.incrementProgress(progress);\r
- // lastProgress = progress;\r
- // }\r
- // }\r
- // });\r
- // runtime.incrementProgress(100);\r
- // tsm.send(backupObject);\r
- // } catch (Exception e) {\r
- // throw new Exception(e);\r
- // } finally {\r
- // tsm.disconnect();\r
- // log_info("Disconnected");\r
- // }\r
- // return null;\r
- // }\r
-\r
- private static final Logger logger = LogManager.getLogger();\r
-\r
- @StepEntry\r
- public Object[] execute(Media media, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
-\r
- RemoteFile result = null;\r
- final IJobRuntime runtime = jobRuntime;\r
- IItemManager manager = jobEngine.getItemManager();\r
- Store systemStore = manager.getSystemStore(false);\r
- Store mfStore = null;\r
- MediaFile mediaFile = null;\r
- for (MediaFile mf : media.getMediaFiles()) {\r
- mediaFile = mf;\r
- mfStore = mf.getStore();\r
- if (mfStore.getId() == systemStore.getId())\r
- break;\r
- }\r
-\r
- if (mediaFile == null)\r
- throw new Exception("Can not find HIRES media file");\r
- if (mfStore == null)\r
- throw new Exception("Can not find HIRES store");\r
-\r
- String path = mediaFile.getRelativePath();\r
- logger.info("Relative path is: " + path);\r
- if (path == null)\r
- throw new Exception("Path is null!");\r
- int pos = path.lastIndexOf("/");\r
- // String sourceFileName = pos > -1 ? path.substring(pos, path.length()\r
- // - pos) : path;\r
- String sourceFileName = pos > -1 ? path.substring(pos + 1, path.length()) : path;\r
- logger.info("SourceFileName is: " + sourceFileName);\r
- if (sourceFileName == null)\r
- throw new NullPointerException("Source FileName is null");\r
-\r
- StoreUri sourceUri = mfStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL);\r
- StoreUri target = new StoreUri();\r
- target.setProtocol(RemoteStoreProtocol.TSM);\r
- logger.info("Target is: " + target.getProtocol());\r
- sourceUri.addProgressListener(new IProgressEventListener() {\r
- @Override\r
- public void progressChanged(ProgressEvent evt) {\r
- runtime.incrementProgress(evt.getProgress());\r
- }\r
- });\r
- sourceUri.addStatusListener(new IStatusEventListener() {\r
- @Override\r
- public void statusChanged(StatusEvent evt) {\r
- evt.setCancel(!canContinue());\r
- }\r
- });\r
- result = sourceUri.transferFrom(target, sourceFileName, sourceFileName);\r
- return new Object[] { result };\r
- }\r
-\r
- @Override\r
- public void cleanup() {\r
- }\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class TemplateStep extends JobStep {\r
-\r
- @StepEntry\r
- public Object[] execute(IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
- try {\r
- } catch (Exception e) {\r
- e.printStackTrace();\r
- }\r
- return null;\r
- }\r
-\r
-}\r
+++ /dev/null
-package obsolate;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Date;\r
-import java.util.List;\r
-\r
-import org.apache.commons.lang.StringUtils;\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import user.commons.FileTypeInfo;\r
-import user.commons.FileTypeUtils;\r
-import user.commons.ItemSource;\r
-import user.commons.RemoteFile;\r
-import user.commons.StoreUri;\r
-import user.commons.rcc.RCCClient;\r
-import user.commons.rcc.RCCJob;\r
-import user.commons.remotestore.DirectoryUtils;\r
-import user.commons.remotestore.RemoteStoreProtocol;\r
-import user.jobengine.db.FileType;\r
-import user.jobengine.db.IItemManager;\r
-import user.jobengine.db.MediaFile;\r
-import user.jobengine.db.Store;\r
-import user.jobengine.server.IJobEngine;\r
-import user.jobengine.server.IJobRuntime;\r
-import user.jobengine.server.JobEngineException;\r
-import user.jobengine.server.steps.JobStep;\r
-import user.jobengine.server.steps.StepEntry;\r
-\r
-public class TranscodeStep extends JobStep {\r
- private static final Logger logger = LogManager.getLogger();\r
- private static final String RCC_HOST = "jobengine.rcc.host";\r
- private static final String RCC_LOWRES_PROFILE = "jobengine.rcc.defaultlowresprofile";\r
-\r
- @StepEntry\r
- public Object[] execute(RemoteFile file, String transcoderProfile, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
- if (file == null)\r
- throw new JobEngineException("RemoteFile is null");\r
-\r
- String transcoderHost = System.getProperty(RCC_HOST);\r
- RCCClient client = new RCCClient(transcoderHost);\r
- String guid = client.getProfileId(transcoderProfile);\r
- if (guid == null) {\r
- logger.info("Transcoder profile not exists: " + transcoderProfile + ", using default");\r
- String profile = System.getProperty(RCC_LOWRES_PROFILE);\r
- logger.info("Profile : " + profile);\r
- profile = StringUtils.strip(profile, "\"");\r
- if (profile == null)\r
- throw new JobEngineException("System default lowres profile is not configured (missing argument jobengine.rcc.defaultlowresprofile)");\r
- guid = client.getProfileId(profile);\r
- if (guid == null)\r
- throw new JobEngineException("Default profile not exists on remote host: " + "\"" + profile + "\"");\r
- }\r
- logger.info("Profile ok.");\r
- IItemManager manager = jobEngine.getItemManager();\r
- Store systemStore = manager.getSystemStore(false);\r
- Store lowresSystemStore = manager.getSystemStore(true);\r
- logger.info("Stores ok.");\r
- FileTypeInfo fti = FileTypeUtils.get(file.getExtension());\r
- logger.info("Filetype ok.");\r
-\r
- List<MediaFile> mediaFiles = new ArrayList<MediaFile>();\r
- MediaFile hires = new MediaFile();\r
- hires.setStore(systemStore);\r
- hires.setRelativePath(file.getName());\r
-\r
- FileType fileType = manager.getFileType(fti.getName());\r
- hires.setFileType(fileType);\r
- mediaFiles.add(hires);\r
-\r
- if (fti.canTranscode()) {\r
- logger.info("Can transcode ok.");\r
-\r
- StoreUri sourceStoreUri = systemStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL);\r
- if (sourceStoreUri == null)\r
- throw new NullPointerException("Source store is not available.");\r
- logger.info("Source store: " + sourceStoreUri.toString(true));\r
-\r
- StoreUri targetStoreUri = lowresSystemStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL);\r
- if (targetStoreUri == null)\r
- throw new NullPointerException("Target store is not available.");\r
- logger.info("Target store: " + targetStoreUri.toString(true));\r
-\r
- String filePath = DirectoryUtils.combine(sourceStoreUri.toString(true), file.getName(), true, false);\r
- logger.info("Source file: " + filePath);\r
-\r
- // For temporary use only!!!\r
- List<ItemSource> itemSources = new ArrayList<ItemSource>();\r
- ItemSource itemSource = new ItemSource();\r
- itemSource.setName(filePath);\r
- itemSources.add(itemSource);\r
- //\r
-\r
- RCCJob job = new RCCJob(client, (new Date()).toString(), null, 0);\r
- if (!job.submit(itemSources, targetStoreUri.toString(true), guid))\r
- throw new JobEngineException("Can not submit job.");\r
-\r
- while (canContinue()) {\r
- job.refresh();\r
- if (!job.isRunning()) {\r
- if (job.isSuccess()) {\r
- jobRuntime.incrementProgress(100);\r
-\r
- MediaFile lores = new MediaFile();\r
- lores.setStore(lowresSystemStore);\r
- lores.setFileType(fileType);\r
- RemoteFile targetFile = job.getTargetFile();\r
- String name = targetFile.getName();\r
- name = DirectoryUtils.checkSlash("\\", name, false, false);\r
- if (targetFile != null)\r
- lores.setRelativePath(name);\r
- mediaFiles.add(lores);\r
- } else {\r
- String message = String.format("Job status is %s. Error details: %s", job.getStatus(), job.getErrorMessage());\r
- throw new JobEngineException(message);\r
- }\r
- break;\r
- }\r
- logger.info(job.getProgress());\r
- jobRuntime.incrementProgress(job.getProgress());\r
- Thread.sleep(2000);\r
- }\r
-\r
- if (!canContinue())\r
- job.cancel();\r
- } else {\r
- logger.info("Can not find transcode information for file type: " + file.getExtension());\r
- jobRuntime.incrementProgress(100);\r
- }\r
-\r
- return new Object[] { mediaFiles };\r
- }\r
-}\r
@StepEntry\r
public Object[] execute(int param) throws Exception {\r
try {\r
+\r
+ Marker marker = MarkerManager.getMarker("MEDIAPROFILE");\r
+ logger.info(marker, "{}", EscortFiles.DOT_CATCHED);\r
getJobRuntime().setRelated("TESZT" + param);\r
\r
// ftpTest();\r
// if (param == 1)\r
// throw new Exception("Error teszt");\r
\r
- Marker marker = MarkerManager.getMarker("MEDIAPROFILE");\r
-\r
for (int i = 0; i < count; i++) {\r
if (getJobRuntime().isWaitingCancel())\r
break;\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
+import user.commons.configuration.SystemConfiguration;\r
+\r
public class Cmd {\r
interface IResponseCallback {\r
void onResponse(String line);\r
}\r
\r
+ private static final String FFMPEG_EXECUTABLE = SystemConfiguration.getInstance().value("services.ffmpeg.executable-location");\r
+\r
private static final Logger log = LogManager.getLogger();\r
\r
public static ProcessBuilder create(String... args) {\r
}\r
\r
public static String getFFMpegExecutable() {\r
- return System.getProperty("jobengine.ffmpeg.location");\r
+ return FFMPEG_EXECUTABLE;\r
}\r
\r
}\r
import user.commons.CalendarUtils;\r
import user.commons.ListUtils;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
import user.commons.octopus.OctopusAPI;\r
private static final String ARCHIVEDRUNDOWNS = "archivedrundowns";\r
private static final String ID = "id";\r
private static final String MEDIATYPE = "Hír bejátszó";\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
private OctopusAPI octopusAPI;\r
private IItemManager manager;\r
\r
logger.error(systemMarker, "Az adatbáziskezelő réteg nem elérhető.");\r
throw new NullPointerException("Internal error, missing ItemManager reference.");\r
}\r
- String nexioHost = System.getProperty("nexio.host");\r
- if (StringUtils.isBlank(nexioHost)) {\r
+\r
+ if (StringUtils.isBlank(NEXIO_HOST)) {\r
logger.error(systemMarker, "A 'nexio.host' rendszer paraméter nem található.");\r
throw new NullPointerException("System is not configured properly, 'jobengine.selenio.address' startup parameter missing.");\r
}\r
check(nexioAgency, "nexioAgency");\r
this.nexioAgency = nexioAgency;\r
\r
- sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
sourceUri.setPortNumber(nexioPort);\r
sourceUri.setUserName(nexioUserName);\r
sourceUri.setPassword(nexioPassword);\r
import user.commons.CalendarUtils;\r
import user.commons.ListUtils;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nexio.NexioDispatcher;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
private static final String RECORDDATE = "recorddate";\r
private static final SimpleDateFormat startTimeformat = new SimpleDateFormat(STARTTIME_FORMAT);\r
private static final SimpleDateFormat rundownDateformat = new SimpleDateFormat(RUNDOWNDATE_FORMAT);\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
\r
private OctopusAPI octopusAPI;\r
private IItemManager manager;\r
return null;\r
}\r
}\r
-\r
+ \r
RundownArchive item2 = null;\r
-\r
+ \r
try {\r
item2 = processRundow(rundown, clipName, duration);\r
} catch (Exception e) {\r
e.getMessage());\r
return null;\r
}\r
-\r
+ \r
result.setItemTitle(result.getItemTitle() + " + NAPIAKT");\r
StoryArchive storyArchive = result.getStoryArchives().get(0);\r
StoryArchive storyArchive2 = item2.getStoryArchives().get(0);\r
logger.error(systemMarker, "Az adatbáziskezelő réteg nem elérhető.");\r
throw new NullPointerException("Internal error, missing ItemManager reference.");\r
}\r
- String nexioHost = System.getProperty("nexio.host");\r
- if (StringUtils.isBlank(nexioHost)) {\r
+\r
+ if (StringUtils.isBlank(NEXIO_HOST)) {\r
logger.error(systemMarker, "A 'nexio.host' rendszer paraméter nem található.");\r
throw new NullPointerException("System is not configured properly, 'jobengine.selenio.address' startup parameter missing.");\r
}\r
check(nexioAgency, "nexioAgency");\r
this.nexioAgency = nexioAgency;\r
\r
- sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
sourceUri.setPortNumber(nexioPort);\r
sourceUri.setUserName(nexioUserName);\r
sourceUri.setPassword(nexioPassword);\r
import user.commons.ListUtils;\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.remotestore.RemoteStoreProtocol;\r
import user.jobengine.db.IItemManager;\r
private static final String KILLDATE = "killdate";\r
private static final String LONGNAMEID = "longnameid";\r
private static final String EXTAGENCY = "extagency";\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
private StoreUri sourceUri;\r
private IJobRuntime jobRuntime;\r
\r
public Object[] execute(int port, String userName, String password, String filterAgencies, int gracePeriodDays, boolean notificationOnly,\r
IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
this.jobRuntime = jobRuntime;\r
- String nexioHost = System.getProperty("nexio.host");\r
- if (StringUtils.isBlank(nexioHost)) {\r
+ if (StringUtils.isBlank(NEXIO_HOST)) {\r
logger.error(jobRuntime.getSessionMarker(), "A 'nexio.host' rendszer paraméter nem található.");\r
throw new NullPointerException("System is not configured properly, 'nexio.host' startup parameter missing.");\r
}\r
return null;\r
\r
IItemManager manager = jobEngine.getItemManager();\r
- sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
sourceUri.setPortNumber(port);\r
sourceUri.setUserName(userName);\r
sourceUri.setPassword(password);\r
\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.remotestore.IProgressEventListener;\r
import user.commons.remotestore.IStatusEventListener;\r
private static final String NEXIOCLIPS = "nexioclips";\r
private static final String LONGNAMEID = "longnameid";\r
private static final String DURATION = "duration";\r
-\r
private static final Logger logger = LogManager.getLogger();\r
\r
+ private String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
+\r
private IItemManager manager;\r
private StoreUri targetUri;\r
private StoreUri sourceUri;\r
check(targetFileName, "targetFileName");\r
check(targetPath, "targetPath");\r
\r
- String nexioHost = System.getProperty("nexio.host");\r
- if (StringUtils.isBlank(nexioHost)) {\r
+ if (StringUtils.isBlank(NEXIO_HOST)) {\r
logger.error(marker, "A 'nexio.host' rendszer paraméter nem található.");\r
throw new NullPointerException("System is not configured properly, 'jobengine.selenio.address' startup parameter missing.");\r
}\r
check(nexioUserName, "nexioUserName");\r
check(nexioPassword, "nexioPassword");\r
\r
- sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ sourceUri = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
sourceUri.setPortNumber(nexioPort);\r
sourceUri.setUserName(nexioUserName);\r
sourceUri.setPassword(nexioPassword);\r
\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.remotestore.IProgressEventListener;\r
import user.commons.remotestore.ProgressEvent;\r
import user.commons.remotestore.RemoteStoreProtocol;\r
public class MXFCutterStep extends JobStep {\r
private static final String TARGETNAMEPATTERN = "-ARCH-%s";\r
private static final Logger logger = LogManager.getLogger();\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
private IItemManager manager;\r
private StoreUri tempTargetUri;\r
private StoreUri tempSourceUri;\r
private Marker marker;\r
private int nexioPort;\r
private String nexioUserName, nexioPassword;\r
- private String nexioHost;\r
\r
protected void checkTargetPath(String targetPath) {\r
if (StringUtils.isBlank(targetPath)) {\r
\r
protected StoreUri createTargetUri(IItemManager manager, String targetPath) throws NullPointerException {\r
StoreUri result = null;\r
- result = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ result = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
result.setPortNumber(nexioPort);\r
result.setUserName(nexioUserName);\r
result.setPassword(nexioPassword);\r
this.nexioPort = nexioPort;\r
this.nexioUserName = nexioUserName;\r
this.nexioPassword = nexioPassword;\r
- nexioHost = System.getProperty("nexio.host");\r
marker = jobRuntime.getSessionMarker();\r
\r
if (useNexioTarget && archivedMedia.getTcIn() != null && archivedMedia.getTcOut() != null) {\r
\r
import user.commons.CalendarUtils;\r
import user.commons.ListUtils;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
import user.commons.remotestore.IProgressEventListener;\r
private static final String MOSLABEL = "MOS: ";\r
private static final Object STORY = "Story";\r
\r
+ private static String OCTOPUS_API_ADDRESS = SystemConfiguration.getInstance().value("services.octopus.api.address");\r
+ private static String OCTOPUS_API_USER = SystemConfiguration.getInstance().value("services.octopus.api.user");\r
+ private static String OCTOPUS_API_PASSWORD = SystemConfiguration.getInstance().value("services.octopus.api.password");\r
private DB db;\r
private ResteasyWebTarget webTarget;\r
- private String apiUser;\r
- private String apiPwd;\r
private HashSet<Long> storyIDs = new HashSet<>();\r
private HashSet<Long> folderIDs = new HashSet<>();\r
private HashSet<Long> rundownIDs = new HashSet<>();\r
private Calendar zeroDate = CalendarUtils.createCalendar(2017, 11, 4);\r
private int objectCount;\r
private int currentObjectIndex;\r
-\r
private boolean disableWrite = false;\r
\r
public OctopusDataMiner() {\r
db = NoSQLUtils.getNoSQLDB();\r
-\r
- String apiAddress = System.getProperty("jobengine.octopus.api.address");\r
- apiUser = System.getProperty("jobengine.octopus.api.user");\r
- apiPwd = System.getProperty("jobengine.octopus.api.password");\r
-\r
- // ResteasyClient client = new ResteasyClientBuilder().register(JacksonJsonProvider.class).build();\r
ResteasyClient client = new ResteasyClientBuilder().build();\r
- webTarget = client.target(apiAddress).register(new BasicAuthentication(apiUser, apiPwd));\r
+ webTarget = client.target(OCTOPUS_API_ADDRESS).register(new BasicAuthentication(OCTOPUS_API_USER, OCTOPUS_API_PASSWORD));\r
}\r
\r
public void addProgressListener(IProgressEventListener listener) {\r
\r
private Builder query(String path, String fields) {\r
ResteasyWebTarget target = webTarget.path(path).queryParam(FIELDS, fields);\r
- Builder result = target.request().header(OCTOPUS_DEVICE_ID, apiUser).header(OCTOPUS_DEVICE_NAME, apiPwd);\r
+ Builder result = target.request().header(OCTOPUS_DEVICE_ID, OCTOPUS_API_USER).header(OCTOPUS_DEVICE_NAME, OCTOPUS_API_PASSWORD);\r
return result;\r
}\r
\r
+++ /dev/null
-package user.jobengine.server.steps;\r
-\r
-import java.util.Calendar;\r
-import java.util.Date;\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\r
-import java.util.concurrent.ConcurrentHashMap;\r
-\r
-import javax.swing.event.EventListenerList;\r
-import javax.ws.rs.client.Entity;\r
-import javax.ws.rs.client.Invocation.Builder;\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-import org.jboss.resteasy.client.jaxrs.BasicAuthentication;\r
-import org.jboss.resteasy.client.jaxrs.ResteasyClient;\r
-import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;\r
-import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;\r
-import org.joda.time.DateTime;\r
-\r
-import com.ibm.nosql.json.JSONUtil;\r
-import com.ibm.nosql.json.api.BasicDBList;\r
-import com.ibm.nosql.json.api.BasicDBObject;\r
-import com.ibm.nosql.json.api.DB;\r
-import com.ibm.nosql.json.api.DBCollection;\r
-import com.ibm.nosql.json.api.DBCursor;\r
-import com.ibm.nosql.json.api.QueryBuilder;\r
-import com.ibm.nosql.json.api.WriteResult;\r
-\r
-import user.commons.CalendarUtils;\r
-import user.commons.ListUtils;\r
-import user.commons.nosql.NoSQLUtils;\r
-import user.commons.octopus.IOctopusAPI;\r
-import user.commons.remotestore.IProgressEventListener;\r
-import user.commons.remotestore.ProgressEvent;\r
-\r
-public class OctopusDataMinerStable {\r
- private static final String ARCHIVED = "archived";\r
- private static final String FILTER = "filter";\r
- private static final String _TMP = "_tmp";\r
- private static final Logger logger = LogManager.getLogger();\r
- private static final String LINEFEED = "\r\n";\r
- private static final String SIMPLE_LINEFEED = "\n";\r
- private static final String SAVING_STORY_ID = "Saving story {}";\r
- // private static final String SAVING_RUNDOWN = "Saving rundown : {} {}";\r
- // private static final String CHECKING_RUNDOWN = "Checking Rundown {} ({}/{})";\r
- private static final String FIELDS_STORYFOLDER_STORIES = "stories,Story.modified,Story.name,Story.id,Story.mosObjects,Story.script,Story.type,Story.format,Story.customColumns,CustomColumn.label,CustomColumn.value";\r
- private static final String FIELDS_RUNDOWN_STORIES = "slugs,Slug.story,Slug.position,Story.name,Story.id,Story.modified,Story.mosObjects,Story.script,Story.type,Story.format,Story.customColumns,CustomColumn.label,CustomColumn.value";\r
- private static final String FIELDS_RUNDOWN = "id,name,modified,scheduledStart,channel,Channel.name,rundownType,RundownType.name";\r
- private static final String FIELDS_RUNDOWN_STORYIDS = "id,slugs,Slug.storyId,Slug.position";\r
- private static final String FIELDS_STORYFOLDER = "id,name,modified";\r
- private static final String FIELDS_STORYFOLDER_STORYIDS = "id,stories,Story.id";\r
- private static final String RUNDOWN = "Rundown";\r
- private static final String OCTOPUS_DEVICE_NAME = "Octopus-Device-Name";\r
- private static final String OCTOPUS_DEVICE_ID = "Octopus-Device-Id";\r
- private static final String FIELDS = "fields";\r
- private static final String CHECKING_STORY_FOLDER = "Checking StoryFolder %s (%d/%d)";\r
- private static final String EXIT = "Exit";\r
- private static final String RESULT = "result";\r
- private static final String STORY_FOLDER = "StoryFolder";\r
- private static final String ENTER = "Enter";\r
- private static final String FINISHED = "Finished";\r
- private static final String STARTING = "Starting";\r
- private static final String MOSOBJECT = "Bejátszó: ";\r
-\r
- private DB db;\r
- private ResteasyWebTarget webTarget;\r
- private String apiUser;\r
- private String apiPwd;\r
- private HashSet<Long> storyIDs = new HashSet<>();\r
- private HashSet<Long> folderIDs = new HashSet<>();\r
- private HashSet<Long> rundownIDs = new HashSet<>();\r
- private EventListenerList progressListenerList;\r
- private ProgressEvent progressEvent = new ProgressEvent(this, 0);\r
- private Map<Long, BasicDBList> storyRundowns;\r
- private Map<Long, BasicDBList> storyStoryFolders;\r
- private Map<Long, Object> currentRundowns;\r
- private Map<Long, Object> currentFolder;\r
- private Map<Long, Object> currentStories;\r
- private String RUNDOWN_COLLECTION;\r
- private String FOLDER_COLLECTION;\r
- private String STORY_COLLECTION;\r
- private boolean includeArchived;\r
- private Calendar zeroDate = CalendarUtils.createCalendar(2017, 11, 4);\r
-\r
- public OctopusDataMinerStable() {\r
- db = NoSQLUtils.getNoSQLDB();\r
-\r
- String apiAddress = System.getProperty("jobengine.octopus.api.address");\r
- apiUser = System.getProperty("jobengine.octopus.api.user");\r
- apiPwd = System.getProperty("jobengine.octopus.api.password");\r
-\r
- // ResteasyClient client = new ResteasyClientBuilder().register(JacksonJsonProvider.class).build();\r
- ResteasyClient client = new ResteasyClientBuilder().build();\r
- webTarget = client.target(apiAddress).register(new BasicAuthentication(apiUser, apiPwd));\r
- }\r
-\r
- public void addProgressListener(IProgressEventListener listener) {\r
- if (progressListenerList == null)\r
- progressListenerList = new EventListenerList();\r
- progressListenerList.add(IProgressEventListener.class, listener);\r
- }\r
-\r
- private Map<Long, BasicDBList> buildFolderReferences(BasicDBList storyFolders) {\r
- Map<Long, BasicDBList> result = new HashMap<>();\r
- List<BasicDBObject> storyFolderList = NoSQLUtils.asList(storyFolders);\r
- for (BasicDBObject storyFolder : storyFolderList) {\r
- if (storyFolder == null || !storyFolder.containsKey(IOctopusAPI.ID))\r
- continue;\r
- BasicDBObject storyFolderWithStoryIds = queryStoryFolder(storyFolder, FIELDS_STORYFOLDER_STORYIDS);\r
- long storyFolderId = storyFolderWithStoryIds.getLong(IOctopusAPI.ID);\r
- List<BasicDBObject> stories = NoSQLUtils.asList(storyFolderWithStoryIds, IOctopusAPI.STORIES);\r
- if (stories == null)\r
- continue;\r
- if (!folderIDs.contains(storyFolderId))\r
- folderIDs.add(storyFolderId);\r
- long position = 1;\r
- for (BasicDBObject story : stories) {\r
- long storyId = story.getLong(IOctopusAPI.ID);\r
-\r
- BasicDBList references = result.get(storyId);\r
- if (references == null) {\r
- references = new BasicDBList();\r
- result.put(storyId, references);\r
- }\r
- references.add(new BasicDBObject(IOctopusAPI.ID, storyFolderId).append(IOctopusAPI.POSITION, position++));\r
- }\r
- }\r
- return result;\r
- }\r
-\r
- private Map<Long, BasicDBList> buildRundownReferences(BasicDBList rundowns) {\r
- Map<Long, BasicDBList> result = new HashMap<>();\r
- List<BasicDBObject> rundownsList = NoSQLUtils.asList(rundowns);\r
- for (BasicDBObject rundown : rundownsList) {\r
- if (rundown == null || !rundown.containsKey(IOctopusAPI.ID))\r
- continue;\r
- BasicDBObject rundownWithStoryids = queryRundown(rundown, FIELDS_RUNDOWN_STORYIDS);\r
- long rundownId = rundownWithStoryids.getLong(IOctopusAPI.ID);\r
- List<BasicDBObject> slugs = NoSQLUtils.asList(rundownWithStoryids, IOctopusAPI.SLUGS);\r
- if (slugs == null)\r
- continue;\r
-\r
- if (!rundownIDs.contains(rundownId))\r
- rundownIDs.add(rundownId);\r
-\r
- for (BasicDBObject slug : slugs) {\r
- if (!slug.containsKey(IOctopusAPI.STORYID))\r
- continue;\r
- long storyId = slug.getLong(IOctopusAPI.STORYID);\r
- BasicDBList references = result.get(storyId);\r
- if (references == null) {\r
- references = new BasicDBList();\r
- result.put(storyId, references);\r
- }\r
- long position = slug.getLong(IOctopusAPI.POSITION);\r
- if (slug.containsKey(IOctopusAPI.POSITION))\r
- position = slug.getLong(IOctopusAPI.POSITION);\r
- references.add(new BasicDBObject(IOctopusAPI.ID, rundownId).append(IOctopusAPI.POSITION, position));\r
- }\r
- }\r
- return result;\r
- }\r
-\r
- public void clear() {\r
- db.getCollection(RUNDOWN_COLLECTION).remove();\r
- db.getCollection(STORY_COLLECTION).remove();\r
- db.getCollection(FOLDER_COLLECTION).remove();\r
- db.getCollection(IOctopusAPI.TIME_COLLECTION_NAME).remove();\r
- }\r
-\r
- private String concatParentsToStoryFolder(BasicDBObject actual, String name) {\r
-\r
- String fields = "name,id,parent";\r
- Response response = query("StoryFolder/" + actual.getLong("id"), fields).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- BasicDBObject res = (BasicDBObject) resultObject.get("result");\r
- BasicDBObject parent = (BasicDBObject) res.get("parent");\r
- if (parent == null || parent.isEmpty())\r
- return name;\r
- String parentName = parent.getString(IOctopusAPI.NAME);\r
- String actualName = actual.getString(IOctopusAPI.NAME);\r
- String newName = String.format("%s/%s", parentName, actualName);\r
- return concatParentsToStoryFolder(parent, newName);\r
- }\r
-\r
- private void deleteDiff(Set<Long> oldIDs, Set<Long> newIDs, String collectionName) {\r
- if (oldIDs == null || oldIDs.size() == 0)\r
- return;\r
- if (newIDs != null && newIDs.size() > 0)\r
- oldIDs.removeAll(newIDs);\r
- DBCollection collection = db.getCollection(collectionName);\r
- for (long id : oldIDs) {\r
- logger.info("Deleting {} from {}", id, collectionName);\r
- collection.remove(new BasicDBObject(IOctopusAPI.ID, id));\r
- }\r
- }\r
-\r
- private void deleteOrphanRundowns() {\r
- try {\r
- DBCollection collection = db.getCollection(RUNDOWN_COLLECTION);\r
- BasicDBObject query = (BasicDBObject) QueryBuilder.start().put(IOctopusAPI.ID).notIn(storyRundowns.keySet().toArray()).get();\r
- WriteResult res = collection.remove(query);\r
- logger.trace(String.format("Deleted orphan rundowns: %d", res.getN()));\r
- } catch (Exception e) {\r
- logger.error(e);\r
- }\r
- }\r
-\r
- private void deleteOrphanStories() {\r
- try {\r
- DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- BasicDBObject query = (BasicDBObject) QueryBuilder.start().put("id").notIn(storyIDs.toArray()).get();\r
- WriteResult res = collection.remove(query);\r
- logger.trace(String.format("Deleted orphan stories: %d", res.getN()));\r
- } catch (Exception e) {\r
- logger.error(e);\r
- }\r
- }\r
-\r
- private void deleteOrphanStoryFolders() {\r
- try {\r
- DBCollection collection = db.getCollection(RUNDOWN_COLLECTION);\r
- BasicDBObject query = (BasicDBObject) QueryBuilder.start().put(IOctopusAPI.ID).notIn(storyStoryFolders.keySet().toArray()).get();\r
- WriteResult res = collection.remove(query);\r
- logger.trace(String.format("Deleted orphan rundowns: %d", res.getN()));\r
- } catch (Exception e) {\r
- logger.error(e);\r
- }\r
- }\r
-\r
- private void ensureIndexes() {\r
- DBCollection collection = db.getCollection(FOLDER_COLLECTION);\r
- if (collection.count() == 0)\r
- collection.ensureIndex(IOctopusAPI.ID);\r
- collection = db.getCollection(RUNDOWN_COLLECTION);\r
- if (collection.count() == 0) {\r
- collection.ensureIndex(IOctopusAPI.ID);\r
- collection.ensureIndex(IOctopusAPI.SCHEDULED_START);\r
- }\r
- collection = db.getCollection(STORY_COLLECTION);\r
- if (collection.count() == 0)\r
- collection.ensureIndex(IOctopusAPI.ID);\r
- }\r
-\r
- public void execute(boolean includeArchived) throws Exception {\r
- this.includeArchived = includeArchived;\r
- logger.trace(STARTING);\r
-\r
- // String MAIN_RUNDOWN_COLLECTION = IOctopusAPI.RUNDOWN_COLLECTION;\r
- // String MAIN_FOLDER_COLLECTION = IOctopusAPI.FOLDER_COLLECTION;\r
- // String MAIN_STORY_COLLECTION = IOctopusAPI.STORY_COLLECTION;\r
-\r
- // RUNDOWN_COLLECTION = MAIN_RUNDOWN_COLLECTION + _TMP;\r
- // FOLDER_COLLECTION = MAIN_FOLDER_COLLECTION + _TMP;\r
- // STORY_COLLECTION = MAIN_STORY_COLLECTION + _TMP;\r
- //\r
- // try {\r
- // db.getCollection(RUNDOWN_COLLECTION).drop();\r
- // db.getCollection(FOLDER_COLLECTION).drop();\r
- // db.getCollection(STORY_COLLECTION).drop();\r
- // } catch (Exception e) {\r
- // logger.catching(e);\r
- // throw e;\r
- // }\r
-\r
- RUNDOWN_COLLECTION = IOctopusAPI.RUNDOWN_COLLECTION;\r
- FOLDER_COLLECTION = IOctopusAPI.FOLDER_COLLECTION;\r
- STORY_COLLECTION = IOctopusAPI.STORY_COLLECTION;\r
-\r
- //current = korábbi szinkronizálás\r
- currentRundowns = getCurrentIDs(RUNDOWN_COLLECTION);\r
- currentFolder = getCurrentIDs(FOLDER_COLLECTION);\r
- currentStories = getCurrentIDs(STORY_COLLECTION);\r
-\r
- BasicDBList rundowns = null;\r
- BasicDBList storyFolders = null;\r
- try {\r
- rundowns = queryBuildRefRundowns();\r
- storyFolders = queryBuildRefFolders();\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
-\r
- processRundowns(rundowns);\r
- processStoryFolders(storyFolders);\r
-\r
- deleteDiff(currentRundowns.keySet(), rundownIDs, RUNDOWN_COLLECTION);\r
- deleteDiff(currentFolder.keySet(), folderIDs, FOLDER_COLLECTION);\r
- deleteDiff(currentStories.keySet(), storyIDs, STORY_COLLECTION);\r
- // deleteOrphanRundowns();\r
- // deleteOrphanStoryFolders();\r
- // deleteOrphanStories();\r
-\r
- //a sorrend fontos !\r
- // updateDiff(MAIN_STORY_COLLECTION, STORY_COLLECTION, IOctopusAPI.ID);\r
- // updateDiff(MAIN_RUNDOWN_COLLECTION, RUNDOWN_COLLECTION, IOctopusAPI.ID);\r
- // updateDiff(MAIN_FOLDER_COLLECTION, FOLDER_COLLECTION, IOctopusAPI.ID);\r
- //\r
- // updateDeleteDiff(MAIN_RUNDOWN_COLLECTION, RUNDOWN_COLLECTION, IOctopusAPI.ID);\r
- // updateDeleteDiff(MAIN_FOLDER_COLLECTION, FOLDER_COLLECTION, IOctopusAPI.ID);\r
- // updateDeleteDiff(MAIN_STORY_COLLECTION, STORY_COLLECTION, IOctopusAPI.ID);\r
-\r
- // try {\r
- // db.getCollection(RUNDOWN_COLLECTION).rename(MAIN_RUNDOWN_COLLECTION, true);\r
- // db.getCollection(FOLDER_COLLECTION).rename(MAIN_FOLDER_COLLECTION, true);\r
- // db.getCollection(STORY_COLLECTION).rename(MAIN_STORY_COLLECTION, true);\r
- // } catch (Exception e) {\r
- // logger.catching(e);\r
- // throw e;\r
- // }\r
-\r
- // logger.info("Activate");\r
-\r
- // try {\r
- // long ts = new Date().getTime();\r
- // db.getCollection(RUNDOWN_COLLECTION).exportFile(String.format("/opt/mediacube-test/log/%s-%s.js", RUNDOWN_COLLECTION, ts));\r
- // db.getCollection(FOLDER_COLLECTION).exportFile(String.format("/opt/mediacube-test/log/%s-%s.js", FOLDER_COLLECTION, ts));\r
- // db.getCollection(STORY_COLLECTION).exportFile(String.format("/opt/mediacube-test/log/%s-%s.js", STORY_COLLECTION, ts));\r
- // } catch (Exception e) {\r
- // logger.catching(e);\r
- // throw e;\r
- // }\r
-\r
- logger.trace(FINISHED);\r
- //throw new Exception("Mérés");\r
- }\r
-\r
- private String extractContent(BasicDBObject content) {\r
- String scriptContent = "";\r
- if (!content.containsKey(IOctopusAPI.TYPE))\r
- return scriptContent;\r
- String type = content.getString(IOctopusAPI.TYPE);\r
- switch (type) {\r
- case IOctopusAPI.TEXT: {\r
- if (content.containsKey(IOctopusAPI.TEXT)) {\r
- String text = content.getString(IOctopusAPI.TEXT);\r
- if (text != null)\r
- scriptContent += String.format("%s%s", text.replaceAll(SIMPLE_LINEFEED, LINEFEED), LINEFEED);\r
- }\r
- break;\r
- }\r
- case IOctopusAPI.MOS: {\r
- BasicDBObject mosObject = NoSQLUtils.asDBObject(content, IOctopusAPI.OBJECT);\r
- if (mosObject != null && !mosObject.isEmpty()) {\r
- if (mosObject.containsKey(IOctopusAPI.OBJ_ID)) {\r
- String objID = mosObject.getString(IOctopusAPI.OBJ_ID);\r
- scriptContent += String.format("%s %s%s", MOSOBJECT, objID, LINEFEED);\r
- }\r
- }\r
- break;\r
- }\r
- default: {\r
- if (content.containsKey(IOctopusAPI.CONTENT)) {\r
- List<BasicDBObject> innerContents = NoSQLUtils.asList(content, IOctopusAPI.CONTENT);\r
- if (innerContents != null) {\r
- for (BasicDBObject actualInnerContent : innerContents) {\r
- if (actualInnerContent != null && actualInnerContent.isEmpty())\r
- scriptContent += extractContent(actualInnerContent);\r
- }\r
- }\r
- }\r
- break;\r
- }\r
- }\r
- return scriptContent;\r
- }\r
-\r
- private String extractCustomColumnValue(String columnName, BasicDBObject story) {\r
- List<BasicDBObject> customColumns = NoSQLUtils.asList(story, IOctopusAPI.CUSTOM_COLUMNS);\r
- if (customColumns == null)\r
- return null;\r
- String result = null;\r
- for (BasicDBObject customColumn : customColumns) {\r
- if (!customColumn.containsKey(IOctopusAPI.LABEL))\r
- continue;\r
- String currentName = customColumn.getString(IOctopusAPI.LABEL);\r
- if (currentName == null)\r
- continue;\r
- if (!currentName.toLowerCase().equals(columnName.toLowerCase()))\r
- continue;\r
- if (!customColumn.containsKey(IOctopusAPI.VALUE))\r
- continue;\r
- result = customColumn.getString(IOctopusAPI.VALUE);\r
- break;\r
- }\r
- return result;\r
- }\r
-\r
- private BasicDBList extractRelevantMOSObjects(BasicDBObject story) {\r
- List<BasicDBObject> mosObjects = NoSQLUtils.asList(story, IOctopusAPI.MOS_OBJECTS);\r
- if (mosObjects == null)\r
- return null;\r
- BasicDBList result = null;\r
- for (BasicDBObject mosObject : mosObjects) {\r
- if (!mosObject.containsKey(IOctopusAPI.MOS_ID))\r
- continue;\r
- String mosId = mosObject.getString(IOctopusAPI.MOS_ID);\r
- if (!IOctopusAPI.NEXIO_MOS.equals(mosId))\r
- continue;\r
- if (result == null)\r
- result = new BasicDBList();\r
- result.add(mosObject);\r
- }\r
- return result;\r
- }\r
-\r
- private String extractScriptContent(BasicDBObject story) {\r
- BasicDBObject script = NoSQLUtils.asDBObject(story, IOctopusAPI.SCRIPT);\r
- if (script == null || script.isEmpty())\r
- return null;\r
-\r
- List<BasicDBObject> body = NoSQLUtils.asList(script, IOctopusAPI.BODY);\r
- if (body == null || body.size() == 0)\r
- return null;\r
-\r
- StringBuilder sb = new StringBuilder();\r
-\r
- for (BasicDBObject bodyItem : body) {\r
- if (bodyItem.containsKey(IOctopusAPI.LABEL)) {\r
- sb.append(bodyItem.getString(IOctopusAPI.LABEL));\r
- sb.append(LINEFEED);\r
- }\r
- List<BasicDBObject> contents = NoSQLUtils.asList(bodyItem, IOctopusAPI.CONTENT);\r
- if (contents == null)\r
- continue;\r
- for (BasicDBObject content : contents) {\r
- sb.append(extractContent(content));\r
- }\r
- }\r
- return sb.length() == 0 ? null : sb.toString();\r
- }\r
-\r
- private void fireProgressEvent(ProgressEvent evt) {\r
- logger.debug("Progress changed to " + evt.getProgress() + "%");\r
- if (progressListenerList == null)\r
- return;\r
- Object[] listeners = progressListenerList.getListenerList();\r
- for (int i = 0; i < listeners.length; i += 2) {\r
- if (listeners[i] == IProgressEventListener.class)\r
- ((IProgressEventListener) listeners[i + 1]).progressChanged(evt);\r
- }\r
- }\r
-\r
- public Map<Long, Object> getCurrentIDs(String name) {\r
- Map<Long, Object> result = new HashMap<>();\r
-\r
- DBCursor cursor = db.getCollection(name).find(new BasicDBObject(), new BasicDBObject(IOctopusAPI.ID, 1));\r
- if (cursor.hasNext()) {\r
- List<BasicDBObject> objects = ListUtils.cast(cursor.toArray());\r
- for (BasicDBObject obj : objects) {\r
- if (obj == null)\r
- continue;\r
- long id = NoSQLUtils.asLong(obj, IOctopusAPI.ID);\r
- if (id == 0)\r
- continue;\r
- Object _id = obj.getID();\r
- if (_id == null)\r
- continue;\r
- result.put(id, _id);\r
- }\r
- }\r
- return result;\r
- }\r
-\r
- private void processRundowns(BasicDBList rundowns) throws Exception {\r
- if (rundowns == null || rundowns.size() == 0) {\r
- progressEvent.setProgress(50);\r
- fireProgressEvent(progressEvent);\r
- } else {\r
- logger.info("Process rundowns");\r
- try {\r
- storeRundowns(rundowns, null);\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
- }\r
- }\r
-\r
- private void processStoryFolders(BasicDBList storyFolders) throws Exception {\r
- if (storyFolders == null || storyFolders.size() == 0) {\r
- progressEvent.setProgress(100);\r
- fireProgressEvent(progressEvent);\r
- } else {\r
- logger.info("Process story folders");\r
- try {\r
- storeStoryFolders(storyFolders, null);\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
- }\r
- }\r
-\r
- private Builder query(String path, String fields) {\r
- ResteasyWebTarget target = webTarget.path(path).queryParam(FIELDS, fields);\r
- Builder result = target.request().header(OCTOPUS_DEVICE_ID, apiUser).header(OCTOPUS_DEVICE_NAME, apiPwd);\r
- return result;\r
- }\r
-\r
- private BasicDBList queryBuildRefFolders() {\r
- BasicDBList storyFolders;\r
- logger.info("Fetch story folders");\r
- storyFolders = queryStoryFolders();\r
- logger.info("Fetch folder story references");\r
- storyStoryFolders = buildFolderReferences(storyFolders);\r
- return storyFolders;\r
- }\r
-\r
- private BasicDBList queryBuildRefRundowns() {\r
- BasicDBList rundowns;\r
- logger.info("Fetch rundowns");\r
- rundowns = queryRundowns();\r
- logger.info("Fetch rundown story references");\r
- storyRundowns = buildRundownReferences(rundowns);\r
- return rundowns;\r
- }\r
-\r
- private BasicDBObject queryRundown(BasicDBObject rundown, String fields) {\r
- logger.trace(ENTER);\r
- BasicDBObject result = null;\r
- long id = NoSQLUtils.asLong(rundown, IOctopusAPI.ID);\r
- Response response = query(String.format("%s/%d", RUNDOWN, id), fields).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject == null)\r
- logger.error("Rundown {} {} is not available", id, rundown.getString(IOctopusAPI.NAME));\r
- else\r
- result = NoSQLUtils.asDBObject(resultObject, RESULT);\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- private BasicDBList queryRundowns() {\r
- logger.trace(ENTER);\r
- BasicDBList result = null;\r
- Builder query = query(RUNDOWN, FIELDS_RUNDOWN);\r
- Response response = null;\r
- if (includeArchived) {\r
- response = query.post(Entity.entity(new BasicDBObject(FILTER, new BasicDBObject(ARCHIVED, true)).toString(), MediaType.APPLICATION_JSON));\r
- } else\r
- response = query.get();\r
-\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject != null)\r
- result = NoSQLUtils.asDBList(resultObject, RESULT);\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- private BasicDBObject queryStoryFolder(BasicDBObject storyFolder, String fields) {\r
- logger.trace(ENTER);\r
- BasicDBObject result = null;\r
- long id = NoSQLUtils.asLong(storyFolder, IOctopusAPI.ID);\r
- Response response = query(String.format("%s/%d", STORY_FOLDER, id), fields).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject == null)\r
- logger.error("StoryFolder {} {} is not available", id, storyFolder.getString(IOctopusAPI.NAME));\r
- else\r
- result = NoSQLUtils.asDBObject(resultObject, RESULT);\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- private BasicDBList queryStoryFolders() {\r
- logger.trace(ENTER);\r
- BasicDBList result = null;\r
- Response response = query(STORY_FOLDER, FIELDS_STORYFOLDER).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject != null)\r
- result = NoSQLUtils.asDBList(resultObject, RESULT);\r
-\r
- // /* teszt */\r
- // List<BasicDBObject> list = NoSQLUtils.asList(result);\r
- // for (BasicDBObject actual : list) {\r
- // String fullName = concatParentsToStoryFolder(actual, actual.getString(IOctopusAPI.NAME));\r
- // //logger.info("Checking StoryFolder {}", fullName);\r
- // actual.remove(IOctopusAPI.NAME);\r
- // actual.append(IOctopusAPI.NAME, fullName);\r
- // }\r
- //\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- public void removeProgressListener(IProgressEventListener listener) {\r
- progressListenerList.remove(IProgressEventListener.class, listener);\r
- }\r
-\r
- void setObjectID(Map<Long, Object> current, long id, BasicDBObject objectToSave) {\r
- Object _id = current.get(id);\r
- if (_id == null)\r
- return;\r
- objectToSave.put(IOctopusAPI._ID, _id);\r
- }\r
-\r
- private void storeRundown(BasicDBObject rundown) {\r
- logger.trace(ENTER);\r
- String name = rundown.containsKey(IOctopusAPI.NAME) ? rundown.getString(IOctopusAPI.NAME) : null;\r
- logger.debug("Storing rundown {} {}", name, rundown.get(IOctopusAPI.SCHEDULED_START));\r
- BasicDBObject rundownWithStories = queryRundown(rundown, FIELDS_RUNDOWN_STORIES);\r
- if (rundownWithStories != null) {\r
- Date scheduledStart = toDate(rundown, IOctopusAPI.SCHEDULED_START);\r
- if (scheduledStart != null && scheduledStart.after(zeroDate.getTime())) {\r
- BasicDBList stories = NoSQLUtils.asDBList(rundownWithStories, IOctopusAPI.SLUGS);\r
- if (stories != null)\r
- storeRundownStories(stories);\r
- rundown.put(IOctopusAPI.SCHEDULED_START, toDate(rundown, IOctopusAPI.SCHEDULED_START));\r
- rundown.put(IOctopusAPI.MODIFIED, toDate(rundown, IOctopusAPI.MODIFIED));\r
- DBCollection collection = db.getCollection(RUNDOWN_COLLECTION);\r
- long rundownID = NoSQLUtils.asLong(rundown, IOctopusAPI.ID);\r
- setObjectID(currentRundowns, rundownID, rundown);\r
- collection.save(rundown);\r
- }\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeRundowns(BasicDBList rundowns, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> rundownsList = NoSQLUtils.asList(rundowns);\r
- int idx = 1;\r
- for (BasicDBObject rundown : rundownsList) {\r
- //logger.info(CHECKING_RUNDOWN, rundown.getLong(IOctopusAPI.ID), rundownsList.size(), idx);\r
- storeRundown(rundown);\r
- int progress = idx * 50 / rundownsList.size();\r
- if (progress - progressEvent.getProgress() > 0) {\r
- progressEvent.setProgress(progress);\r
- fireProgressEvent(progressEvent);\r
- }\r
-\r
- idx++;\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeRundownStories(BasicDBList slugs) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> slugsList = NoSQLUtils.asList(slugs);\r
- for (BasicDBObject slug : slugsList) {\r
- if (slug.containsKey(IOctopusAPI.STORY))\r
- storeStory((BasicDBObject) slug.get(IOctopusAPI.STORY));\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStory(BasicDBObject story) {\r
- logger.trace(ENTER);\r
- if (!story.containsKey(IOctopusAPI.ID)) {\r
- logger.error("Missing id in story {}", story.toPrettyString(null));\r
- return;\r
- }\r
- long storyID = story.getLong(IOctopusAPI.ID);\r
- boolean isContains = storyIDs.contains(storyID);\r
- if (isContains)\r
- return;\r
- storyIDs.add(storyID);\r
- story.put(IOctopusAPI.MODIFIED, toDate(story, IOctopusAPI.MODIFIED));\r
- BasicDBList rundownRef = storyRundowns.get(storyID);\r
- BasicDBList storyFolderRef = storyStoryFolders.get(storyID);\r
- BasicDBList modifiedMOS = extractRelevantMOSObjects(story);\r
-\r
- DBCollection collection = db.getCollection(STORY_COLLECTION);\r
-\r
- if (rundownRef != null)\r
- story.put(IOctopusAPI.REF_RUNDOWN, rundownRef);\r
- if (storyFolderRef != null)\r
- story.put(IOctopusAPI.REF_STORYFOLDER, storyFolderRef);\r
- String scriptContent = extractScriptContent(story);\r
- story.put(IOctopusAPI.SCRIPT_CONTENT, scriptContent);\r
- if (modifiedMOS == null || modifiedMOS.isEmpty()) {\r
- if (story.containsKey(IOctopusAPI.MOS_OBJECTS))\r
- story.remove(IOctopusAPI.MOS_OBJECTS);\r
- } else\r
- story.put(IOctopusAPI.MOS_OBJECTS, modifiedMOS);\r
-\r
- String parentStoryId = extractCustomColumnValue(IOctopusAPI.PARENT_STORY_ID, story);\r
- if (parentStoryId == null) {\r
- logger.warn("Missing {} in story", IOctopusAPI.PARENT_STORY_ID, story.toPrettyString(null));\r
- story.append(IOctopusAPI.PARENT_STORY_ID, storyID);\r
- } else\r
- story.append(IOctopusAPI.PARENT_STORY_ID, parentStoryId);\r
- logger.debug(SAVING_STORY_ID, storyID);\r
- setObjectID(currentStories, storyID, story);\r
- collection.save(story);\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStoryFolder(BasicDBObject storyFolder, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- BasicDBObject storyFoldersWithStories = queryStoryFolder(storyFolder, FIELDS_STORYFOLDER_STORIES);\r
- if (storyFoldersWithStories != null) {\r
- BasicDBList stories = NoSQLUtils.asDBList(storyFoldersWithStories, IOctopusAPI.STORIES);\r
- if (stories != null)\r
- storeStoryFolderStories(stories);\r
- storyFolder.put(IOctopusAPI.MODIFIED, toDate(storyFolder, IOctopusAPI.MODIFIED));\r
- DBCollection collection = db.getCollection(FOLDER_COLLECTION);\r
- String name = storyFolder.getString(IOctopusAPI.NAME);\r
- logger.debug("Storing story folder {}", name);\r
- long folderID = NoSQLUtils.asLong(storyFolder, IOctopusAPI.ID);\r
- setObjectID(currentFolder, folderID, storyFolder);\r
- collection.save(storyFolder);\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStoryFolders(BasicDBList storyFolders, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> storyFolderList = NoSQLUtils.asList(storyFolders);\r
- int idx = 1;\r
- for (BasicDBObject storyFolder : storyFolderList) {\r
- logger.debug(String.format(CHECKING_STORY_FOLDER, storyFolder.getLong(IOctopusAPI.ID), storyFolderList.size(), idx));\r
- storeStoryFolder(storyFolder, lastUpdateTime);\r
- int progress = 50 + (idx * 50 / storyFolderList.size());\r
- if (progress - progressEvent.getProgress() > 0) {\r
- progressEvent.setProgress(progress);\r
- fireProgressEvent(progressEvent);\r
- }\r
- idx++;\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStoryFolderStories(BasicDBList stories) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> list = NoSQLUtils.asList(stories);\r
- for (BasicDBObject story : list)\r
- storeStory(story);\r
- logger.trace(EXIT);\r
- }\r
-\r
- private Date toDate(BasicDBObject obj, String name) {\r
- Date result = null;\r
- if (obj.containsKey(name)) {\r
- String dt = obj.getString(name);\r
- if (dt != null) {\r
- // create jodatime from date\r
- DateTime jdt = new DateTime(dt);\r
- result = jdt.toDate();\r
- }\r
- }\r
- return result;\r
- }\r
-\r
- private void updateDeleteDiff(String oldCollectionName, String newCollectionName, String idFieldName) {\r
- DBCollection oldCollection = db.getCollection(oldCollectionName);\r
- DBCollection newCollection = db.getCollection(newCollectionName);\r
- DBCursor oldCollectionCursor = oldCollection.find(new BasicDBObject(), new BasicDBObject(idFieldName, 1));\r
- if (!oldCollectionCursor.hasNext()) {\r
- logger.error("{} collection is empty", newCollectionName);\r
- return;\r
- }\r
- List<BasicDBObject> oldItems = ListUtils.cast(oldCollectionCursor.toArray());\r
-\r
- DBCursor newCollectionCursor = newCollection.find();\r
- ConcurrentHashMap<Long, BasicDBObject> newItems = null;\r
- if (newCollectionCursor.hasNext()) {\r
- List<BasicDBObject> newList = ListUtils.cast(newCollectionCursor.toArray());\r
- newItems = ListUtils.map(newList, item -> item.getLong(IOctopusAPI.ID));\r
- }\r
- if (newItems == null)\r
- newItems = new ConcurrentHashMap<>();\r
-\r
- for (BasicDBObject oldItem : oldItems) {\r
- if (oldItem == null) {\r
- logger.error("Item is null");\r
- continue;\r
- }\r
- if (!oldItem.containsKey(idFieldName)) {\r
- logger.error("{} is null", idFieldName);\r
- continue;\r
- }\r
- long id = oldItem.getLong(idFieldName);\r
- BasicDBObject newItem = newItems.get(id);\r
- if (newItem == null) {\r
- //remove\r
- logger.info("Deleting {}", oldItem.toPrettyString(null));\r
- oldCollection.remove(new BasicDBObject(idFieldName, id));\r
- }\r
- }\r
- }\r
-\r
- private void updateDiff(String oldCollectionName, String newCollectionName, String idFieldName) {\r
- DBCollection oldCollection = db.getCollection(oldCollectionName);\r
- DBCollection newCollection = db.getCollection(newCollectionName);\r
- DBCursor newCollectionCursor = newCollection.find();\r
- if (!newCollectionCursor.hasNext()) {\r
- logger.error("{} collection is empty", newCollectionName);\r
- return;\r
- }\r
-\r
- List<BasicDBObject> newItems = ListUtils.cast(newCollectionCursor.toArray());\r
-\r
- DBCursor oldCollectionCursor = oldCollection.find();\r
- ConcurrentHashMap<Long, BasicDBObject> oldItems = null;\r
- if (oldCollectionCursor.hasNext()) {\r
- List<BasicDBObject> oldList = ListUtils.cast(oldCollectionCursor.toArray());\r
- oldItems = ListUtils.map(oldList, item -> item.getLong(IOctopusAPI.ID));\r
- }\r
- if (oldItems == null)\r
- oldItems = new ConcurrentHashMap<>();\r
- for (BasicDBObject newItem : newItems) {\r
- if (newItem == null) {\r
- logger.error("Item is null");\r
- continue;\r
- }\r
- if (!newItem.containsKey(idFieldName)) {\r
- logger.error("{} is null", idFieldName);\r
- continue;\r
- }\r
- long id = newItem.getLong(idFieldName);\r
- BasicDBObject oldItem = oldItems.get(id);\r
- boolean save = false;\r
- if (oldItem == null) {\r
- //save\r
- save = true;\r
- } else {\r
- //compare\r
- Object oldDbId = oldItem.getID();\r
- newItem.remove(IOctopusAPI._ID);\r
- oldItem.remove(IOctopusAPI._ID);\r
-\r
- if (!newItem.equals(oldItem)) {\r
- //save\r
- newItem.put(IOctopusAPI._ID, oldDbId);\r
- save = true;\r
- }\r
- }\r
-\r
- if (save) {\r
- logger.info("Saving to {} item {}", oldCollectionName, id);\r
- oldCollection.save(newItem);\r
- }\r
- }\r
- }\r
-\r
-}\r
\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.mediatool.Timecode;\r
import user.commons.mediatool.Timecode.Type;\r
import user.commons.remotestore.IProgressEventListener;\r
public class TSMBackupStep extends JobStep {\r
private static final String MXFEXT = ".MXF";\r
private static final Logger logger = LogManager.getLogger();\r
+ private static boolean RANDOMIZE_ARCHIVES = SystemConfiguration.getInstance().value("tsm.randomize-archives");\r
private IItemManager manager;\r
private File sourceMediaFile;\r
private Store tsmStore;\r
if (existingMediaId == 0)\r
existingMediaId = ItemManagerExtensions.getExistingRundownMedia(manager, sourceFileName.replace(MXFEXT, ""));\r
\r
- boolean randomizeName = Boolean.parseBoolean(System.getProperty("jobengine.randomize.archives", "false"));\r
-\r
String targetFileName;\r
- if (randomizeName) {\r
+ if (RANDOMIZE_ARCHIVES) {\r
// a-z, A-Z, 0-9. For example: WRMcpIk7, s57JwCVA\r
//veletlenszeru neveket adunk!\r
targetFileName = String.format("%s-%s", RandomStringUtils.randomAlphanumeric(8), sourceFileName);\r
package user.jobengine.server.steps;\r
\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.remotestore.RemoteStoreProtocol;\r
import user.jobengine.db.ArchivedMedia;\r
import user.jobengine.db.IItemManager;\r
import user.jobengine.server.IJobRuntime;\r
\r
public class TSMExtendedRetrieveStep extends TSMRestoreStep {\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
+\r
private boolean useNexioTarget;\r
private int nexioPort;\r
private String nexioUserName, nexioPassword;\r
protected StoreUri createTargetUri(IItemManager manager, String targetPath) throws NullPointerException {\r
StoreUri result = null;\r
if (useNexioTarget) {\r
- nexioHost = System.getProperty("nexio.host");\r
- if (nexioHost == null) {\r
+ if (NEXIO_HOST == null) {\r
throw new NullPointerException("Missing system property on 'nexio.host' name");\r
}\r
- result = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ result = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
result.setPortNumber(nexioPort);\r
result.setUserName(nexioUserName);\r
result.setPassword(nexioPassword);\r
\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.remotestore.IProgressEventListener;\r
import user.commons.remotestore.IStatusEventListener;\r
import user.commons.remotestore.ProgressEvent;\r
public class TSMWriterStep extends JobStep {\r
private static final String MXFEXT = ".MXF";\r
private static final Logger logger = LogManager.getLogger();\r
+ private static boolean RANDOMIZE_ARCHIVES = SystemConfiguration.getInstance().value("tsm.randomize-archives");\r
private IItemManager manager;\r
private File sourceMediaFile;\r
private Store tsmStore;\r
if (existingMediaId == 0)\r
existingMediaId = ItemManagerExtensions.getExistingRundownMedia(manager, sourceFileName.replace(MXFEXT, ""));\r
\r
- boolean randomizeName = Boolean.parseBoolean(System.getProperty("jobengine.randomize.archives", "false"));\r
-\r
String targetFileName;\r
- if (randomizeName) {\r
+ if (RANDOMIZE_ARCHIVES) {\r
// a-z, A-Z, 0-9. For example: WRMcpIk7, s57JwCVA\r
//veletlenszeru neveket adunk!\r
targetFileName = String.format("%s-%s", RandomStringUtils.randomAlphanumeric(8), sourceFileName);\r
import org.apache.logging.log4j.message.ParameterizedMessage;\r
\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.remotestore.RemoteStoreProtocol;\r
import user.commons.selenio.wsclient.AudioSource;\r
import user.commons.selenio.wsclient.Clip;\r
private static final String MXFEXT = ".MXF";\r
private static final String LOWRES_FILETYPE = "Low-res";\r
private static final Logger logger = LogManager.getLogger();\r
+ private static String SELENIO_API_ADDRESS = SystemConfiguration.getInstance().value("services.selnio.api.address",\r
+ "http://10.10.1.71:44000/TranscodeMgrWS?wsdl");\r
+ private static String SELENIO_API_PROJECTFILE = SystemConfiguration.getInstance().value("services.selnio.api.projevt-file",\r
+ "\\\\10.10.1.71\\Data\\Blueprints\\MP4_H264_AAC.zenium");\r
private final List<State> showStoppers = Arrays.asList(State.CANCELLED, State.COMPLETE, State.FAILED);\r
private TranscodeMgrWS transcoder = null;\r
- private String address = null; //"http://10.10.1.71:44000/TranscodeMgrWS?wsdl";\r
- private String projectFilePath = null; //"\\\\10.10.1.71\\Data\\Blueprints\\MP4_H264_AAC_v4.zenium";\r
private IItemManager manager;\r
private Store store;\r
private FileType fileType;\r
\r
Path inputPath = Paths.get(globalSourcePath, sourceFileName);\r
String sourceFilePath = inputPath.toString();\r
- TranscodeRequest transcodeRequest = buildTranscodeRequest(projectFilePath, sourceFilePath);\r
+ TranscodeRequest transcodeRequest = buildTranscodeRequest(SELENIO_API_PROJECTFILE, sourceFilePath);\r
TranscodeTask transcodeTask = transcoder.submitTranscodeTask(transcodeRequest);\r
\r
if (transcodeTask == null)\r
}\r
\r
private void setAndCheck(String globalSourcePath, String transcoderTargetPath, IJobEngine jobEngine) throws Exception {\r
- address = System.getProperty("jobengine.selenio.address");\r
- if (StringUtils.isBlank(address))\r
+ if (StringUtils.isBlank(SELENIO_API_ADDRESS))\r
throw new NullPointerException("System is not configured properly, 'jobengine.selenio.address' startup parameter missing.");\r
\r
- projectFilePath = System.getProperty("jobengine.selenio.projectfilepath");\r
- if (StringUtils.isBlank(projectFilePath))\r
+ if (StringUtils.isBlank(SELENIO_API_PROJECTFILE))\r
throw new NullPointerException("System is not configured properly, 'jobengine.selenio.projectfilepath' startup parameter missing.");\r
- TranscodeMgrWSService service = new TranscodeMgrWSService(new URL(address),\r
- new QName("http://ws.server.mediamanager.digitalrapids.ca/", "TranscodeMgrWSService"));\r
+ TranscodeMgrWSService service = new TranscodeMgrWSService(new URL(SELENIO_API_ADDRESS), new QName("http://ws.server.mediamanager.digitalrapids.ca/", "TranscodeMgrWSService"));\r
transcoder = service.getTranscodeMgrWSPort();\r
\r
if (StringUtils.isBlank(globalSourcePath))\r
package user.jobengine.server.steps;\r
\r
+import user.commons.configuration.SystemConfiguration;\r
import user.jobengine.db.Media;\r
import user.jobengine.server.IJobEngine;\r
import user.jobengine.server.IJobRuntime;\r
\r
public class TranscodeStep extends JobStep {\r
+ private static int TRANSCODER_VERSION = SystemConfiguration.getInstance().value("services.transcoder.version");\r
+ private static String TRANSCODER_API_ADDRESS = SystemConfiguration.getInstance().value("services.transcoder.api.address");\r
+ private static String TRANSCODER_API_TEMPLATE = SystemConfiguration.getInstance().value("services.transcoder.api.template");\r
+\r
@StepEntry\r
public Object[] execute(String globalSourcePath, ArchiveItem archiveItem, Media mediaCubeMedia, String transcoderTargetPath, IJobEngine jobEngine,\r
IJobRuntime jobRuntime) throws Exception {\r
- int version = 0;\r
- try {\r
- version = Integer.parseInt(System.getProperty("jobengine.transcoder.version"));\r
- } catch (Exception e) {\r
- }\r
- switch (version) {\r
+ switch (TRANSCODER_VERSION) {\r
case 0: {\r
TranscodeSELENIOStep selenioStep = new TranscodeSELENIOStep();\r
selenioStep.execute(globalSourcePath, archiveItem, mediaCubeMedia, transcoderTargetPath, jobEngine, jobRuntime);\r
}\r
case 1: {\r
TranscodeFFAStranStep ffaStransStep = new TranscodeFFAStranStep();\r
- String transcoderAddress = System.getProperty("jobengine.transcoder.address");\r
- String transcoderTemplateName = System.getProperty("jobengine.transcoder.template");\r
- ffaStransStep.execute(archiveItem, mediaCubeMedia, transcoderAddress, transcoderTemplateName, globalSourcePath, transcoderTargetPath, false,\r
+ ffaStransStep.execute(archiveItem, mediaCubeMedia, TRANSCODER_API_ADDRESS, TRANSCODER_API_TEMPLATE, globalSourcePath, transcoderTargetPath, false,\r
jobEngine, jobRuntime);\r
break;\r
}\r
\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.remotestore.IProgressEventListener;\r
import user.commons.remotestore.IStatusEventListener;\r
\r
public class UploadRecordingToNexioStep extends JobStep {\r
private static final Logger logger = LogManager.getLogger();\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
\r
private IItemManager manager;\r
private DB db;\r
logger.catching(e);\r
if (!archiveItem.removeCatchedFile())\r
logger.error(getMarker(), "A {} állomány .catched jelző állománya nem törölhető.", new File(archiveItem.getMediaFile()).getName());\r
- Message m = new ParameterizedMessage("Az '{}' állomány feltöltése '{}' néven sikertelen. A rendszer hibaüzenete: {}", sourceFile, targetFileName,\r
- e.getMessage());\r
+ Message m = new ParameterizedMessage("Az '{}' állomány feltöltése '{}' néven sikertelen. A rendszer hibaüzenete: {}", sourceFile, targetFileName, e\r
+ .getMessage());\r
logger.error(marker, m);\r
throw new Exception(m.getFormattedMessage());\r
}\r
\r
check(targetFileName, "targetFileName");\r
\r
- String nexioHost = System.getProperty("nexio.host");\r
- if (StringUtils.isBlank(nexioHost)) {\r
+ if (StringUtils.isBlank(NEXIO_HOST)) {\r
logger.error(marker, "A 'nexio.host' rendszer paraméter nem található.");\r
throw new NullPointerException("System is not configured properly, 'jobengine.selenio.address' startup parameter missing.");\r
}\r
check(nexioUserName, "nexioUserName");\r
check(nexioPassword, "nexioPassword");\r
\r
- targetUri = manager.createStoreUri(RemoteStoreProtocol.FTP, nexioHost);\r
+ targetUri = manager.createStoreUri(RemoteStoreProtocol.FTP, NEXIO_HOST);\r
targetUri.setRootPath("LXF");\r
targetUri.setPortNumber(nexioPort);\r
targetUri.setUserName(nexioUserName);\r
com.fasterxml.jackson.core;version="2.4.5",
com.fasterxml.jackson.databind;version="2.4.5",
com.fasterxml.jackson.databind.util;version="2.4.5",
+ com.fasterxml.jackson.dataformat.yaml;version="2.4.5",
com.fasterxml.jackson.datatype.joda;version="2.4.5",
com.fasterxml.jackson.jaxrs.json;version="2.4.5",
com.sun.jna,
org.osgi.framework;version="1.5.0"
DynamicImport-Package: *
Bundle-ClassPath: .
-Service-Component: OSGI-INF/nexioAPI.xml, OSGI-INF/octopusAPI.xml
+Service-Component: OSGI-INF/nexioAPI.xml, OSGI-INF/octopusAPI.xml, OSGI-INF/systemConfiguration.xml
Export-Package: user.commons,
user.commons.cluster,
user.commons.config,
+ user.commons.configuration,
user.commons.ftp,
user.commons.harris,
user.commons.logging,
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" enabled="true" immediate="true" name="user.commons.configuration">\r
+ <implementation class="user.commons.configuration.SystemConfiguration" />\r
+ <service>\r
+ <provide interface="user.commons.configuration.IConfiguration"/>\r
+ </service>\r
+</scr:component>\r
package user.commons;\r
\r
import java.io.File;\r
-import java.io.IOException;\r
import java.nio.file.Files;\r
-import java.nio.file.LinkOption;\r
-import java.nio.file.Path;\r
import java.nio.file.Paths;\r
import java.util.List;\r
import java.util.concurrent.Executors;\r
\r
public class FFAStransAPI implements IFFAStransAPI {\r
\r
- static {\r
- try {\r
- Path config = Paths.get(System.getProperty("user.dir"), "../-configuration/log4j2-test.xml");\r
- String configLocation = config.toRealPath(LinkOption.NOFOLLOW_LINKS).toString();\r
- System.setProperty("log4j.configurationFile", configLocation);\r
- } catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- }\r
- }\r
-\r
private static final Logger logger = LogManager.getLogger();\r
\r
public static void main(String[] args) throws Exception {\r
\r
import com.ibm.db2.jcc.DB2SimpleDataSource;\r
\r
+import user.commons.configuration.IConfiguration;\r
+import user.commons.configuration.SystemConfiguration;\r
+\r
public class MediaCubeDataSourceFactory {\r
private static Logger logger = LogManager.getLogger();\r
- private static DB2SimpleDataSource dataSource;\r
- private static DB2SimpleDataSource noSQLDataSource;\r
- private static String DBURL = "jobengine.db.url";\r
- private static String DBUSERNAME = "jobengine.db.user";\r
- private static String DBPASSWORD = "jobengine.db.password";\r
- private static String DBLOGINTIMEOUT = "jobengine.db.loginTimeout";\r
- private static String NOSQLURL = "jobengine.nosql.db.url";\r
- private static String NOSQLUSERNAME = "jobengine.nosql.db.user";\r
- private static String NOSQLPASSWORD = "jobengine.nosql.db.password";\r
- private static String NOSQLLOGINTIMEOUT = "jobengine.nosql.db.loginTimeout";\r
- // Url = System.getProperty("jobengine.nosql.db.url");\r
- // User = System.getProperty("jobengine.nosql.db.user");\r
- // Pass = System.getProperty("jobengine.nosql.db.password");\r
+ private static DataSource dataSource;\r
+ private static DataSource noSQLDataSource;\r
\r
public static DataSource getDatasource() {\r
- if (dataSource == null) {\r
- try {\r
- String[] dbUri = System.getProperty(DBURL).split("/");\r
- dataSource = new DB2SimpleDataSource();\r
- dataSource.setDriverType(4);\r
- dataSource.setRetrieveMessagesFromServerOnGetMessage(true);\r
- dataSource.setDatabaseName(dbUri[dbUri.length - 1]);\r
- dataSource.setServerName(dbUri[2].substring(0, dbUri[2].lastIndexOf(":")));\r
- dataSource.setUser(System.getProperty(DBUSERNAME));\r
- dataSource.setPassword(System.getProperty(DBPASSWORD));\r
- dataSource.setPortNumber(Integer.parseInt(dbUri[2].substring(dbUri[2].lastIndexOf(":") + 1)));\r
- String timeout = System.getProperty(DBLOGINTIMEOUT);\r
- if (timeout == null)\r
- dataSource.setLoginTimeout(1);\r
- else\r
- dataSource.setLoginTimeout(Integer.parseInt(timeout));\r
- // Connection connection = dataSource.getConnection();\r
- // System.out.println(connection);\r
- } catch (Exception e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- }\r
- }\r
-\r
+ if (dataSource == null)\r
+ dataSource = getDatasource("datasource.mediacube");\r
return dataSource;\r
}\r
\r
- public static DataSource getNoSQLDatasource() {\r
- if (noSQLDataSource == null) {\r
- try {\r
- String[] dbUri = System.getProperty(NOSQLURL).split("/");\r
- noSQLDataSource = new DB2SimpleDataSource();\r
- noSQLDataSource.setDriverType(4);\r
- noSQLDataSource.setRetrieveMessagesFromServerOnGetMessage(true);\r
- noSQLDataSource.setDatabaseName(dbUri[dbUri.length - 1]);\r
- noSQLDataSource.setServerName(dbUri[2].substring(0, dbUri[2].lastIndexOf(":")));\r
- noSQLDataSource.setUser(System.getProperty(NOSQLUSERNAME));\r
- noSQLDataSource.setPassword(System.getProperty(NOSQLPASSWORD));\r
- noSQLDataSource.setPortNumber(Integer.parseInt(dbUri[2].substring(dbUri[2].lastIndexOf(":") + 1)));\r
- String timeout = System.getProperty(NOSQLLOGINTIMEOUT);\r
- if (timeout == null)\r
- noSQLDataSource.setLoginTimeout(3);\r
- else\r
- noSQLDataSource.setLoginTimeout(Integer.parseInt(timeout));\r
- // Connection connection = dataSource.getConnection();\r
- // System.out.println(connection);\r
- } catch (Exception e) {\r
- logger.error(e);\r
- }\r
+ private static DataSource getDatasource(String fqn) {\r
+ DB2SimpleDataSource result = null;\r
+ try {\r
+ IConfiguration conf = SystemConfiguration.getInstance();\r
+ String url = conf.value(fqn + ".url");\r
+ String[] dbUri = url.split("/");\r
+ result = new DB2SimpleDataSource();\r
+ result.setDriverType(4);\r
+ result.setRetrieveMessagesFromServerOnGetMessage(true);\r
+ result.setDatabaseName(dbUri[dbUri.length - 1]);\r
+ result.setServerName(dbUri[2].substring(0, dbUri[2].lastIndexOf(":")));\r
+ result.setUser(conf.value(fqn + ".user"));\r
+ result.setPassword(conf.value(fqn + ".password"));\r
+ result.setPortNumber(Integer.parseInt(dbUri[2].substring(dbUri[2].lastIndexOf(":") + 1)));\r
+ result.setLoginTimeout(conf.value(fqn + ".login-timeout", 3));\r
+ } catch (Exception e) {\r
+ logger.error(e);\r
}\r
+ return result;\r
+ }\r
+\r
+ public static DataSource getNoSQLDatasource() {\r
+ if (noSQLDataSource == null)\r
+ noSQLDataSource = getDatasource("datasource.mediacube-nosql");\r
\r
return noSQLDataSource;\r
}\r
+\r
+ public static int getPoolSize() {\r
+ return SystemConfiguration.getInstance().value("datasource.mediacube.pool-size", 10);\r
+ }\r
}\r
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import user.commons.configuration.SystemConfiguration;
import user.commons.remotestore.DeliveryMethod;
import user.commons.remotestore.DirectoryUtils;
import user.commons.remotestore.IDirectoryLister;
@SuppressWarnings("serial")
public class StoreUri extends EntityBase implements Serializable {
private final static Logger logger = LogManager.getLogger();
- private static final String validateTransfers = System.getProperty("jobengine.validateTransfers", "false");
+ private static final boolean VALIDATETRANSFERS = SystemConfiguration.getInstance().value("jobs.validate-transfers", false);
- private final int BUFFER_SIZE = 32768;
+ private final int BUFFER_SIZE = SystemConfiguration.getInstance().value("jobs.copy-buffer-size", 32768);
private String uri = null;
private long storeId = 0;
private boolean isStream = false;
RemoteFile result = null;
long uploadedBytes = 0;
int byteCount = 0;
- byte[] buffer = null;
-
- try {
- String bufferSizeProperty = System.getProperty("mediacube.copybuffer.size");
- buffer = new byte[Integer.parseInt(bufferSizeProperty)];
- } catch (Exception e) {
- buffer = new byte[BUFFER_SIZE];
- }
+ byte[] buffer = new byte[BUFFER_SIZE];
result = new RemoteFile();
String targetFileName = targetName;
}
result.setSize(uploadedBytes);
- if ("true".equals(validateTransfers)) {
+ if ("true".equals(VALIDATETRANSFERS)) {
//validate
try {
RemoteFile remoteFile = outputLister.get(targetFileName);
package user.commons.config;\r
\r
-import java.io.File;\r
import java.nio.file.Files;\r
import java.nio.file.Paths;\r
\r
private static ObjectMapper objectMapper = createMapper();\r
\r
public static ObjectMapper createMapper() {\r
- return new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)\r
- .registerModule(new JodaModule()).setSerializationInclusion(Include.NON_NULL);\r
+ return new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)\r
+ .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)\r
+ .registerModule(new JodaModule())\r
+ .setSerializationInclusion(Include.NON_NULL);\r
}\r
\r
- public static <T> T read(String locationProperty, Class<T> type) throws Exception {\r
+ public static <T> T read(String configFilePath, Class<T> type) throws Exception {\r
T result = null;\r
- String configPath = System.getProperty(locationProperty);\r
- if (configPath == null || "".equals(configPath))\r
- throw new Exception("Missing system property: " + locationProperty);\r
- File configFile = new File(configPath);\r
- if (configFile.exists()) {\r
- String json = new String(Files.readAllBytes(Paths.get(configFile.getAbsolutePath())));\r
-\r
- try {\r
- result = objectMapper.readValue(json.getBytes(), type);\r
-\r
- } catch (Exception e) {\r
- logger.error(e);\r
- throw e;\r
- }\r
- } else {\r
- logger.error("Missing '{}' configuration file: {}", configPath, configFile.getAbsolutePath());\r
+\r
+ try {\r
+ String json = new String(Files.readAllBytes(Paths.get(configFilePath)));\r
+ result = objectMapper.readValue(json.getBytes(), type);\r
+\r
+ } catch (Exception e) {\r
+ logger.error(e);\r
+ throw e;\r
}\r
\r
return result;\r
--- /dev/null
+package user.commons.configuration;\r
+\r
+import java.io.FileNotFoundException;\r
+\r
+public interface IConfiguration {\r
+\r
+ String getConfig(String relativeConfigName) throws FileNotFoundException;\r
+\r
+ void load(String file) throws Exception;\r
+\r
+ <T> T value(String fqn);\r
+\r
+ <T> T value(String fqn, T defValue);\r
+\r
+}\r
--- /dev/null
+package user.commons.configuration;\r
+\r
+import java.io.FileNotFoundException;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import com.fasterxml.jackson.databind.ObjectMapper;\r
+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;\r
+\r
+public class SystemConfiguration implements IConfiguration {\r
+ private static Logger logger = LogManager.getLogger();\r
+\r
+ static IConfiguration currentInstance = null;\r
+\r
+ static public IConfiguration getInstance() {\r
+ if (currentInstance == null)\r
+ currentInstance = new SystemConfiguration();\r
+ return currentInstance;\r
+ }\r
+\r
+ private Map<String, Object> settings;\r
+\r
+ public SystemConfiguration() {\r
+ try {\r
+ load(getConfig("configuration/application.yaml"));\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ }\r
+ currentInstance = this;\r
+ }\r
+\r
+ @Override\r
+ public String getConfig(String relativeConfigName) throws FileNotFoundException {\r
+ Path result = Paths.get(System.getProperty("user.dir", ""), relativeConfigName);\r
+ if (result.toFile().exists())\r
+ return result.toString();\r
+ result = Paths.get(System.getProperty("system.config.root", ""), relativeConfigName);\r
+ if (result.toFile().exists())\r
+ return result.toString();\r
+ throw new FileNotFoundException("Cant find configuration file " + relativeConfigName);\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public void load(String file) throws Exception {\r
+ logger.info("Loading system configuration {}", file);\r
+ if (file != null) {\r
+ String yaml = new String(Files.readAllBytes(Paths.get(file)));\r
+ settings = new ObjectMapper(new YAMLFactory()).readValue(yaml, HashMap.class);\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public <T> T value(String fqn) {\r
+ T result = null;\r
+ String[] tokens = fqn.split("\\.");\r
+ Map<String, Object> parent = settings;\r
+ for (int i = 0; i < tokens.length - 1; i++) {\r
+ parent = (Map<String, Object>) parent.get(tokens[i]);\r
+ }\r
+ if (parent != null)\r
+ result = (T) parent.get(tokens[tokens.length - 1]);\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public <T> T value(String fqn, T defValue) {\r
+ T result = null;\r
+ try {\r
+\r
+ result = value(fqn);\r
+ if (!result.getClass().isAssignableFrom(defValue.getClass()))\r
+ throw new ClassCastException(result.getClass() + " ? " + defValue.getClass());\r
+ } catch (Exception e) {\r
+ logger.error("{} read error. {}", fqn, e.getMessage());\r
+ result = defValue;\r
+ }\r
+ return result;\r
+ }\r
+\r
+}\r
return memoryAppender;\r
}\r
\r
- // public static Logger getLogger(Class<?> clazz) {\r
- // Logger result = null;\r
- // try {\r
- // Logger root = Logger.getRootLogger();\r
- //\r
- // // Configure and watch\r
- // String configFilePath = System.getProperty(LOGCONFIG);\r
- // if (!configured && !StringUtils.isEmpty(configFilePath)) {\r
- // File configFile = new File(configFilePath);\r
- // if (configFile.exists()) {\r
- // PropertyConfigurator.configureAndWatch(configFile.getAbsolutePath(), 3000);\r
- // configured = true;\r
- // }\r
- // }\r
- //\r
- // // Check if root logger configured\r
- // if (!configured && System.getProperty(LOGLEVEL) != null) {\r
- // root.setLevel(Level.toLevel(System.getProperty(LOGLEVEL)));\r
- // if (!root.getAllAppenders().hasMoreElements()) {\r
- // root.addAppender(new ConsoleAppender(new PatternLayout("%p %c# %m%n")));\r
- // }\r
- // root.info("Logging to console");\r
- // configured = true;\r
- // }\r
- //\r
- // // create logger\r
- // result = Logger.getLogger(clazz);\r
- // result.addAppender(memoryAppender);\r
- //\r
- // } catch (Exception e) {\r
- // e.printStackTrace();\r
- // }\r
- //\r
- // return result;\r
- // }\r
- //\r
- // public static void logProperties() {\r
- // Logger logger = LogUtils.getLogger(LogUtils.class);\r
- // for (Object key : System.getProperties().keySet())\r
- // logger.info(key + "," + System.getProperties().get(key));\r
- // }\r
}\r
import com.ibm.nosql.json.api.DBCursor;\r
\r
import user.commons.ListUtils;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.remotestore.IProgressEventListener;\r
import user.commons.remotestore.ProgressEvent;\r
public class NexioDataMiner implements Runnable, INexioChangeListener {\r
private static final Logger logger = LogManager.getLogger();\r
private static final String SQLSERVER_JDBC_SQL_SERVER_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";\r
- private static final String JOBENGINE_NEXIO_DB_PASSWORD = "jobengine.nexio.db.password";\r
- private static final String JOBENGINE_NEXIO_DB_USER = "jobengine.nexio.db.user";\r
- private static final String JOBENGINE_NEXIO_DB_URL = "jobengine.nexio.db.url";\r
private static final String DURATION = "duration";\r
- private static final String START = "start";\r
private static final String MODIFIEDTIMESTAMP = "modifiedtimestamp";\r
private static final String EXTAGENCY = "extagency";\r
private static final String RECORDDATE = "recorddate";\r
private static final String RECORDTIMESTAMP = "recordtimestamp";\r
private static String url, user, pass;\r
static {\r
- url = System.getProperty(JOBENGINE_NEXIO_DB_URL);\r
- user = System.getProperty(JOBENGINE_NEXIO_DB_USER);\r
- pass = System.getProperty(JOBENGINE_NEXIO_DB_PASSWORD);\r
+ url = SystemConfiguration.getInstance().value("datasource.nexio.url");\r
+ user = SystemConfiguration.getInstance().value("datasource.nexio.user");\r
+ pass = SystemConfiguration.getInstance().value("datasource.nexio.password");\r
}\r
\r
private static Connection getSQLConnection() throws ClassNotFoundException, SQLException {\r
import com.ibm.nosql.json.api.DBCollection;\r
\r
import user.commons.MediaCubeMarker;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.commons.nexio.api.Clip;\r
import user.commons.nexio.api.ClipEvent;\r
import user.commons.nexio.api.ClipEventListener;\r
\r
private static final Logger logger = LogManager.getLogger();\r
\r
- private static final String NEXIO_USE_MOS_GATEWAY = "nexio.useMOSGateway";\r
- private static final String NEXIO_DISABLE = "nexio.disable";\r
private static final String ID = "id";\r
private static final String VIDEO_FORMAT = "videoformat";\r
private static final String VIDEO_BITRATE = "videobitrate";\r
private static final String EXTAGENCY = "extagency";\r
private static final String RECORDDATE = "recorddate";\r
private static final String LONGNAMEID = "longnameid";\r
- public static final String CLIP_COLLECTION_NAME = System.getProperty("jobengine.nexio.name");\r
+ public static final String CLIP_COLLECTION_NAME = SystemConfiguration.getInstance().value("services.nexio.collection-name");\r
+ private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
+ private static boolean disabled = SystemConfiguration.getInstance().value("services.nexio.disabled", true);\r
+ private static boolean[] useMOSGateways = new boolean[] { SystemConfiguration.getInstance().value("services.nexio.use-mos-gateway") };\r
+\r
static private final byte[] GET_SPECIAL_ID_ATTRIBUTES_REQ = { (byte) 0xC8, (byte) 0x84 };\r
static private final char[] hexArray = "0123456789ABCDEF".toCharArray();\r
\r
private INexioChangeListener nexioChangeListener;\r
private DB db;\r
\r
- private String NEXIO_HOST = System.getProperty("nexio.host");\r
private Controller controller = null;\r
\r
- private boolean disabled;\r
-\r
private Thread worker;\r
\r
private MediaListener mediaListener;\r
\r
public NexioDispatcher() {\r
this.db = NoSQLUtils.getNoSQLDB();\r
- disabled = Boolean.parseBoolean(System.getProperty(NEXIO_DISABLE, "false"));\r
\r
// Runtime.getRuntime().addShutdownHook(new Thread() {\r
// @Override\r
}\r
\r
private void innerStartup() {\r
- boolean[] useMOSGateway = { Boolean.parseBoolean(System.getProperty(NEXIO_USE_MOS_GATEWAY)) };\r
\r
worker = new Thread(() -> {\r
try {\r
logger.info("Initial clip import started");\r
- if (useMOSGateway[0]) {\r
+ if (useMOSGateways[0]) {\r
NexioDataMiner dm = new NexioDataMiner();\r
dm.transferClips();\r
} else {\r
}\r
\r
/*\r
- \r
+\r
int c = connection.read(buffer, 0, 2);\r
//2 bytes hosszan az idokozben hozzaadott id-k szamossaga\r
if (c < 2) {\r
throw new ProtocolException("c, 2, 2");\r
}\r
//MSB, LSB\r
- \r
+\r
return nofIds;\r
*/\r
return ret;\r
import com.ibm.nosql.json.api.BasicDBObject;\r
import com.ibm.nosql.json.api.DBObject;\r
\r
+import user.commons.configuration.SystemConfiguration;\r
+\r
public interface IOctopusAPI {\r
- static final String RUNDOWN_COLLECTION = System.getProperty("jobengine.octopus.rundowns.name", "rundowns");\r
- static final String STORY_COLLECTION = System.getProperty("jobengine.octopus.stories.name", "stories");\r
- static final String FOLDER_COLLECTION = System.getProperty("jobengine.octopus.storyfolders.name", "storyfolders");\r
+ static final String RUNDOWN_COLLECTION = SystemConfiguration.getInstance().value("services.octopus.rundowns-collection-name");\r
+ static final String STORY_COLLECTION = SystemConfiguration.getInstance().value("services.octopus.stories-collection-name");\r
+ static final String FOLDER_COLLECTION = SystemConfiguration.getInstance().value("services.octopus.folders-collection-name");\r
static final String TIME_COLLECTION_NAME = "time";\r
static final String SCRIPT_CONTENT = "script_content";\r
static final String RUNDOWN_TYPE = "rundownType";\r
+++ /dev/null
-package user.commons.octopus;\r
-\r
-import java.util.Date;\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.concurrent.ConcurrentHashMap;\r
-\r
-import javax.swing.event.EventListenerList;\r
-import javax.ws.rs.client.Entity;\r
-import javax.ws.rs.client.Invocation.Builder;\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-import org.jboss.resteasy.client.jaxrs.BasicAuthentication;\r
-import org.jboss.resteasy.client.jaxrs.ResteasyClient;\r
-import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;\r
-import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;\r
-import org.joda.time.DateTime;\r
-\r
-import com.ibm.nosql.json.JSONUtil;\r
-import com.ibm.nosql.json.api.BasicDBList;\r
-import com.ibm.nosql.json.api.BasicDBObject;\r
-import com.ibm.nosql.json.api.DB;\r
-import com.ibm.nosql.json.api.DBCollection;\r
-import com.ibm.nosql.json.api.DBCursor;\r
-import com.ibm.nosql.json.api.DBObject;\r
-import com.ibm.nosql.json.api.QueryBuilder;\r
-import com.ibm.nosql.json.api.WriteResult;\r
-\r
-import user.commons.ListUtils;\r
-import user.commons.nosql.NoSQLUtils;\r
-import user.commons.remotestore.IProgressEventListener;\r
-import user.commons.remotestore.ProgressEvent;\r
-\r
-public class OctopusDataMiner1 implements Runnable {\r
- private static final String _TMP = "_tmp";\r
- private static final Logger logger = LogManager.getLogger();\r
- private static final String LINEFEED = "\r\n";\r
- private static final String SIMPLE_LINEFEED = "\n";\r
- private static final String SAVING_STORY_ID = "Saving story {}";\r
- // private static final String SAVING_RUNDOWN = "Saving rundown : {} {}";\r
- // private static final String CHECKING_RUNDOWN = "Checking Rundown {} ({}/{})";\r
- private static final String FIELDS_STORYFOLDER_STORIES = "stories,Story.modified,Story.name,Story.id,Story.mosObjects,Story.script,Story.type,Story.format,Story.customColumns,CustomColumn.label,CustomColumn.value";\r
- private static final String FIELDS_RUNDOWN_STORIES = "slugs,Slug.story,Slug.position,Story.name,Story.id,Story.modified,Story.mosObjects,Story.script,Story.type,Story.format,Story.customColumns,CustomColumn.label,CustomColumn.value";\r
- private static final String FIELDS_RUNDOWN_STORYIDS = "id,name,modified,scheduledStart,channel,Channel.name,rundownType,RundownType.name,slugs,Slug.storyId,Slug.position";\r
- private static final String FIELDS_STORY_FOLDER_LIST = "id,name,modified,stories,Story.id";\r
- private static final String RUNDOWN = "Rundown";\r
- private static final String OCTOPUS_DEVICE_NAME = "Octopus-Device-Name";\r
- private static final String OCTOPUS_DEVICE_ID = "Octopus-Device-Id";\r
- private static final String FIELDS = "fields";\r
- private static final String CHECKING_STORY_FOLDER = "Checking StoryFolder %s (%d/%d)";\r
- private static final String EXIT = "Exit";\r
- private static final String RESULT = "result";\r
- private static final String STORY_FOLDER = "StoryFolder";\r
- private static final String ENTER = "Enter";\r
- private static final String FINISHED = "Finished";\r
- private static final String STARTING = "Starting";\r
- private static final String MOSOBJECT = "Bejátszó: ";\r
-\r
- private DB db;\r
- private ResteasyWebTarget webTarget;\r
- private String apiUser;\r
- private String apiPwd;\r
- private HashSet<Long> storyIDs = new HashSet<>();\r
- private EventListenerList progressListenerList;\r
- private ProgressEvent progressEvent = new ProgressEvent(this, 0);\r
- private Map<Long, BasicDBList> storyRundowns;\r
- private Map<Long, BasicDBList> storyStoryFolders;\r
- private Map<Long, BasicDBList> storedStoryRundowns;\r
- private Map<Long, BasicDBList> storedStoryStoryFolders;\r
- private Map<Long, BasicDBList> storedStoryMosObjects;\r
- private String RUNDOWN_COLLECTION = IOctopusAPI.RUNDOWN_COLLECTION;\r
- private String FOLDER_COLLECTION = IOctopusAPI.FOLDER_COLLECTION;\r
- private String STORY_COLLECTION = IOctopusAPI.STORY_COLLECTION;\r
-\r
- private Map<Long, BasicDBList> newRundowns = new HashMap<>();\r
- private Map<Long, BasicDBList> newStoryFolders = new HashMap<>();\r
- private Map<Long, BasicDBList> newStories = new HashMap<>();\r
-\r
- public OctopusDataMiner1() {\r
- db = NoSQLUtils.getNoSQLDB();\r
-\r
- String apiAddress = System.getProperty("jobengine.octopus.api.address");\r
- apiUser = System.getProperty("jobengine.octopus.api.user");\r
- apiPwd = System.getProperty("jobengine.octopus.api.password");\r
-\r
- // ResteasyClient client = new ResteasyClientBuilder().register(JacksonJsonProvider.class).build();\r
- ResteasyClient client = new ResteasyClientBuilder().build();\r
- webTarget = client.target(apiAddress).register(new BasicAuthentication(apiUser, apiPwd));\r
- }\r
-\r
- public void addProgressListener(IProgressEventListener listener) {\r
- if (progressListenerList == null)\r
- progressListenerList = new EventListenerList();\r
- progressListenerList.add(IProgressEventListener.class, listener);\r
- }\r
-\r
- private Map<Long, BasicDBList> buildFolderReferences(BasicDBList storyFolders) {\r
- Map<Long, BasicDBList> result = new HashMap<>();\r
- List<BasicDBObject> storyFolderList = NoSQLUtils.asList(storyFolders);\r
- for (BasicDBObject storyFolder : storyFolderList) {\r
- long storyFolderId = storyFolder.getLong(IOctopusAPI.ID);\r
- List<BasicDBObject> stories = NoSQLUtils.asList(storyFolder, IOctopusAPI.STORIES);\r
- if (stories == null)\r
- continue;\r
- long position = 1;\r
- for (BasicDBObject story : stories) {\r
- long storyId = story.getLong(IOctopusAPI.ID);\r
- BasicDBList references = result.get(storyId);\r
- if (references == null) {\r
- references = new BasicDBList();\r
- result.put(storyId, references);\r
- }\r
- references.add(new BasicDBObject(IOctopusAPI.ID, storyFolderId).append(IOctopusAPI.POSITION, position++));\r
- }\r
- }\r
- return result;\r
- }\r
-\r
- private Map<Long, BasicDBList> buildRundownReferences(BasicDBList rundowns) {\r
- Map<Long, BasicDBList> result = new HashMap<>();\r
- List<BasicDBObject> rundownsList = NoSQLUtils.asList(rundowns);\r
- for (BasicDBObject rundown : rundownsList) {\r
- if (!rundown.containsKey(IOctopusAPI.ID))\r
- continue;\r
- long rundownId = rundown.getLong(IOctopusAPI.ID);\r
- List<BasicDBObject> slugs = NoSQLUtils.asList(rundown, IOctopusAPI.SLUGS);\r
- if (slugs == null)\r
- continue;\r
- for (BasicDBObject slug : slugs) {\r
- if (!slug.containsKey(IOctopusAPI.STORYID))\r
- continue;\r
- long storyId = slug.getLong(IOctopusAPI.STORYID);\r
- BasicDBList references = result.get(storyId);\r
- if (references == null) {\r
- references = new BasicDBList();\r
- result.put(storyId, references);\r
- }\r
- long position = slug.getLong(IOctopusAPI.POSITION);\r
- if (slug.containsKey(IOctopusAPI.POSITION))\r
- position = slug.getLong(IOctopusAPI.POSITION);\r
- references.add(new BasicDBObject(IOctopusAPI.ID, rundownId).append(IOctopusAPI.POSITION, position));\r
- }\r
- }\r
- return result;\r
- }\r
-\r
- private void buildStoriesReferences() {\r
- DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- DBCursor cursor = collection.find(null, new BasicDBObject(IOctopusAPI.ID, 1).append(IOctopusAPI.REF_RUNDOWN, 1).append(IOctopusAPI.REF_STORYFOLDER, 1)\r
- .append(IOctopusAPI.MOS_OBJECTS, 1));\r
- //DBCursor find = collection.find(QueryBuilder.start(ID).greaterThan(0).get());\r
- try {\r
-\r
- while (cursor.hasNext()) {\r
- BasicDBObject story = (BasicDBObject) cursor.next();\r
- long storyId = story.getLong(IOctopusAPI.ID);\r
- BasicDBList rundownRef = NoSQLUtils.asDBList(story, IOctopusAPI.REF_RUNDOWN);\r
- if (rundownRef != null) {\r
- if (storedStoryRundowns == null)\r
- storedStoryRundowns = new HashMap<>();\r
- storedStoryRundowns.put(storyId, rundownRef);\r
- }\r
- BasicDBList storyFolderRef = NoSQLUtils.asDBList(story, IOctopusAPI.REF_STORYFOLDER);\r
- if (storyFolderRef != null) {\r
- if (storedStoryStoryFolders == null)\r
- storedStoryStoryFolders = new HashMap<>();\r
- storedStoryStoryFolders.put(storyId, storyFolderRef);\r
- }\r
-\r
- BasicDBList storyMosObjects = NoSQLUtils.asDBList(story, IOctopusAPI.MOS_OBJECTS);\r
- if (storyMosObjects != null) {\r
- if (storedStoryMosObjects == null)\r
- storedStoryMosObjects = new HashMap<>();\r
- storedStoryMosObjects.put(storyId, storyMosObjects);\r
- }\r
- }\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- } finally {\r
-\r
- }\r
- }\r
-\r
- public void clear() {\r
- db.getCollection(RUNDOWN_COLLECTION).remove();\r
- db.getCollection(STORY_COLLECTION).remove();\r
- db.getCollection(FOLDER_COLLECTION).remove();\r
- db.getCollection(IOctopusAPI.TIME_COLLECTION_NAME).remove();\r
- }\r
-\r
- private String concatParentsToStoryFolder(BasicDBObject actual, String name) {\r
-\r
- String fields = "name,id,parent";\r
- Response response = query("StoryFolder/" + actual.getLong("id"), fields).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- BasicDBObject res = (BasicDBObject) resultObject.get("result");\r
- BasicDBObject parent = (BasicDBObject) res.get("parent");\r
- if (parent == null || parent.isEmpty())\r
- return name;\r
- String parentName = parent.getString(IOctopusAPI.NAME);\r
- String actualName = actual.getString(IOctopusAPI.NAME);\r
- String newName = String.format("%s/%s", parentName, actualName);\r
- return concatParentsToStoryFolder(parent, newName);\r
- }\r
-\r
- private void deleteDiff(String oldCollectionName, String newCollectionName, String idFieldName) {\r
- DBCollection oldCollection = db.getCollection(oldCollectionName);\r
- DBCollection newCollection = db.getCollection(newCollectionName);\r
- DBCursor oldCollectionCursor = oldCollection.find(new BasicDBObject(), new BasicDBObject(idFieldName, 1));\r
- if (!oldCollectionCursor.hasNext()) {\r
- logger.error("{} collection is empty", newCollectionName);\r
- return;\r
- }\r
- List<BasicDBObject> oldItems = ListUtils.cast(oldCollectionCursor.toArray());\r
-\r
- DBCursor newCollectionCursor = newCollection.find();\r
- ConcurrentHashMap<Long, BasicDBObject> newItems = null;\r
- if (newCollectionCursor.hasNext()) {\r
- List<BasicDBObject> newList = ListUtils.cast(newCollectionCursor.toArray());\r
- newItems = ListUtils.map(newList, item -> item.getLong(IOctopusAPI.ID));\r
- }\r
- if (newItems == null)\r
- newItems = new ConcurrentHashMap<>();\r
-\r
- for (BasicDBObject oldItem : oldItems) {\r
- if (oldItem == null) {\r
- logger.error("Item is null");\r
- continue;\r
- }\r
- if (!oldItem.containsKey(idFieldName)) {\r
- logger.error("{} is null", idFieldName);\r
- continue;\r
- }\r
- long id = oldItem.getLong(idFieldName);\r
- BasicDBObject newItem = newItems.get(id);\r
- if (newItem == null) {\r
- //remove\r
- logger.info("Deleting {}", oldItem.toPrettyString(null));\r
- oldCollection.remove(new BasicDBObject(idFieldName, id));\r
- }\r
- }\r
- }\r
-\r
- private void deleteOrphanStories() {\r
- try {\r
- DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- BasicDBObject query = (BasicDBObject) QueryBuilder.start().put("id").notIn(storyIDs.toArray()).get();\r
- WriteResult res = collection.remove(query);\r
- logger.trace(String.format("Deleted orphan stories: %d", res.getN()));\r
- } catch (Exception e) {\r
- logger.error(e);\r
- }\r
- }\r
-\r
- private void ensureIndexes() {\r
- DBCollection collection = db.getCollection(FOLDER_COLLECTION);\r
- if (collection.count() == 0)\r
- collection.ensureIndex(IOctopusAPI.ID);\r
- collection = db.getCollection(RUNDOWN_COLLECTION);\r
- if (collection.count() == 0) {\r
- collection.ensureIndex(IOctopusAPI.ID);\r
- collection.ensureIndex(IOctopusAPI.SCHEDULED_START);\r
- }\r
- collection = db.getCollection(STORY_COLLECTION);\r
- if (collection.count() == 0)\r
- collection.ensureIndex(IOctopusAPI.ID);\r
- }\r
-\r
- public void execute() throws Exception {\r
- logger.trace(STARTING);\r
- //{"filter" :{ "archived" : true }}\r
- Response response = query(RUNDOWN, "id,name,modified,scheduledStart,channel,Channel.name,rundownType,RundownType.name")\r
- .post(Entity.entity(new BasicDBObject("filter", new BasicDBObject("archived", true)).toPrettyString(null), MediaType.APPLICATION_JSON));\r
- String json = response.readEntity(String.class);\r
-\r
- RUNDOWN_COLLECTION = IOctopusAPI.RUNDOWN_COLLECTION + _TMP;\r
- FOLDER_COLLECTION = IOctopusAPI.FOLDER_COLLECTION + _TMP;\r
- STORY_COLLECTION = IOctopusAPI.STORY_COLLECTION + _TMP;\r
-\r
- try {\r
- db.getCollection(RUNDOWN_COLLECTION).drop();\r
- db.getCollection(FOLDER_COLLECTION).drop();\r
- db.getCollection(STORY_COLLECTION).drop();\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
-\r
- BasicDBList rundowns = null;\r
- BasicDBList storyFolders = null;\r
-\r
- try {\r
- rundowns = queryBuildRefRundowns();\r
- storyFolders = queryBuildRefFolders();\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
-\r
- processRundowns(rundowns);\r
- processStoryFolders(storyFolders);\r
-\r
- //a sorrend fontos !\r
- updateDiff(IOctopusAPI.STORY_COLLECTION, STORY_COLLECTION, IOctopusAPI.ID);\r
- updateDiff(IOctopusAPI.RUNDOWN_COLLECTION, RUNDOWN_COLLECTION, IOctopusAPI.ID);\r
- updateDiff(IOctopusAPI.FOLDER_COLLECTION, FOLDER_COLLECTION, IOctopusAPI.ID);\r
- deleteDiff(IOctopusAPI.RUNDOWN_COLLECTION, RUNDOWN_COLLECTION, IOctopusAPI.ID);\r
- //deleteDiff(IOctopusAPI.FOLDER_COLLECTION, FOLDER_COLLECTION, IOctopusAPI.ID);\r
- deleteDiff(IOctopusAPI.STORY_COLLECTION, STORY_COLLECTION, IOctopusAPI.ID);\r
-\r
- //setLastUpdateTime(new Date());\r
- logger.info("Activate");\r
-\r
- // db.getCollection(RUNDOWN_COLLECTION).rename(IOctopusAPI.RUNDOWN_COLLECTION, true);\r
- // db.getCollection(FOLDER_COLLECTION).rename(IOctopusAPI.FOLDER_COLLECTION, true);\r
- // db.getCollection(STORY_COLLECTION).rename(IOctopusAPI.STORY_COLLECTION, true);\r
- logger.trace(FINISHED);\r
-\r
- }\r
-\r
- public void executetest() {\r
- // ResteasyWebTarget target = webTarget.path(RUNDOWN);\r
- // Builder result = target.request().header(OCTOPUS_DEVICE_ID, apiUser).header(OCTOPUS_DEVICE_NAME, apiPwd);\r
- // Response r = result.get();\r
- // String x = r.readEntity(String.class);\r
- // logger.info(x);\r
- // return;\r
- }\r
-\r
- private String extractContent(BasicDBObject content) {\r
- String scriptContent = "";\r
- if (!content.containsKey(IOctopusAPI.TYPE))\r
- return scriptContent;\r
- String type = content.getString(IOctopusAPI.TYPE);\r
- switch (type) {\r
- case IOctopusAPI.TEXT: {\r
- if (content.containsKey(IOctopusAPI.TEXT)) {\r
- String text = content.getString(IOctopusAPI.TEXT);\r
- if (text != null)\r
- scriptContent += String.format("%s%s", text.replaceAll(SIMPLE_LINEFEED, LINEFEED), LINEFEED);\r
- }\r
- break;\r
- }\r
- case IOctopusAPI.MOS: {\r
- BasicDBObject mosObject = NoSQLUtils.asDBObject(content, IOctopusAPI.OBJECT);\r
- if (mosObject != null && !mosObject.isEmpty()) {\r
- if (mosObject.containsKey(IOctopusAPI.OBJ_ID)) {\r
- String objID = mosObject.getString(IOctopusAPI.OBJ_ID);\r
- scriptContent += String.format("%s %s%s", MOSOBJECT, objID, LINEFEED);\r
- }\r
- }\r
- break;\r
- }\r
- default: {\r
- if (content.containsKey(IOctopusAPI.CONTENT)) {\r
- List<BasicDBObject> innerContents = NoSQLUtils.asList(content, IOctopusAPI.CONTENT);\r
- if (innerContents != null) {\r
- for (BasicDBObject actualInnerContent : innerContents) {\r
- if (actualInnerContent != null && actualInnerContent.isEmpty())\r
- scriptContent += extractContent(actualInnerContent);\r
- }\r
- }\r
- }\r
- break;\r
- }\r
- }\r
- return scriptContent;\r
- }\r
-\r
- private String extractCustomColumnValue(String columnName, BasicDBObject story) {\r
- List<BasicDBObject> customColumns = NoSQLUtils.asList(story, IOctopusAPI.CUSTOM_COLUMNS);\r
- if (customColumns == null)\r
- return null;\r
- String result = null;\r
- for (BasicDBObject customColumn : customColumns) {\r
- if (!customColumn.containsKey(IOctopusAPI.LABEL))\r
- continue;\r
- String currentName = customColumn.getString(IOctopusAPI.LABEL);\r
- if (currentName == null)\r
- continue;\r
- if (!currentName.toLowerCase().equals(columnName.toLowerCase()))\r
- continue;\r
- if (!customColumn.containsKey(IOctopusAPI.VALUE))\r
- continue;\r
- result = customColumn.getString(IOctopusAPI.VALUE);\r
- break;\r
- }\r
- return result;\r
- }\r
-\r
- private BasicDBList extractRelevantMOSObjects(BasicDBObject story) {\r
- List<BasicDBObject> mosObjects = NoSQLUtils.asList(story, IOctopusAPI.MOS_OBJECTS);\r
- if (mosObjects == null)\r
- return null;\r
- BasicDBList result = null;\r
- for (BasicDBObject mosObject : mosObjects) {\r
- if (!mosObject.containsKey(IOctopusAPI.MOS_ID))\r
- continue;\r
- String mosId = mosObject.getString(IOctopusAPI.MOS_ID);\r
- if (!IOctopusAPI.NEXIO_MOS.equals(mosId))\r
- continue;\r
- if (result == null)\r
- result = new BasicDBList();\r
- result.add(mosObject);\r
- }\r
- return result;\r
- }\r
-\r
- private String extractScriptContent(BasicDBObject story) {\r
- BasicDBObject script = NoSQLUtils.asDBObject(story, IOctopusAPI.SCRIPT);\r
- if (script == null || script.isEmpty())\r
- return null;\r
-\r
- List<BasicDBObject> body = NoSQLUtils.asList(script, IOctopusAPI.BODY);\r
- if (body == null || body.size() == 0)\r
- return null;\r
-\r
- StringBuilder sb = new StringBuilder();\r
-\r
- for (BasicDBObject bodyItem : body) {\r
- if (bodyItem.containsKey(IOctopusAPI.LABEL)) {\r
- sb.append(bodyItem.getString(IOctopusAPI.LABEL));\r
- sb.append(LINEFEED);\r
- }\r
- List<BasicDBObject> contents = NoSQLUtils.asList(bodyItem, IOctopusAPI.CONTENT);\r
- if (contents == null)\r
- continue;\r
- for (BasicDBObject content : contents) {\r
- sb.append(extractContent(content));\r
- }\r
- }\r
- return sb.length() == 0 ? null : sb.toString();\r
- }\r
-\r
- private void fireProgressEvent(ProgressEvent evt) {\r
- logger.debug("Progress changed to " + evt.getProgress() + "%");\r
- if (progressListenerList == null)\r
- return;\r
- Object[] listeners = progressListenerList.getListenerList();\r
- for (int i = 0; i < listeners.length; i += 2) {\r
- if (listeners[i] == IProgressEventListener.class)\r
- ((IProgressEventListener) listeners[i + 1]).progressChanged(evt);\r
- }\r
- }\r
-\r
- private Date getLastUpdateTime() {\r
- Date result = null;\r
- DBCollection collection = db.getCollection(IOctopusAPI.TIME_COLLECTION_NAME);\r
- DBObject timeObject = collection.findOne();\r
- if (timeObject != null)\r
- result = (Date) timeObject.get(IOctopusAPI.LASTUPDATE_TIME);\r
- return result;\r
- }\r
-\r
- // private boolean isModified(Date date, BasicDBObject object, String name) {\r
- // Date actualModifiedString = toDate(object, name);\r
- // if (actualModifiedString == null)\r
- // logger.trace(ACTUAL_MODIFIED_STRING_IS_NULL);\r
- // int result = date.compareTo(actualModifiedString);\r
- // return result <= 0;\r
- // }\r
-\r
- private boolean isModified(Date date, BasicDBObject object) {\r
- if (date == null)\r
- return true;\r
- Date modified = (Date) object.get(IOctopusAPI.MODIFIED);\r
- int result = date.compareTo(modified);\r
- return result <= 0;\r
- }\r
-\r
- private void processRundowns(BasicDBList rundowns) throws Exception {\r
- if (rundowns == null || rundowns.size() == 0) {\r
- progressEvent.setProgress(50);\r
- fireProgressEvent(progressEvent);\r
- } else {\r
- logger.info("Process rundowns");\r
- try {\r
- storeRundowns(rundowns, null);\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
- }\r
- }\r
-\r
- private void processStoryFolders(BasicDBList storyFolders) throws Exception {\r
- if (storyFolders == null || storyFolders.size() == 0) {\r
- progressEvent.setProgress(100);\r
- fireProgressEvent(progressEvent);\r
- } else {\r
- logger.info("Process story folders");\r
- try {\r
- storeStoryFolders(storyFolders, null);\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
- }\r
- }\r
-\r
- private Builder query(String path, String fields) {\r
- //logger.info("Class loader {}", getClass().getClassLoader());\r
- // try {\r
- // //TODO kell e?\r
- // ResteasyDeployment deployment = new ResteasyDeployment();\r
- // deployment.start();\r
- // } catch (Exception e) {\r
- // logger.catching(e);\r
- // }\r
- ResteasyWebTarget target = webTarget.path(path).queryParam(FIELDS, fields);\r
- Builder result = target.request().header(OCTOPUS_DEVICE_ID, apiUser).header(OCTOPUS_DEVICE_NAME, apiPwd);\r
- return result;\r
- }\r
-\r
- private BasicDBList queryBuildRefFolders() {\r
- BasicDBList storyFolders;\r
- logger.info("Fetch story folders");\r
- storyFolders = queryStoryFolders();\r
- logger.info("Fetch folder story references");\r
- storyStoryFolders = buildFolderReferences(storyFolders);\r
- return storyFolders;\r
- }\r
-\r
- private BasicDBList queryBuildRefRundowns() {\r
- BasicDBList rundowns;\r
- logger.info("Fetch rundowns");\r
- rundowns = queryRundowns();\r
- logger.info("Fetch rundown story references");\r
- storyRundowns = buildRundownReferences(rundowns);\r
- return rundowns;\r
- }\r
-\r
- private BasicDBObject queryRundown(BasicDBObject rundown) {\r
- logger.trace(ENTER);\r
- BasicDBObject result = null;\r
- long id = NoSQLUtils.asLong(rundown, IOctopusAPI.ID);\r
- Response response = query(String.format("%s/", RUNDOWN) + id, FIELDS_RUNDOWN_STORIES).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject == null)\r
- logger.error("Rundown {} {} is not available", id, rundown.getString(IOctopusAPI.NAME));\r
- else\r
- result = NoSQLUtils.asDBObject(resultObject, RESULT);\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- private BasicDBList queryRundowns() {\r
- logger.trace(ENTER);\r
- BasicDBList result = null;\r
- Response response = query(RUNDOWN, FIELDS_RUNDOWN_STORYIDS).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject != null)\r
- result = NoSQLUtils.asDBList(resultObject, RESULT);\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- private BasicDBObject queryStoryFolder(BasicDBObject storyFolder) {\r
- logger.trace(ENTER);\r
- BasicDBObject result = null;\r
- long id = NoSQLUtils.asLong(storyFolder, IOctopusAPI.ID);\r
- Response response = query(String.format("%s/", STORY_FOLDER) + id, FIELDS_STORYFOLDER_STORIES).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject == null)\r
- logger.error("StoryFolder {} {} is not available", id, storyFolder.getString(IOctopusAPI.NAME));\r
- else\r
- result = NoSQLUtils.asDBObject(resultObject, RESULT);\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- private BasicDBList queryStoryFolders() {\r
- logger.trace(ENTER);\r
- BasicDBList result = null;\r
- Response response = query(STORY_FOLDER, FIELDS_STORY_FOLDER_LIST).get();\r
- String json = response.readEntity(String.class);\r
- BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
- if (resultObject != null)\r
- result = NoSQLUtils.asDBList(resultObject, RESULT);\r
-\r
- /* teszt */\r
- List<BasicDBObject> list = NoSQLUtils.asList(result);\r
- for (BasicDBObject actual : list) {\r
- String fullName = concatParentsToStoryFolder(actual, actual.getString(IOctopusAPI.NAME));\r
- //logger.info("Checking StoryFolder {}", fullName);\r
- actual.remove(IOctopusAPI.NAME);\r
- actual.append(IOctopusAPI.NAME, fullName);\r
- }\r
-\r
- logger.trace(EXIT);\r
- return result;\r
- }\r
-\r
- public void removeProgressListener(IProgressEventListener listener) {\r
- progressListenerList.remove(IProgressEventListener.class, listener);\r
- }\r
-\r
- @Override\r
- public void run() {\r
- logger.trace(STARTING);\r
- try {\r
- ensureIndexes();\r
- Date lastUpdateTime = getLastUpdateTime();\r
-\r
- buildStoriesReferences();\r
-\r
- BasicDBList rundowns = queryRundowns();\r
- storyRundowns = buildRundownReferences(rundowns);\r
- BasicDBList storyFolders = queryStoryFolders();\r
- storyStoryFolders = buildFolderReferences(storyFolders);\r
-\r
- if (rundowns == null || rundowns.size() == 0) {\r
- progressEvent.setProgress(50);\r
- fireProgressEvent(progressEvent);\r
- } else {\r
- storeRundowns(rundowns, lastUpdateTime);\r
- }\r
-\r
- if (storyFolders == null || storyFolders.size() == 0) {\r
- progressEvent.setProgress(100);\r
- fireProgressEvent(progressEvent);\r
- } else {\r
- storeStoryFolders(storyFolders, lastUpdateTime);\r
- }\r
- deleteOrphanStories();\r
- setLastUpdateTime(new Date());\r
- } catch (Exception e) {\r
- logger.catching(e);\r
- throw e;\r
- }\r
- logger.trace(FINISHED);\r
- }\r
-\r
- public void run(boolean forceFull) {\r
- if (forceFull) {\r
- clear();\r
- }\r
- run();\r
- // if (forceFull) {\r
- // RUNDOWN_COLLECTION_NAME = "rundowns";\r
- // STORY_COLLECTION_NAME = "stories";\r
- // STORY_FOLDER_COLLECTION_NAME = "storyfolders";\r
- // TIME_COLLECTION_NAME = "octopusSyncTime";\r
- // db.getCollection("rundowns_tmp").rename(RUNDOWN_COLLECTION_NAME, true);\r
- // db.getCollection("stories_tmp").rename(STORY_COLLECTION_NAME, true);\r
- // db.getCollection("storyfolders_tmp").rename(STORY_FOLDER_COLLECTION_NAME, true);\r
- // db.getCollection("octopusSyncTime_tmp").rename(TIME_COLLECTION_NAME, true);\r
- // //clear();\r
- // }\r
-\r
- //TODO reset collection names\r
- }\r
-\r
- public void setLastUpdateTime(Date lastUpdateTime) {\r
- DBCollection collection = db.getCollection(OctopusAPI.TIME_COLLECTION_NAME);\r
- DBObject timeObject = collection.findOne();\r
- if (timeObject == null)\r
- timeObject = new BasicDBObject();\r
- timeObject.put(IOctopusAPI.LASTUPDATE_TIME, lastUpdateTime);\r
-\r
- collection.save(timeObject);\r
- }\r
-\r
- private void storeRundown(BasicDBObject rundown, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- String name = rundown.containsKey(IOctopusAPI.NAME) ? rundown.getString(IOctopusAPI.NAME) : null;\r
- logger.debug("Storing rundown {} {}", name, rundown.get(IOctopusAPI.SCHEDULED_START));\r
- BasicDBObject rundownWithStories = queryRundown(rundown);\r
- if (rundownWithStories != null) {\r
- BasicDBList stories = NoSQLUtils.asDBList(rundownWithStories, IOctopusAPI.SLUGS);\r
- if (stories != null)\r
- storeRundownStories(stories, lastUpdateTime);\r
- rundown.put(IOctopusAPI.SCHEDULED_START, toDate(rundown, IOctopusAPI.SCHEDULED_START));\r
- rundown.put(IOctopusAPI.MODIFIED, toDate(rundown, IOctopusAPI.MODIFIED));\r
- DBCollection collection = db.getCollection(RUNDOWN_COLLECTION);\r
- if (lastUpdateTime == null || (lastUpdateTime != null && isModified(lastUpdateTime, rundown))) {\r
- //logger.debug(SAVING_RUNDOWN, rundownID, name);\r
- collection.save(rundown);\r
- }\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeRundowns(BasicDBList rundowns, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> rundownsList = NoSQLUtils.asList(rundowns);\r
- int idx = 1;\r
- for (BasicDBObject rundown : rundownsList) {\r
- //logger.info(CHECKING_RUNDOWN, rundown.getLong(IOctopusAPI.ID), rundownsList.size(), idx);\r
- storeRundown(rundown, lastUpdateTime);\r
- int progress = idx * 50 / rundownsList.size();\r
- if (progress - progressEvent.getProgress() > 0) {\r
- progressEvent.setProgress(progress);\r
- fireProgressEvent(progressEvent);\r
- }\r
-\r
- idx++;\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeRundownStories(BasicDBList slugs, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> slugsList = NoSQLUtils.asList(slugs);\r
- for (BasicDBObject slug : slugsList) {\r
- if (slug.containsKey(IOctopusAPI.STORY))\r
- storeStory((BasicDBObject) slug.get(IOctopusAPI.STORY), lastUpdateTime);\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStory(BasicDBObject story, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- if (!story.containsKey(IOctopusAPI.ID)) {\r
- logger.error("Missing id in story {}", story.toPrettyString(null));\r
- return;\r
- }\r
- long storyID = story.getLong(IOctopusAPI.ID);\r
- boolean isContains = storyIDs.contains(storyID);\r
- if (isContains)\r
- return;\r
- storyIDs.add(storyID);\r
- story.put(IOctopusAPI.MODIFIED, toDate(story, IOctopusAPI.MODIFIED));\r
- BasicDBList rundownRef = storyRundowns.get(storyID);\r
- BasicDBList storyFolderRef = storyStoryFolders.get(storyID);\r
- BasicDBList modifiedMOS = extractRelevantMOSObjects(story);\r
-\r
- if (lastUpdateTime != null) {\r
- rundownRef = (rundownRef == null) ? new BasicDBList() : rundownRef;\r
- storyFolderRef = (storyFolderRef == null) ? new BasicDBList() : storyFolderRef;\r
- modifiedMOS = (modifiedMOS == null) ? new BasicDBList() : modifiedMOS;\r
-\r
- boolean uptodate = true;\r
- if (!isModified(lastUpdateTime, story)) {\r
- BasicDBList storedRundownRef = storedStoryRundowns.get(storyID);\r
- storedRundownRef = (storedRundownRef == null) ? new BasicDBList() : storedRundownRef;\r
- uptodate = storedRundownRef.equals(rundownRef);\r
-\r
- if (uptodate) {\r
- BasicDBList storedStoryFolderRef = storedStoryStoryFolders.get(storyID);\r
- storedStoryFolderRef = (storedStoryFolderRef == null) ? new BasicDBList() : storedStoryFolderRef;\r
- uptodate = storedStoryFolderRef.equals(storyFolderRef);\r
- }\r
-\r
- if (uptodate) {\r
- BasicDBList storedMOS = storedStoryMosObjects.get(storyID);\r
- storedMOS = (storedMOS == null) ? new BasicDBList() : storedMOS;\r
- uptodate = storedMOS.equals(modifiedMOS);\r
- }\r
-\r
- if (uptodate)\r
- return;\r
- }\r
- }\r
-\r
- DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- if (lastUpdateTime != null) {\r
- BasicDBObject orig = (BasicDBObject) collection.findOne(new BasicDBObject(IOctopusAPI.ID, storyID), new BasicDBObject(IOctopusAPI.ID, 1));\r
- if (orig != null)\r
- story.put("_id", orig.getID());\r
- }\r
- if (rundownRef != null)\r
- story.put(IOctopusAPI.REF_RUNDOWN, rundownRef);\r
- if (storyFolderRef != null)\r
- story.put(IOctopusAPI.REF_STORYFOLDER, storyFolderRef);\r
- String scriptContent = extractScriptContent(story);\r
- story.put(IOctopusAPI.SCRIPT_CONTENT, scriptContent);\r
- if (modifiedMOS == null || modifiedMOS.isEmpty()) {\r
- if (story.containsKey(IOctopusAPI.MOS_OBJECTS))\r
- story.remove(IOctopusAPI.MOS_OBJECTS);\r
- } else\r
- story.put(IOctopusAPI.MOS_OBJECTS, modifiedMOS);\r
-\r
- String parentStoryId = extractCustomColumnValue(IOctopusAPI.PARENT_STORY_ID, story);\r
- if (parentStoryId == null) {\r
- logger.warn("Missing {} in story", IOctopusAPI.PARENT_STORY_ID, story.toPrettyString(null));\r
- story.append(IOctopusAPI.PARENT_STORY_ID, storyID);\r
- } else\r
- story.append(IOctopusAPI.PARENT_STORY_ID, parentStoryId);\r
- logger.debug(SAVING_STORY_ID, storyID);\r
- collection.save(story);\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStoryFolder(BasicDBObject storyFolder, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- BasicDBObject storyFoldersWithStories = queryStoryFolder(storyFolder);\r
- if (storyFoldersWithStories != null) {\r
- BasicDBList stories = NoSQLUtils.asDBList(storyFoldersWithStories, IOctopusAPI.STORIES);\r
- if (stories != null)\r
- storeStoryFolderStories(stories, lastUpdateTime);\r
- storyFolder.put(IOctopusAPI.MODIFIED, toDate(storyFolder, IOctopusAPI.MODIFIED));\r
- DBCollection collection = db.getCollection(FOLDER_COLLECTION);\r
- if (lastUpdateTime == null || (lastUpdateTime != null && isModified(lastUpdateTime, storyFolder))) {\r
- String name = storyFolder.getString(IOctopusAPI.NAME);\r
- logger.debug("Storing story folder {}", name);\r
- collection.save(storyFolder);\r
- }\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStoryFolders(BasicDBList storyFolders, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> storyFolderList = NoSQLUtils.asList(storyFolders);\r
- int idx = 1;\r
- for (BasicDBObject storyFolder : storyFolderList) {\r
- logger.debug(String.format(CHECKING_STORY_FOLDER, storyFolder.getLong(IOctopusAPI.ID), storyFolderList.size(), idx));\r
- storeStoryFolder(storyFolder, lastUpdateTime);\r
- int progress = 50 + (idx * 50 / storyFolderList.size());\r
- if (progress - progressEvent.getProgress() > 0) {\r
- progressEvent.setProgress(progress);\r
- fireProgressEvent(progressEvent);\r
- }\r
- idx++;\r
- }\r
- logger.trace(EXIT);\r
- }\r
-\r
- private void storeStoryFolderStories(BasicDBList stories, Date lastUpdateTime) {\r
- logger.trace(ENTER);\r
- List<BasicDBObject> list = NoSQLUtils.asList(stories);\r
- for (BasicDBObject story : list)\r
- storeStory(story, lastUpdateTime);\r
- logger.trace(EXIT);\r
- }\r
-\r
- private Date toDate(BasicDBObject obj, String name) {\r
- Date result = null;\r
- if (obj.containsKey(name)) {\r
- String dt = obj.getString(name);\r
- if (dt != null) {\r
- // create jodatime from date\r
- DateTime jdt = new DateTime(dt);\r
- result = jdt.toDate();\r
- }\r
- }\r
- return result;\r
- }\r
-\r
- private void updateDiff(String oldCollectionName, String newCollectionName, String idFieldName) {\r
- DBCollection oldCollection = db.getCollection(oldCollectionName);\r
- DBCollection newCollection = db.getCollection(newCollectionName);\r
- DBCursor newCollectionCursor = newCollection.find();\r
- if (!newCollectionCursor.hasNext()) {\r
- logger.error("{} collection is empty", newCollectionName);\r
- return;\r
- }\r
-\r
- List<BasicDBObject> newItems = ListUtils.cast(newCollectionCursor.toArray());\r
-\r
- DBCursor oldCollectionCursor = oldCollection.find();\r
- ConcurrentHashMap<Long, BasicDBObject> oldItems = null;\r
- if (oldCollectionCursor.hasNext()) {\r
- List<BasicDBObject> oldList = ListUtils.cast(oldCollectionCursor.toArray());\r
- oldItems = ListUtils.map(oldList, item -> item.getLong(IOctopusAPI.ID));\r
- }\r
- if (oldItems == null)\r
- oldItems = new ConcurrentHashMap<>();\r
- for (BasicDBObject newItem : newItems) {\r
- if (newItem == null) {\r
- logger.error("Item is null");\r
- continue;\r
- }\r
- if (!newItem.containsKey(idFieldName)) {\r
- logger.error("{} is null", idFieldName);\r
- continue;\r
- }\r
- long id = newItem.getLong(idFieldName);\r
- BasicDBObject oldItem = oldItems.get(id);\r
- boolean save = false;\r
- if (oldItem == null) {\r
- //save\r
- save = true;\r
- } else {\r
- //compare\r
- Object oldDbId = oldItem.getID();\r
- newItem.remove(IOctopusAPI._ID);\r
- oldItem.remove(IOctopusAPI._ID);\r
-\r
- if (!newItem.equals(oldItem)) {\r
- //save\r
- newItem.put(IOctopusAPI._ID, oldDbId);\r
- save = true;\r
- }\r
- }\r
-\r
- if (save) {\r
- logger.info("Saving to {} item {}", oldCollectionName, id);\r
- oldCollection.save(newItem);\r
- }\r
- }\r
- }\r
-\r
-}\r
import user.commons.IRemoteFileListCallback;\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.configuration.SystemConfiguration;\r
import user.tsm.client.TSMBackupFileObject;\r
import user.tsm.client.TSMBufferedClient;\r
\r
public class TSMLister implements IDirectoryLister {\r
\r
- private static final String DELIMITER = System.getProperty("tsm.delimiter", "/");\r
- private static final String NODENAME = System.getProperty("tsm.nodename", "JOBENGINE");\r
- private static final String FSNAME = System.getProperty("tsm.fsname", "/JOBENGINE");\r
- private static final String ALTERNATE_FSNAME = System.getProperty("tsm.fsname.alternate");\r
- private static final String HLNAME = System.getProperty("tsm.hlname", "/JOBENGINE");\r
+ private static final String DELIMITER = SystemConfiguration.getInstance().value("tsm.delimiter");\r
+ private static final String NODENAME = SystemConfiguration.getInstance().value("tsm.node-name");\r
+ private static final String FSNAME = SystemConfiguration.getInstance().value("tsm.fs-name");\r
+ private static final String ALTERNATE_FSNAME = SystemConfiguration.getInstance().value("tsm.alternate-fs-name");\r
+ private static final String HLNAME = SystemConfiguration.getInstance().value("tsm.hl-name");\r
private static final Logger logger = LogManager.getLogger();\r
private TSMBufferedClient client;\r
private StoreUri storeUri;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
import user.commons.octopus.OctopusAPI;\r
-import user.commons.octopus.OctopusDataMiner1;\r
\r
public class OctopusDataMinerTest {\r
\r
\r
}\r
\r
- private OctopusDataMiner1 sut;\r
-\r
- @Test\r
- public void integrationExecute() throws Exception {\r
- // fixture\r
- sut = new OctopusDataMiner1();\r
- // Exercise\r
- sut.execute();\r
- }\r
-\r
- // @Test\r
- // public void integrationTestClear() {\r
- // // fixture\r
- // sut = new OctopusDataMiner1();\r
- // // Exercise\r
- // sut.clear();\r
- // }\r
-\r
- // @Test\r
- // public void integrationTestWithClear() {\r
- // // fixture\r
- // sut = new OctopusDataMiner1();\r
- // sut.clear();\r
- //\r
- // // Exercise\r
- // sut.run();\r
- // }\r
-\r
- @Test\r
- public void run() {\r
- sut = new OctopusDataMiner1();\r
- sut.run();\r
- }\r
-\r
@Test\r
public void test() throws SQLException {\r
IOctopusAPI api = new OctopusAPI();\r
<service>\r
<provide interface="user.jobengine.db.IItemManager"/>\r
</service>\r
- <!--\r
- <reference bind="bindSignalServerService" cardinality="1..1" interface="user.commons.server.tcp.SignalServer" name="SignalServer" policy="static" unbind="unbindSignalServerService"/>
- -->\r
+ <reference bind="bindSystemConfiguration" cardinality="1..1" interface="user.commons.configuration.IConfiguration" policy="static"/>\r
</scr:component>\r
+++ /dev/null
-package user.commons.pool;\r
-\r
-import java.sql.Connection;\r
-import java.sql.DriverManager;\r
-import java.sql.SQLException;\r
-\r
-/**\r
- * <b>Adatb�zis kapcsolat er�forr�s kezel�.</b>\r
- *\r
- */\r
-public class ConnectionPool extends ResourcePool {\r
- public ConnectionPool(ConnectionPoolProperties properties) {\r
- super(properties);\r
- }\r
-\r
- @Override\r
- public Connection borrowObject() {\r
- return (Connection) super.borrowObject();\r
- }\r
-\r
- @Override\r
- protected boolean checkObject(Object resourceObject) {\r
- Connection connection = (Connection) resourceObject;\r
- boolean closed = false;\r
- try {\r
- closed = connection.isClosed();\r
- } catch (SQLException e) {\r
- }\r
- return closed;\r
- }\r
-\r
- @Override\r
- protected Connection createObject() {\r
- ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties();\r
- Connection connection = null;\r
- try {\r
- Class.forName(cpp.getDriverName());\r
- DriverManager.setLoginTimeout(cpp.getTimeout());\r
- connection = DriverManager.getConnection(cpp.getUrl(), cpp.getUserName(), cpp.getPassword());\r
- connection.setAutoCommit(cpp.getAutoCommit());\r
- } catch (Exception e) {\r
- throw new PoolException(e.getMessage());\r
- }\r
- return connection;\r
- }\r
-\r
- public void lendObject(Connection connection) {\r
- super.lendObject(connection);\r
- }\r
-\r
- @Override\r
- protected void releaseObject(Object resourceObject) {\r
- validateObject(resourceObject);\r
- Connection connection = (Connection) resourceObject;\r
- try {\r
- if (connection == null)\r
- return;\r
- if (connection.isClosed() == false) {\r
- connection.close();\r
- }\r
- connection = null;\r
- } catch (Exception e) {\r
- throw new PoolException(e.getMessage());\r
- }\r
- }\r
-\r
- @Override\r
- protected boolean validateObject(Object resourceObject) {\r
- return (resourceObject instanceof Connection);\r
- // if (!(resourceObject instanceof Connection)) {\r
- // throw new IllegalArgumentException("Only Connection class is acceptable.");\r
- // }\r
- }\r
-}\r
+++ /dev/null
-package user.commons.pool;\r
-\r
-import user.commons.CommonsProperties;\r
-\r
-public class ConnectionPoolProperties extends CommonsProperties {\r
- static public final String AUTOCOMMIT = "AutoCommit"; \r
- static public final String DRIVERNAME = "DriverName"; \r
- static public final String PASSWORD = "password"; \r
- static public final String TIMEOUT = "Timeout"; \r
- static public final String URL = "ConnectionUrl"; \r
- static public final String USERNAME = "user"; \r
-\r
- static public final String TRACELEVEL = "traceLevel"; \r
- static public final String TRACEFILE = "traceFile"; \r
- static public final String TRACEFILEAPPEND = "traceFileAppend"; \r
-\r
- static public final String TRACELEVEL_FOR_TRACE_SQL_STATEMENT = Integer.toString(com.ibm.db2.jcc.DB2BaseDataSource.TRACE_CONNECTION_CALLS);\r
-\r
- public ConnectionPoolProperties(String driver, String url, String userName, String password, boolean autoCommit, int timeout) {\r
- this(driver, url, userName, password, autoCommit, timeout, Integer.toString(com.ibm.db2.jcc.DB2BaseDataSource.TRACE_NONE), "/tmp/jobengine_sqlj_trace.log", "true");\r
- }\r
- \r
- public ConnectionPoolProperties(String driver, String url, String userName, String password, boolean autoCommit, int timeout, String traceLevel, String traceFile, String traceFileAppend) {\r
- CommonsProperties.checkParameter(DRIVERNAME, driver);\r
- CommonsProperties.checkParameter(URL, url);\r
- CommonsProperties.checkParameter(USERNAME, userName);\r
- CommonsProperties.checkParameter(PASSWORD, password);\r
- CommonsProperties.checkParameter(AUTOCOMMIT, autoCommit);\r
- CommonsProperties.checkParameter(TIMEOUT, timeout);\r
- CommonsProperties.checkParameter(TRACELEVEL, traceLevel);\r
- CommonsProperties.checkParameter(TRACEFILE, traceFile);\r
- CommonsProperties.checkParameter(TRACEFILEAPPEND, traceFileAppend);\r
- super.add(DRIVERNAME, driver);\r
- super.add(URL, url);\r
- super.add(USERNAME, userName);\r
- super.add(PASSWORD, password);\r
- super.add(AUTOCOMMIT, autoCommit);\r
- super.add(TIMEOUT, timeout);\r
- super.add(TRACELEVEL, traceLevel);\r
- super.add(TRACEFILE, traceFile);\r
- super.add(TRACEFILEAPPEND, traceFileAppend);\r
- }\r
- \r
- public boolean getAutoCommit(){\r
- return getBool(AUTOCOMMIT);\r
- }\r
- \r
- public String getDriverName(){\r
- return getString(DRIVERNAME);\r
- }\r
- \r
- public String getPassword(){\r
- return getString(PASSWORD);\r
- }\r
- \r
- public int getTimeout() {\r
- return getInt(TIMEOUT);\r
- }\r
-\r
- public String getUrl(){\r
- return getString(URL);\r
- }\r
-\r
- public String getUserName(){\r
- return getString(USERNAME);\r
- }\r
- \r
- public String getTraceLevel(){\r
- return getString(TRACELEVEL);\r
- }\r
-\r
- public String getTraceFile(){\r
- return getString(TRACEFILE);\r
- }\r
-\r
- public String getTraceFileAppend(){\r
- return getString(TRACEFILEAPPEND);\r
- }\r
-}\r
return result;\r
}\r
\r
- public ContextPool(ConnectionPoolProperties properties) {\r
- super(properties);\r
+ public ContextPool() {\r
+ super(MediaCubeDataSourceFactory.getPoolSize());\r
}\r
\r
@Override\r
result = !context.getConnection().isClosed();\r
} catch (SQLException e) {\r
}\r
- //logger.info("Context check {}", result);\r
- // String sql = "SELECT 1 FROM SYSIBM.SYSDUMMY1";\r
- // Statement stmt = null;\r
- // ResultSet rs = null;\r
- // try {\r
- // stmt = context.getConnection().createStatement();\r
- // rs = stmt.executeQuery(sql);\r
- // while (rs.next())\r
- // rs.getInt(1);\r
- //\r
- // result = true;\r
- // } catch (Exception e1) {\r
- // logger.catching(e1);\r
- // if (rs != null)\r
- // try {\r
- // rs.close();\r
- // } catch (Exception e) {\r
- // logger.catching(e);\r
- // }\r
- // if (stmt != null)\r
- // try {\r
- // stmt.close();\r
- // } catch (Exception e) {\r
- // logger.catching(e);\r
- // }\r
- //\r
- // }\r
+\r
return result;\r
}\r
\r
return context;\r
}\r
\r
- // @Override\r
- // protected DefaultContext createObject() {\r
- // ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties();\r
- // Connection connection = null;\r
- // DefaultContext context = null;\r
- // try {\r
- // Class.forName(cpp.getDriverName());\r
- // } catch (ClassNotFoundException e) {\r
- // throw new PoolException(e.getMessage());\r
- // }\r
- //\r
- // try {\r
- // DriverManager.setLoginTimeout(cpp.getTimeout());\r
- // Properties p = new Properties();\r
- // p.setProperty(ConnectionPoolProperties.USERNAME, cpp.getUserName());\r
- // p.setProperty(ConnectionPoolProperties.PASSWORD, cpp.getPassword());\r
- // p.setProperty(ConnectionPoolProperties.TRACELEVEL, cpp.getTraceLevel());\r
- // p.setProperty(ConnectionPoolProperties.TRACEFILE, cpp.getTraceFile());\r
- // p.setProperty(ConnectionPoolProperties.TRACEFILEAPPEND, cpp.getTraceFileAppend());\r
- //\r
- // connection = DriverManager.getConnection(cpp.getUrl(), p);\r
- // connection.setAutoCommit(cpp.getAutoCommit());\r
- // context = new DefaultContext(connection);\r
- // } catch (Throwable t) {\r
- // logger.error("System can't create JDBC connection. Reason: " + t.getMessage());\r
- // Throwable cause = t.getCause();\r
- // if (cause instanceof InvocationTargetException) {\r
- // Throwable targetException = ((InvocationTargetException) cause).getTargetException();\r
- // logger.error(targetException.getMessage());\r
- // }\r
- // }\r
- // return context;\r
- // }\r
public void lendObject(DefaultContext context) {\r
super.lendObject(context);\r
}\r
\r
@Override\r
protected boolean validateObject(Object resourceObject) {\r
- //super.validateObject(resourceObject);\r
return (resourceObject instanceof DefaultContext);\r
- // if (!(resourceObject instanceof DefaultContext)) {\r
- // throw new IllegalArgumentException("Only DefaultContext class is acceptable.");\r
- // }\r
}\r
}\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
-import user.commons.CommonsProperties;\r
-\r
/**\r
* <b>Erőforrás kezelő.</b> <br>\r
* Az implementációban meghatározott típusú er�forr�s objektumb�l ig�ny szerint l�trehoz annyit, amennyi enged�lyezett. <br>\r
private static final Logger logger = LogManager.getLogger();\r
static public final String POOLSIZE = "PoolSize";\r
protected LinkedList<Object> pool = null;\r
- private CommonsProperties properties = null;\r
private int resourceCounter = 0;\r
\r
/**\r
* @param properties\r
* Be�ll�t�sok.\r
*/\r
- protected ResourcePool(CommonsProperties properties) {\r
- if (properties == null)\r
- throw new NullPointerException("Pool property map cannot be null.");\r
- this.properties = properties;\r
- resourceCounter = this.properties.getInt(POOLSIZE);\r
+ protected ResourcePool(int poolSize) {\r
+ resourceCounter = poolSize;\r
}\r
\r
/**\r
*/\r
abstract protected Object createObject();\r
\r
- /**\r
- * Param�terek lek�rdez�se.\r
- *\r
- * @return CommonsProperties t�pus� param�ter objektum.\r
- */\r
- protected CommonsProperties getProperties() {\r
- return properties;\r
- }\r
-\r
/**\r
* K�lcs�nvett er�forr�s objektum visszaszolg�ltat�sa. T�pus �s null pointer elle�rz�s a validateObject seg�ts�g�vel.\r
*\r
*/\r
void connect();\r
\r
- /**\r
- * A megfelelő bemeneti paramétrekekkel meghívja a connect() függvényt.\r
- *\r
- * @param dbUrl\r
- * Adatbázis elérési útvonala\r
- * @param dbUser\r
- * Adatbázis felhasználói név\r
- * @param dbPassword\r
- * Adatbázis jelszó\r
- */\r
- void connect(String dbUrl, String dbUser, String dbPassword);\r
-\r
FileType createFileType(String name, String description, String videoCodec, String audioCodec, int videoTracks, int audioTracks, float frameRate);\r
\r
Item createItem(String name, String description, String houseId);\r
import user.commons.Job;\r
import user.commons.ListUtils;\r
import user.commons.StoreUri;\r
-import user.commons.pool.ConnectionPoolProperties;\r
+import user.commons.configuration.IConfiguration;\r
import user.commons.pool.ContextPool;\r
-import user.commons.pool.ResourcePool;\r
import user.commons.remotestore.RemoteStore;\r
import user.commons.remotestore.RemoteStoreProtocol;\r
import user.commons.server.tcp.SignalServer;\r
* JobEngine adatbázis modell kezelő API.\r
*/\r
public class ItemManager extends MemoryCache implements IItemManager {\r
- private static final String JOBENGINE_MEDIAFINDER_EXTERNAL = "jobengine.mediafinder.external";\r
+\r
private static final Logger logger = LogManager.getLogger();\r
- public static String DBURL = "jobengine.db.url";\r
- public static String DBUSERNAME = "jobengine.db.user";\r
- public static String DBPASSWORD = "jobengine.db.password";\r
\r
static ItemManager currentInstance = null;\r
\r
return currentInstance;\r
}\r
\r
+ private IConfiguration systemConfig;\r
+\r
private Map<Class<? extends IEntityBase>, IEntityBaseDAO> baseDAOs = new Hashtable<Class<? extends IEntityBase>, IEntityBaseDAO>();\r
+\r
private IChangeHandler itemTypeChangeFactory;\r
- private int connectionPoolSize = 10;\r
\r
private ContextPool contextPool = null;\r
- String dbDriver = "com.ibm.db2.jcc.DB2Driver";\r
- String dbUrl = null;\r
-\r
- String dbUser = null;\r
- String dbPassword = null;\r
-\r
private SignalServer signalServer;\r
- private boolean useLucene;\r
- private IMediaFinder finder;\r
+\r
private Connection connection;\r
\r
public ItemManager() {\r
initializeItemManager(signalServer);\r
- // TODO mediafinder lokalis valtozo helyett private field.\r
- // System.getProperty("jobengine.mediafinder.external") == true\r
- // System.getProperty("jobengine.mediafinder.external.url")\r
-\r
- try {\r
- useLucene = Boolean.parseBoolean(System.getProperty(JOBENGINE_MEDIAFINDER_EXTERNAL));\r
- } catch (Exception e) {\r
- logger.info("Configuration property {} mising", JOBENGINE_MEDIAFINDER_EXTERNAL);\r
- }\r
-\r
- finder = createFinder();\r
}\r
\r
public void activate() {\r
}\r
}\r
\r
+ public synchronized void bindSystemConfiguration(Object service) {\r
+ if (service instanceof IConfiguration) {\r
+ systemConfig = (IConfiguration) service;\r
+ logger.info("IConfiguration service binded");\r
+ }\r
+ }\r
+\r
@Override\r
public void connect() {\r
traceIn();\r
- ConnectionPoolProperties properties = new ConnectionPoolProperties(dbDriver, dbUrl, dbUser, dbPassword, false, 2);\r
- properties.add(ResourcePool.POOLSIZE, connectionPoolSize);\r
- contextPool = new ContextPool(properties);\r
+ contextPool = new ContextPool();\r
\r
// try {\r
// getItemTypes();\r
traceOut();\r
}\r
\r
- @Override\r
- public void connect(String dbUrl, String dbUser, String dbPassword) {\r
- this.dbUrl = dbUrl;\r
- this.dbUser = dbUser;\r
- this.dbPassword = dbPassword;\r
- connect();\r
- }\r
-\r
@Override\r
public FileType createFileType(String name, String description, String videoCodec, String audioCodec, int videoTracks, int audioTracks, float frameRate) {\r
traceIn();\r
\r
private IMediaFinder createFinder() {\r
IMediaFinder finder = null;\r
- if (useLucene) {\r
+ boolean externalIndexer = systemConfig.value("datasource.mediacube.external-indexer", false);\r
+ if (externalIndexer) {\r
finder = new LuceneMediaFinder();\r
} else {\r
finder = new MediaFinder(this);\r
return storeUri;\r
}\r
\r
+ public IConfiguration getSystemConfig() {\r
+ return systemConfig;\r
+ }\r
+\r
@Override\r
public MediaFile getSystemMediaFile(Media media) {\r
MediaFile result = null;\r
private void initializeItemManager(SignalServer signalServer) {\r
this.signalServer = signalServer;\r
initialize();\r
- dbUrl = System.getProperty(DBURL);\r
- dbUser = System.getProperty(DBUSERNAME);\r
- dbPassword = System.getProperty(DBPASSWORD);\r
}\r
\r
@Override\r
@Override\r
public SearchResult<ArchivedMedia> search(SearchOptions options) {\r
traceIn();\r
+\r
+ IMediaFinder finder = createFinder();\r
+\r
SearchResult<ArchivedMedia> result = finder.search(options);\r
traceOut();\r
return result;\r
return result;\r
}\r
\r
+ public void setSystemConfig(IConfiguration systemConfig) {\r
+ this.systemConfig = systemConfig;\r
+ }\r
+\r
@Override\r
public void signal(long id, SignalType signalType, StaticTables staticTable) {\r
if (signalServer != null) {\r
private static final Logger logger = LogManager.getLogger();\r
private ItemManager manager = null;\r
private SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");\r
- private boolean simpleSearch = "true".equals(System.getProperty("mediacube.simplesearch", "false"));\r
\r
public MediaFinder(ItemManager manager) {\r
this.manager = manager;\r
sql.append(criteriaForTag.toString());\r
sql.append(" )");\r
}\r
-\r
+ boolean simpleSearch = manager.getSystemConfig().value("datasource.mediacube.simple-search", true);\r
if (simpleSearch) {\r
if (criteria.endsWith("*"))\r
criteria = criteria.replace("*", "");\r
+++ /dev/null
-package user.commons.pool;\r
-\r
-import org.junit.AfterClass;\r
-import org.junit.BeforeClass;\r
-import org.junit.Test;\r
-\r
-public class TestConnectionPool {\r
- private static ConnectionPool pool = null;\r
-\r
- @AfterClass\r
- public static void afterTest() {\r
- pool.close();\r
- }\r
-\r
- @BeforeClass\r
- public static void beforeTest() {\r
- ConnectionPoolProperties properties = new ConnectionPoolProperties("com.ibm.db2.jcc.DB2Driver",\r
- "-Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;", "db2admin", "password", false, 1000);\r
- properties.add(ResourcePool.POOLSIZE, 10);\r
- pool = new ConnectionPool(properties);\r
- }\r
-\r
- @Test\r
- public void testConcurrentBorrow() {\r
-\r
- for (int i = 0; i < 10; i++) {\r
- TestingThread thread = new TestingThread("Thread" + i, pool);\r
- thread.start();\r
- }\r
-\r
- try {\r
- Thread.sleep(10000);\r
- } catch (InterruptedException e) {\r
- }\r
- }\r
-\r
-}\r
+++ /dev/null
-package user.commons.pool;\r
-\r
-import java.sql.Connection;\r
-\r
-/**\r
- * Teszt thread, kölcsönöz majd egy idõ múlva visszaad egy Connection erõforrást. \r
- */\r
-public class TestingThread extends Thread {\r
- private ConnectionPool pool = null;\r
- private String name = null;\r
- \r
- TestingThread(String name, ConnectionPool pool) {\r
- this.pool = pool;\r
- this.name = name;\r
- }\r
- \r
- public void run() {\r
- try {\r
- Connection connection = pool.borrowObject();\r
- System.out.println(name + " borrowed a connection.");\r
- Thread.sleep(3000);\r
- pool.lendObject(connection);\r
- System.out.println(name + " lend a connection.");\r
- } catch (PoolException e) {\r
- System.out.println(e.getMessage());\r
- } catch (InterruptedException e1) {\r
- System.out.println(name + " finished.");\r
- }\r
- \r
- } \r
-}\r
import org.junit.AfterClass;\r
import org.junit.BeforeClass;\r
\r
-import user.commons.logging.LogUtils;\r
-\r
public class TestBase {\r
protected static IItemManager manager = null;\r
\r
// System.setProperty(ItemManager.DBPASSWORD, "password");\r
// System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
\r
- System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
- System.setProperty(ItemManager.DBPASSWORD, "password");\r
- System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
+ // System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
+ // System.setProperty(ItemManager.DBPASSWORD, "password");\r
// System.setProperty(ItemManager.DBURL,\r
// "jdbc:db2://localhost:50000/je:retrieveMessagesFromServerOnGetMessage=true;");\r
// System.setProperty(ItemManager.DBUSERNAME, "jobengine");\r
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="user.jobengine.server.ComponentBinder">\r
<implementation class="user.jobengine.osgi.server.ComponentBinder"/>\r
<reference cardinality="1..1" interface="user.commons.nexio.INexioAPI" name="INexioAPI" policy="static" bind="bindNexioService" unbind="unbindNexioService"/>\r
- <reference bind="bindMetadataProviderFactory" cardinality="0..1" interface="user.mediacube.metadata.interfaces.IMetadataProviderFactory" policy="static"/>\r
+ <reference bind="bindSystemConfiguration" cardinality="1..1" interface="user.commons.configuration.IConfiguration" policy="static"/>\r
</scr:component>\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
+import user.commons.configuration.IConfiguration;\r
import user.commons.nexio.INexioAPI;\r
import user.mediacube.metadata.interfaces.IMetadataProviderFactory;\r
\r
private static INexioAPI nexioAPI;\r
private static IMetadataProviderFactory metadataProviderFactory;\r
\r
+ private static IConfiguration systemConfig;\r
+\r
public static IMetadataProviderFactory getMetadataProviderFactory() {\r
return metadataProviderFactory;\r
}\r
return nexioAPI;\r
}\r
\r
+ public static IConfiguration getSystemConfig() {\r
+ return systemConfig;\r
+ }\r
+\r
public synchronized void bindMetadataProviderFactory(Object service) {\r
if (service instanceof IMetadataProviderFactory) {\r
metadataProviderFactory = (IMetadataProviderFactory) service;\r
}\r
}\r
\r
+ public synchronized void bindSystemConfiguration(Object service) {\r
+ if (service instanceof IConfiguration) {\r
+ systemConfig = (IConfiguration) service;\r
+ logger.info("IConfiguration service binded");\r
+ }\r
+ }\r
+\r
public synchronized void unbindMetadataProviderFactory(Object service) {\r
metadataProviderFactory = null;\r
logger.info("IMetadataProviderFactory service unbinded");\r
\r
public static URL[] makeURLs() {\r
List<URL> result = new ArrayList<>();\r
- addPath(result, JobEngine.STEPSROOT);\r
+ addPath(result, "");\r
return result.toArray(new URL[result.size()]);\r
}\r
\r
void addManagedJobChangedListener(IJobChangedListener listener);
- void addStepExecutor(IJobStepExecutor executor);
-
void addToExecutorQueue(IJobRuntime jobRuntime);
void addToRunQueue(IJobRuntime jobRuntime);
void bindItemManagerService(IItemManager service);
- boolean deleteProgram(String fileName);
-
void executeAssignVariableInstruction(IJobRuntime jobRuntime);
void executeCallConcurrentJobStepInstruction(IJobRuntime jobRuntime, IProgram subProgram);
void fireJobChangedEvent(JobChangedEvent event);
- Map<String, IJobStepExecutor> getExecutors();
-
Object[] getInputsFromStack(IJobRuntime jobRuntime);
IItemManager getItemManager();
IJobRuntime getJobById(long jobId);
+ JobEngineConfiguration getJobEngineConfiguration();
+
Map<Long, IJobRuntime> getJobs();
IProgram getProgram(String name);
- Map<String, IProgram> getPrograms();
-
JobEngineRemote getRemoteEngine();
ScheduledJob getScheduledJob(String template);
void keepAliveWorker(String remoteAddr);
- void loadExecutors();
-
- void loadProgram(String fileName) throws Exception;
-
- void loadPrograms();
-
void processCancelRequest(IJobMessage message);
void processJobStepCompletedMessage(IJobMessage message);
void submit(IJobRuntime... job);
void waitShutdown();
-
}
package user.jobengine.server;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Paths;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import user.commons.Job;
import user.commons.JobStatus;
-import user.commons.RemoteFile;
-import user.commons.StoreUri;
import user.commons.cluster.ClusteredJob;
import user.commons.nosql.NoSQLUtils;
-import user.commons.remotestore.DirectoryUtils;
-import user.commons.remotestore.RemoteStoreProtocol;
import user.jobengine.db.IItemManager;
import user.jobengine.db.ItemManagerData.SignalType;
+import user.jobengine.osgi.server.ComponentBinder;
import user.jobengine.server.actions.IStatusMachine;
import user.jobengine.server.actions.JobAction;
import user.jobengine.server.actions.StatusMachine;
-import user.jobengine.server.ast.Encoder;
import user.jobengine.server.ast.JobTemplate;
-import user.jobengine.server.ast.Parser;
import user.jobengine.server.instructions.CallJobStepInstruction;
import user.jobengine.server.instructions.IInstruction;
import user.jobengine.server.messagequeue.IUserMessage;
@Override
public void run() {
try {
- barrier.await();
+ startUpBarrier.await();
} catch (Exception e) {
}
@Override
public void run() {
try {
- barrier.await();
+ startUpBarrier.await();
} catch (Exception e) {
}
@Override
public void run() {
try {
- barrier.await();
+ startUpBarrier.await();
} catch (Exception e) {
}
}
private static final Logger logger = LogManager.getLogger();
- public static final String TEMPLATEROOT = "jobengine.jobtemplates.root";
- public static final String STEPSROOT = "jobengine.jobsteps.root";
- public static final String STEPSCONFIG = "jobengine.jobsteps.config";
- private static final String SCHEDULEDEXECUTION_DISABLED = "jobengine.scheduledexecution.disabled";
- private static final String EXECUTORCONFIGFILE = "config.xml";
-
static private IItemManager itemManager;
private static IJobEngine instance;
private final BlockingQueue<IJobRuntime> runQueue;
private final BlockingQueue<IJobMessage> messageQueue;
- private final List<JobTemplate> jobTemplates;
private final Map<Long, IJobRuntime> submittedJobs;
- private final Map<String, IProgram> programs;
- private final Map<String, IJobStepExecutor> executors;
private VM vm;
private MessageDispatcher dispatcher;
private JobChangedListenerChecker jobChangedListenerChecker;
private IUserMessageQueues userMessageQueues;
- private final CyclicBarrier barrier;
+ private final CyclicBarrier startUpBarrier;
private final IStatusMachine statusMachine;
private String masterServerAddress = System.getProperty("jobengine.master.server", "");
private final JobEngineRemote remoteEngine;
private ConcurrentHashMap<IJobChangedListener, Long> keepAliveJobChangedListeners = new ConcurrentHashMap<>();
+ private JobEngineConfiguration jobEngineConfiguration = new JobEngineConfiguration();
/**
* A MAM motor példányosítása. Ennek során létrejönnek a várakozási sorok, az ütemező szál, az üzenet kezelő szál.
*/
public JobEngine() {
- try {
- isScheduledExecutionDisabled = Boolean.parseBoolean(System.getProperty(SCHEDULEDEXECUTION_DISABLED, "false"));
- } finally {
- }
+ isScheduledExecutionDisabled = ComponentBinder.getSystemConfig().value("jobs.scheduled-execution-disabled", false);
runQueue = new PriorityBlockingQueue<IJobRuntime>();
messageQueue = new LinkedBlockingQueue<IJobMessage>();
- jobTemplates = Collections.synchronizedList(new ArrayList<JobTemplate>());
- executors = new LinkedHashMap<String, IJobStepExecutor>();
-
submittedJobs = createJobs();
- barrier = new CyclicBarrier(4);
+ startUpBarrier = new CyclicBarrier(4);
nextJobId = new AtomicLong(0);
- programs = new HashMap<String, IProgram>();
statusMachine = createStatusMachine();
if (instance != null)
throw new RuntimeException("Multiple JobEngine instances are not supported!");
}
}
- @Override
- public void addStepExecutor(IJobStepExecutor executor) {
- //Class<IJobStep> stepClass = executor.getStepClass();
- executor.setJobEngine(this);
- String unitName = executor.getStepUnitName();
- if (!executors.containsKey(unitName)) {
- logger.info("Executor now registered for {}", unitName);
- executors.put(unitName, executor);
- } else {
- logger.info("Executor already registered for {}", unitName);
- IJobStepExecutor stepExecutor = executors.get(unitName);
- int currentMaxConcurrent = stepExecutor.getMaxConcurrent();
- int newMaxConcurrent = executor.getMaxConcurrent();
- if (currentMaxConcurrent != newMaxConcurrent) {
- stepExecutor.setMaxConcurrent(newMaxConcurrent);
- logger.info("Executor maxConcurrent changed from {} to {}", currentMaxConcurrent, newMaxConcurrent);
- }
- }
-
- }
-
@Override
public void addToExecutorQueue(IJobRuntime jobRuntime) {
try {
if (typeName == null)
throw new Exception(jobRuntime.toString() + " illegal execution state detected: executor name is null.");
String executorName = String.valueOf(typeName);
- if (!executors.containsKey(executorName))
+ if (!jobEngineConfiguration.getExecutors().containsKey(executorName))
throw new Exception(jobRuntime.toString() + " executor is unavailable: " + executorName);
//a lista mindig letezik, de sima futtataskor csak 1 elemu, az aktualis van benne
//ha van parhuzamos futtatas, akkor letrejonnek benne a step szellemek is, es meghivodik a fork
List<IJobRuntime> jobs = spawnJobs(jobRuntime, executorName);
- executors.get(executorName).submit(jobs.toArray(new IJobRuntime[] {}));
+ jobEngineConfiguration.getExecutors().get(executorName).submit(jobs.toArray(new IJobRuntime[] {}));
jobs.forEach(r -> fireJobChangedEvent(new JobChangedEvent(r, SignalType.EXECUTE)));
} catch (Exception e) {
}
//JobStepExecutor reorder
- if (this.executors != null) {
- for (IJobStepExecutor exec : executors.values()) {
+ if (jobEngineConfiguration.getExecutors() != null) {
+ for (IJobStepExecutor exec : jobEngineConfiguration.getExecutors().values()) {
if (exec.containsRuntime(jobRuntime)) {
logger.info("executor");
exec.changePriority(jobRuntime);
public void deactivate() {
}
- @Override
- public boolean deleteProgram(String fileName) {
- boolean result = true;
- try {
- String filePath = DirectoryUtils.combine(System.getProperty(TEMPLATEROOT), fileName, true, true);
- File file = new File(filePath);
- if (!file.exists())
- throw new Exception("File not exists: " + filePath);
- if (!file.delete())
- throw new Exception("Can not delete file: " + filePath);
- if (programs.containsKey(fileName))
- programs.remove(fileName);
- logger.info("Template deleted: " + filePath);
- } catch (Exception e) {
- logger.error(e);
- result = false;
- }
- return result;
- }
-
@Override
public void executeAssignVariableInstruction(IJobRuntime jobRuntime) {
Object value = jobRuntime.popFromStack();
}
}
- @Override
- public Map<String, IJobStepExecutor> getExecutors() {
- return executors;
- }
-
@Override
public Object[] getInputsFromStack(IJobRuntime jobRuntime) {
jobRuntime.swapStack();
return submittedJobs.get(jobId);
}
+ @Override
+ public JobEngineConfiguration getJobEngineConfiguration() {
+ return jobEngineConfiguration;
+ }
+
@Override
public Map<Long, IJobRuntime> getJobs() {
return submittedJobs;
@Override
public IProgram getProgram(String name) {
- return programs.get(name);
- }
-
- @Override
- public Map<String, IProgram> getPrograms() {
- return programs;
+ return jobEngineConfiguration.getPrograms().get(name);
}
@Override
remoteWorkers.put(remoteAddr, LocalDate.now());
}
- @Override
- public void loadExecutors() {
- // TODO
- // shutdownExecutors();
- //executors.clear();
- InputStream stream = null;
- try {
- String stepRoot = DirectoryUtils.normalize(System.getProperty(STEPSROOT), File.separator);
- String stepsConfig = DirectoryUtils.normalize(System.getProperty(STEPSCONFIG), File.separator);
- if (stepsConfig == null || !Paths.get(stepsConfig).toFile().exists())
- stepsConfig = DirectoryUtils.combine(stepRoot, EXECUTORCONFIGFILE, true, true);
-
- logger.info("Loading executors based on configuration: " + stepsConfig);
- stream = new FileInputStream(stepsConfig);
- ExecutorConfigParser parser = new ExecutorConfigParser(stream);
-
- List<IJobStepExecutor> executorList = parser.parse();
- if (executorList != null) {
- for (IJobStepExecutor executor : executorList)
- addStepExecutor(executor);
- }
- } catch (Exception e) {
- logger.error("Error loading executors: " + e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e) {
- }
- }
- }
-
- @Override
- public void loadProgram(String fileName) throws Exception {
- InputStream stream = null;
- try {
- String filePath = DirectoryUtils.combine(System.getProperty(TEMPLATEROOT), fileName, true, true);
- File file = new File(filePath);
- if (!file.exists())
- throw new Exception("File not exists: " + filePath);
- logger.info("Loading template: " + filePath);
- stream = new FileInputStream(filePath);
-
- Parser parser = new Parser(stream);
- JobTemplate template = parser.parse();
- template.validate();
- template.setFileName(fileName);
-
- Encoder encoder = new Encoder();
- IProgram program = (IProgram) encoder.visitJobTemplate(template, null);
-
- if (programs.containsKey(fileName))
- programs.remove(fileName);
-
- programs.put(fileName, program);
- logger.info("Job template loaded: " + fileName);
- } catch (Exception e) {
- logger.error(fileName + " compile error: " + e.getMessage());
- throw new Exception(e);
- } finally {
- if (stream != null)
- stream.close();
- }
- }
-
- @Override
- public void loadPrograms() {
- programs.clear();
- StringBuilder sb = new StringBuilder();
- try {
- StoreUri store = new StoreUri();
- store.setProtocol(RemoteStoreProtocol.LOCAL);
- store.setUri(DirectoryUtils.normalize(System.getProperty(TEMPLATEROOT), File.separator));
- store.setFileFilter("*.xml");
-
- // String userDirectory = System.getProperty("user.dir");
- //
- // Path path = Paths.get(userDirectory + "\\" + System.getProperty(TEMPLATEROOT, ""));
- // boolean exists = path.toFile().exists();
- String templateRoot = store.toString(true);
- logger.info("Template root is: " + templateRoot);
- // File f = new File(templateRoot);
- // System.out.println(f.getAbsolutePath());
- List<RemoteFile> files = store.getRemoteFiles();
-
- for (RemoteFile file : files) {
- String name = file.getName();
- InputStream stream = null;
- try {
- String filePath = templateRoot + name;
- logger.info("Loading template {}", name);
- // System.out.println(name);
- stream = new FileInputStream(filePath);
- Parser parser = new Parser(stream);
- Encoder encoder = new Encoder();
- JobTemplate jobTemplate = parser.parse();
- jobTemplate.validate();
- jobTemplate.setFileName(name);
- IProgram program = (IProgram) encoder.visitJobTemplate(jobTemplate, null);
- programs.put(name, program);
- jobTemplates.add(jobTemplate);
- sb.append(name + " ");
- } catch (Exception e) {
- logger.error("Compile error in {}", name);
- } finally {
- if (stream != null)
- stream.close();
- }
- }
- } catch (Exception e) {
- logger.error("Error loading templates: " + e.getMessage());
- }
- if (sb.length() > 0)
- logger.info("Loaded templates: " + sb.toString());
- }
-
@Override
public void processCancelRequest(IJobMessage message) {
IJobRuntime jobRuntime = getJobById(message.getJobId());
if (schedulerService != null)
schedulerService.shutdown();
- loadPrograms();
- loadExecutors();
-
- //startupExecutors();
+ jobEngineConfiguration.loadTemplates();
+ jobEngineConfiguration.loadExecutors(this);
schedulerService = new SchedulerService(this);
schedulerService.startup();
@Override
public void removeFromExecutorQueue(IJobRuntime jobRuntime) {
- for (IJobStepExecutor executor : executors.values())
+ for (IJobStepExecutor executor : jobEngineConfiguration.getExecutors().values())
executor.revoke(jobRuntime);
}
@Override
public ClusteredJob requestJob(String className) throws Exception {
- if (!executors.containsKey(className))
+ IJobStepExecutor executor = jobEngineConfiguration.getExecutors().get(className);
+ if (executor == null)
throw new Exception("Unregistered executor request: " + className);
-
- IJobStepExecutor executor = executors.get(className);
if (!executor.isRemoteEnabled())
throw new Exception("Job is not registered for remote workers: " + className);
vm.shutDown();
shutdownExecutors();
+ startUpBarrier.reset();
logger.info("JobEngine gracefully stopped");
- loadPrograms();
- loadExecutors();
+ jobEngineConfiguration.loadTemplates();
+ jobEngineConfiguration.loadExecutors(this);
vm.start();
startupExecutors();
+ startUpBarrier.await();
schedulerService = new SchedulerService(this);
schedulerService.startup();
}
private void shutdownExecutors() {
- if (executors == null)
- return;
- for (IJobStepExecutor executor : executors.values()) {
+ Collection<IJobStepExecutor> executors = jobEngineConfiguration.getExecutors().values();
+ for (IJobStepExecutor executor : executors) {
logger.trace("Notify executor {}", executor.getStepUnitName());
executor.shutdown();
}
- for (IJobStepExecutor executor : executors.values()) {
+ for (IJobStepExecutor executor : executors) {
logger.info("Stopping executor {}", executor.getStepUnitName());
executor.waitShutdown();
}
try {
removeGarbage();
- loadPrograms();
- loadExecutors();
+ jobEngineConfiguration.loadTemplates();
+ jobEngineConfiguration.loadExecutors(this);
vm = new VM();
dispatcher = new MessageDispatcher();
jobChangedListenerChecker.start();
startupExecutors();
- barrier.await();
+ startUpBarrier.await();
schedulerService = new SchedulerService(this);
schedulerService.startup();
}
private void startupExecutors() {
- for (IJobStepExecutor executor : executors.values())
+ for (IJobStepExecutor executor : jobEngineConfiguration.getExecutors().values())
executor.startup();
}
--- /dev/null
+package user.jobengine.server;\r
+\r
+import java.io.FileNotFoundException;\r
+import java.io.IOException;\r
+import java.io.InputStream;\r
+import java.net.URL;\r
+import java.net.URLClassLoader;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.LinkedHashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.function.Consumer;\r
+import java.util.function.Predicate;\r
+import java.util.stream.Stream;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import groovy.lang.GroovyClassLoader;\r
+import user.commons.configuration.IConfiguration;\r
+import user.jobengine.osgi.server.ComponentBinder;\r
+import user.jobengine.server.ast.Encoder;\r
+import user.jobengine.server.ast.JobTemplate;\r
+import user.jobengine.server.ast.Parser;\r
+import user.jobengine.server.steps.IJobStep;\r
+\r
+public class JobEngineConfiguration {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ public static final String CONF_MEDIACUBE = "configuration/mediacube.json";\r
+ public static final String CONF_MAESTRO = "configuration/maestro.json";\r
+ public static final String CONF_EXECUTORS = "jobs/executors.xml";\r
+ public static final String CONF_SCHEDULES = "jobs/schedules.json";\r
+ public static final String DIR_STEPS = "jobs/steps";\r
+ public static final String DIR_CLASSES = "jobs/classes";\r
+ public static final String DIR_TEMPLATES = "jobs/templates";\r
+\r
+ private final Map<String, IJobStepExecutor> executors = new LinkedHashMap<String, IJobStepExecutor>();\r
+ private final Map<String, IProgram> programs = new LinkedHashMap<String, IProgram>();\r
+ private final List<JobTemplate> templates = Collections.synchronizedList(new ArrayList<JobTemplate>());\r
+ private URLClassLoader stepsClassLoader = null;\r
+\r
+ @SuppressWarnings("unchecked")\r
+ public IJobStep createJobStep(String stepUnitName) throws Exception {\r
+ IJobStep result = null;\r
+\r
+ boolean isGroovyClass = stepUnitName.toLowerCase().endsWith(".java") || stepUnitName.toLowerCase().endsWith(".groovy");\r
+\r
+ if (stepsClassLoader == null) {\r
+ String stepClassesDir = ComponentBinder.getSystemConfig().getConfig(DIR_CLASSES);\r
+ Path path = Paths.get(stepClassesDir);\r
+ URL[] urls = { path.toUri().toURL() };\r
+ stepsClassLoader = URLClassLoader.newInstance(urls, getClass().getClassLoader());\r
+ }\r
+\r
+ Class<IJobStep> stepClass = null;\r
+\r
+ if (isGroovyClass) {\r
+ try (GroovyClassLoader gcl = new GroovyClassLoader(stepsClassLoader)) {\r
+ String stepsDir = ComponentBinder.getSystemConfig().getConfig(DIR_STEPS);\r
+ stepClass = (Class<IJobStep>) parseClassHierarchy(gcl, stepsDir, stepUnitName);\r
+ } catch (Exception e) {\r
+ throw e;\r
+ }\r
+\r
+ } else\r
+ stepClass = (Class<IJobStep>) stepsClassLoader.loadClass(stepUnitName);\r
+\r
+ result = stepClass.newInstance();\r
+\r
+ return result;\r
+ }\r
+\r
+ public Map<String, IJobStepExecutor> getExecutors() {\r
+ return executors;\r
+ }\r
+\r
+ public Map<String, IProgram> getPrograms() {\r
+ return programs;\r
+ }\r
+\r
+ public List<JobTemplate> getTemplates() {\r
+ return templates;\r
+ }\r
+\r
+ public void loadExecutors(IJobEngine jobEngine) {\r
+ InputStream stream = null;\r
+ try {\r
+ IConfiguration systemConfig = ComponentBinder.getSystemConfig();\r
+ String configFilePath = systemConfig.getConfig(CONF_EXECUTORS);\r
+ logger.info("Loading executors configuration {}", configFilePath);\r
+ stream = Files.newInputStream(Paths.get(configFilePath));\r
+ ExecutorConfigParser parser = new ExecutorConfigParser(stream);\r
+\r
+ List<IJobStepExecutor> executorList = parser.parse();\r
+ if (executorList != null) {\r
+ for (IJobStepExecutor executor : executorList) {\r
+ String unitName = executor.getStepUnitName();\r
+ executor.setJobEngine(jobEngine);\r
+ if (!executors.containsKey(unitName)) {\r
+ logger.info("Executor now registered for {}", unitName);\r
+ executors.put(unitName, executor);\r
+ } else {\r
+ logger.info("Executor already registered for {}", unitName);\r
+ IJobStepExecutor stepExecutor = executors.get(unitName);\r
+ int currentMaxConcurrent = stepExecutor.getMaxConcurrent();\r
+ int newMaxConcurrent = executor.getMaxConcurrent();\r
+ if (currentMaxConcurrent != newMaxConcurrent) {\r
+ stepExecutor.setMaxConcurrent(newMaxConcurrent);\r
+ logger.info("Executor maxConcurrent changed from {} to {}", currentMaxConcurrent, newMaxConcurrent);\r
+ }\r
+ }\r
+\r
+ logger.info("Executor now registered for {}", unitName);\r
+ }\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error("Error loading executors: " + e);\r
+ } finally {\r
+ try {\r
+ if (stream != null)\r
+ stream.close();\r
+ } catch (IOException e) {\r
+ }\r
+ }\r
+ }\r
+\r
+ private void loadTemplate(Path config) {\r
+ InputStream stream = null;\r
+ try {\r
+ stream = Files.newInputStream(config);\r
+ String fileName = config.getFileName().toString();\r
+ Parser parser = new Parser(stream);\r
+ JobTemplate template = parser.parse();\r
+ template.validate();\r
+ template.setFileName(fileName);\r
+\r
+ Encoder encoder = new Encoder();\r
+ IProgram program = (IProgram) encoder.visitJobTemplate(template, null);\r
+ getPrograms().put(fileName, program);\r
+\r
+ getTemplates().add(template);\r
+ logger.info("Job template loaded {}", fileName);\r
+ } catch (Exception e) {\r
+ logger.error("{} compile error: {}", config, e.getMessage());\r
+ } finally {\r
+ try {\r
+ if (stream != null)\r
+ stream.close();\r
+ } catch (IOException e) {\r
+ }\r
+ }\r
+ }\r
+\r
+ public void loadTemplates() {\r
+ programs.clear();\r
+ try {\r
+ IConfiguration systemConfig = ComponentBinder.getSystemConfig();\r
+ Path templatesPath = Paths.get(systemConfig.getConfig(DIR_TEMPLATES));\r
+ if (!templatesPath.toFile().isDirectory())\r
+ throw new FileNotFoundException(templatesPath + " is not directory!");\r
+ logger.info("Loading templates from {}", templatesPath);\r
+ Predicate<Path> filter = file -> !Files.isDirectory(file) && file.getFileName().toString().endsWith(".xml");\r
+ Consumer<Path> consumer = file -> loadTemplate(file);\r
+ try (Stream<Path> stream = Files.list(templatesPath)) {\r
+ stream.filter(filter).forEach(consumer);\r
+ }\r
+\r
+ } catch (Exception e) {\r
+ logger.error(e);\r
+ }\r
+ }\r
+\r
+ private Class<?> parseClassHierarchy(GroovyClassLoader cl, String root, String className) throws IOException {\r
+ Path path = Paths.get(root, className);\r
+\r
+ //logger.info("Loading class {} from {}", className, path.toString());\r
+ Class<?> result = null;\r
+ if (!path.toFile().exists())\r
+ return result;\r
+ List<String> lines = Files.readAllLines(path);\r
+\r
+ for (String line : lines) {\r
+ if (line.contains("extends")) {\r
+\r
+ String[] tokens = line.split("extends");\r
+ String parent = tokens[tokens.length - 1];\r
+ parent = parent.replace("{", "").trim();\r
+ //logger.info("Class {} needs parent class {}", className, parent);\r
+\r
+ parseClassHierarchy(cl, root, parent + ".java");\r
+ break;\r
+ }\r
+ }\r
+ result = cl.parseClass(path.toFile());\r
+ return result;\r
+ }\r
+\r
+}\r
package user.jobengine.server;
-import java.io.IOException;
-import java.net.URLClassLoader;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import groovy.lang.GroovyClassLoader;
import user.commons.JobStatus;
import user.commons.cluster.ClusteredJob;
import user.jobengine.server.messages.JobStepCompletedMessage;
jobEngine.storeJob(jobRuntime);
Object[] inputs = job.getInputs();
- runStepObject(jobRuntime, inputs);
+ runStep(jobRuntime, inputs);
}
}
logger.info("Executing locally {}", jobRuntime.getId());
//jobRuntime.setDescription(PROCESSING_LOCALLY);
Object[] inputs = jobEngine.getInputsFromStack(jobRuntime);
- IJobStep stepObject = runStepObject(jobRuntime, inputs);
+ IJobStep stepObject = runStep(jobRuntime, inputs);
if (stepObject.isTest()) {
logger.trace("Finishing test worker");
break;
}
}
- private IJobStep runStepObject(IJobRuntime jobRuntime, Object[] inputs) throws Throwable {
+ private IJobStep runStep(IJobRuntime jobRuntime, Object[] inputs) throws Throwable {
IJobStep step = null;
jobRuntime.setStatus(JobStatus.EXECUTING);
jobRuntime.NotifyUpdate();
- step = createStepObject();
- if (step == null)
- throw new Exception("Step object is null");
- logger.debug("{} executing", jobRuntime);
+ step = createStep();
+
jobRuntime.incrementPriority();
Object[] outputs = step.run(jobEngine, jobRuntime, inputs);
private int maxConcurrent;
private String stepUnitName;
private boolean isRemote;
- private URLClassLoader parentLoader;
public JobStepExecutor() {
}
logger.debug("Creating executor {}, instances {}", stepUnitName, maxConcurrent);
if (StringUtils.isEmpty(stepUnitName))
throw new JobEngineException("Step unit name can't be null.");
-
- parentLoader = URLClassLoader.newInstance(DynamicClassLocator.makeURLs(), getClass().getClassLoader());
- if (!isGroovyStep()) {
- //a groovy-nak nem kell
- try {
- stepClass = (Class<IJobStep>) parentLoader.loadClass(stepUnitName);
- } catch (ClassNotFoundException e1) {
- logger.catching(e1);
- throw new JobEngineException("System can't load JobStep implementation: " + stepUnitName);
- }
- }
-
queue = new PriorityBlockingQueue<IJobRuntime>();
this.maxConcurrent = maxConcurrent;
}
- protected IJobStep createStepObject() throws Exception {
- IJobStep result = null;
-
- if (isGroovyStep()) {
- try (GroovyClassLoader gcl = new GroovyClassLoader(parentLoader)) {
- String stepsDir = System.getProperty("jobengine.jobsteps.groovy.root", "");
-
- Class<?> myClass = parseClassHierarchy(gcl, stepsDir, stepUnitName);
- result = (IJobStep) myClass.newInstance();
-
- // for (String executorName : jobEngine.getExecutors().keySet()) {
- // if (!executorName.endsWith(".java"))
- // continue;
- //
- // Class<?> myClass = gcl.parseClass(Paths.get(stepsDir, executorName).toFile());
- // if (stepUnitName.equals(executorName)) {
- // result = (IJobStep) myClass.newInstance();
- // break;
- // }
- // }
- } catch (Exception e) {
- logger.error(e.getMessage());
- throw e;
- }
-
- } else
- result = stepClass.newInstance();
- return result;
+ protected IJobStep createStep() throws Exception {
+ return jobEngine.getJobEngineConfiguration().createJobStep(stepUnitName);
}
@Override
return stepUnitName;
}
- private boolean isGroovyStep() {
- return stepUnitName.toLowerCase().endsWith(".java") || stepUnitName.toLowerCase().endsWith(".groovy");
- }
-
@Override
public boolean isRemoteEnabled() {
return isRemote;
}
- private Class<?> parseClassHierarchy(GroovyClassLoader cl, String root, String className) throws IOException {
- Path path = Paths.get(root, className);
-
- //logger.info("Loading class {} from {}", className, path.toString());
- Class<?> result = null;
- if (!path.toFile().exists())
- return result;
- List<String> lines = Files.readAllLines(path);
-
- for (String line : lines) {
- if (line.contains("extends")) {
-
- String[] tokens = line.split("extends");
- String parent = tokens[tokens.length - 1];
- parent = parent.replace("{", "").trim();
- //logger.info("Class {} needs parent class {}", className, parent);
-
- parseClassHierarchy(cl, root, parent + ".java");
- break;
- }
- }
- result = cl.parseClass(path.toFile());
- return result;
- }
-
protected synchronized boolean retireUnusedWorker(Worker worker) {
boolean result = false;
if (getMaxConcurrent() < workers.size()) {
public void waitShutdown() {
workers.forEach(worker -> worker.waitShutdown());
}
+
}
package user.jobengine.server.scheduler;\r
\r
-import java.io.File;\r
import java.nio.file.Files;\r
import java.nio.file.Paths;\r
import java.util.ArrayList;\r
import com.ibm.nosql.json.api.BasicDBList;\r
import com.ibm.nosql.json.api.BasicDBObject;\r
\r
+import user.commons.configuration.IConfiguration;\r
import user.commons.nosql.NoSQLUtils;\r
+import user.jobengine.osgi.server.ComponentBinder;\r
import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.JobEngineConfiguration;\r
\r
/**\r
* Jobok schedulalt inditasa.\r
* @throws Exception\r
*/\r
private void loadStartupJobsFromConfig() throws Exception {\r
- String configPath = System.getProperty("jobengine.jobscheduling.config");\r
- if (configPath == null || "".equals(configPath)) {\r
- logger.error("Missing system property: 'jobengine.jobscheduling.config'");\r
- return;\r
- }\r
- logger.info("Loading scheduler configuration file: {}", configPath);\r
- File schedulingConfigFile = new File(configPath);\r
- if (schedulingConfigFile.exists()) {\r
- String jsonConfig = new String(Files.readAllBytes(Paths.get(schedulingConfigFile.getAbsolutePath())));\r
- BasicDBObject dbo = (BasicDBObject) JSONUtil.jsonToDbObject(jsonConfig);\r
- scheduleJobs = (BasicDBList) dbo.get("joblist");\r
- for (int c = 0; c < scheduleJobs.size(); c++) {\r
- BasicDBObject sjob = (BasicDBObject) scheduleJobs.get(c);\r
- ScheduledJob sj = null;\r
- try {\r
- sj = createScheduledJob(sjob);\r
- } catch (Exception e) {\r
- logger.error("Error creating job: {}", sjob);\r
- }\r
- //skip inactive jobs\r
- if (!sj.isActive())\r
- continue;\r
- schedule(sj);\r
+ IConfiguration systemConfig = ComponentBinder.getSystemConfig();\r
+ String configFilePath = systemConfig.getConfig(JobEngineConfiguration.CONF_SCHEDULES);\r
+ logger.info("Loading scheduler configuration file {}", configFilePath);\r
+ String jsonConfig = new String(Files.readAllBytes(Paths.get(configFilePath)));\r
+ BasicDBObject dbo = (BasicDBObject) JSONUtil.jsonToDbObject(jsonConfig);\r
+ scheduleJobs = (BasicDBList) dbo.get("joblist");\r
+ for (int c = 0; c < scheduleJobs.size(); c++) {\r
+ BasicDBObject sjob = (BasicDBObject) scheduleJobs.get(c);\r
+ ScheduledJob sj = null;\r
+ try {\r
+ sj = createScheduledJob(sjob);\r
+ } catch (Exception e) {\r
+ logger.error("Error creating job: {}", sjob);\r
}\r
- } else {\r
- logger.error("Missing '{}' configuration file: {}", configPath, schedulingConfigFile.getAbsolutePath());\r
+ //skip inactive jobs\r
+ if (!sj.isActive())\r
+ continue;\r
+ schedule(sj);\r
}\r
}\r
\r
*/\r
public class JobStep implements IJobStep {\r
private static final Logger logger = LogManager.getLogger();\r
+\r
private IJobRuntime jobRuntime = null;\r
+\r
private IJobEngine jobEngine;\r
\r
private Object[] addParameter(Method stepEntry, Object[] inputs, Class<?> type, Object parameter) {\r
final ThreadSynchronizer sync = new ThreadSynchronizer();
IJobEngine jobEngine = new JobEngine();
jobEngine.setItemManager(manager);
- jobEngine.loadPrograms();
- jobEngine.loadExecutors();
jobEngine.startup();
Map<String, Object> parameters = new HashMap<>();
parameters.put("mediaFolder", "/tmp");
import user.commons.IEntityBase;\r
import user.commons.ListUtils;\r
import user.commons.StoreUri;\r
-import user.commons.logging.LogUtils;\r
import user.commons.mediatool.MediaInfo;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
\r
@BeforeClass\r
static public void setUpConnection() {\r
- // System.setProperty("jobengine.octopus.rundowns.name", "test_rundowns");\r
- // System.setProperty("jobengine.octopus.stories.name", "test_stories");\r
- // System.setProperty("jobengine.octopus.storyfolders.name", "test_storyfolders");\r
- System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
- System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
- System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
-\r
- System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.29:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty("jobengine.nosql.db.user", "db2admin");\r
- System.setProperty("jobengine.nosql.db.password", "password");\r
- System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.29:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
- System.setProperty(ItemManager.DBPASSWORD, "password");\r
- System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
- // System.setProperty(ItemManager.DBURL,\r
+ // // System.setProperty("jobengine.octopus.rundowns.name", "test_rundowns");\r
+ // // System.setProperty("jobengine.octopus.stories.name", "test_stories");\r
+ // // System.setProperty("jobengine.octopus.storyfolders.name", "test_storyfolders");\r
+ // System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
+ // System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
+ // System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
+ //\r
+ // System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.29:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty("jobengine.nosql.db.user", "db2admin");\r
+ // System.setProperty("jobengine.nosql.db.password", "password");\r
+ // System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.29:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
+ // System.setProperty(ItemManager.DBPASSWORD, "password");\r
\r
manager = new ItemManager();\r
manager.connect();\r
public List<DBObject> getRundownsByPlaceHolderID(String id) {\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection collection = db.getCollection(IOctopusAPI.STORY_COLLECTION);\r
- BasicDBObject criteria = new BasicDBObject(IOctopusAPI.MOS_OBJECTS,\r
- new BasicDBObject(IOctopusAPI.$ELEMMATCH, new BasicDBObject(IOctopusAPI.OBJ_ID, id)));\r
+ BasicDBObject criteria = new BasicDBObject(IOctopusAPI.MOS_OBJECTS, new BasicDBObject(IOctopusAPI.$ELEMMATCH, new BasicDBObject(IOctopusAPI.OBJ_ID, id)));\r
DBCursor find = collection.find(criteria, new BasicDBObject(IOctopusAPI.REF_RUNDOWN, 1));\r
List<DBObject> rundowns = NoSQLUtils.asList(find);\r
db.cancelBatch();\r
import org.junit.BeforeClass;\r
import org.junit.Test;\r
\r
-import user.commons.logging.LogUtils;\r
import user.jobengine.db.IItemManager;\r
import user.jobengine.db.IResultSetConsumer;\r
import user.jobengine.db.IStatementDecorator;\r
// System.setProperty("jobengine.octopus.rundowns.name", "test_rundowns");\r
// System.setProperty("jobengine.octopus.stories.name", "test_stories");\r
// System.setProperty("jobengine.octopus.storyfolders.name", "test_storyfolders");\r
- System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
- System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
- System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
-\r
- System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty("jobengine.nosql.db.user", "db2admin");\r
- System.setProperty("jobengine.nosql.db.password", "password");\r
- System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
- System.setProperty(ItemManager.DBPASSWORD, "password");\r
- System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
- // System.setProperty(ItemManager.DBURL,\r
+ // System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
+ // System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
+ // System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
+ //\r
+ // System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty("jobengine.nosql.db.user", "db2admin");\r
+ // System.setProperty("jobengine.nosql.db.password", "password");\r
+ // System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
+ // System.setProperty(ItemManager.DBPASSWORD, "password");\r
+ // System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
\r
manager = new ItemManager();\r
manager.connect();\r
long mediaFileId = rs.getLong("mediafileid");\r
String path = rs.getString("relativepath");\r
File file = Paths.get(LOWRES_ROOT, path).toFile();\r
- //ellenorizni kell, hogy a tobbi szellem e, ha van kozte akkor mar jok vagyunk \r
+ //ellenorizni kell, hogy a tobbi szellem e, ha van kozte akkor mar jok vagyunk\r
\r
MediaFile mediaFile = (MediaFile) manager.get(MediaFile.class, mediaFileId);\r
if (masterMediaFile[0] == null) {\r
import org.junit.Test;\r
\r
import user.commons.StoreUri;\r
-import user.commons.logging.LogUtils;\r
import user.commons.remotestore.RemoteStoreProtocol;\r
import user.jobengine.db.IItemManager;\r
import user.jobengine.db.Item;\r
\r
@BeforeClass\r
static public void setUpConnection() {\r
- System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
- System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
- System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
-\r
- System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.27:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty("jobengine.nosql.db.user", "db2admin");\r
- System.setProperty("jobengine.nosql.db.password", "password");\r
- System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
- System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
- System.setProperty(ItemManager.DBPASSWORD, "password");\r
- System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
- // System.setProperty(ItemManager.DBURL,\r
+ // System.setProperty("jobengine.octopus.rundowns.name", "rundowns180620");\r
+ // System.setProperty("jobengine.octopus.stories.name", "stories180620");\r
+ // System.setProperty("jobengine.octopus.storyfolders.name", "storyfolders180620");\r
+ //\r
+ // System.setProperty("jobengine.nosql.db.url", "jdbc:db2://10.10.1.27:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty("jobengine.nosql.db.user", "db2admin");\r
+ // System.setProperty("jobengine.nosql.db.password", "password");\r
+ // System.setProperty(ItemManager.DBURL, "jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true;");\r
+ // System.setProperty(ItemManager.DBUSERNAME, "db2admin");\r
+ // System.setProperty(ItemManager.DBPASSWORD, "password");\r
+ // System.setProperty(LogUtils.LOGLEVEL, "INFO");\r
\r
manager = new ItemManager();\r
manager.connect();\r
package user.jobengine.server;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import java.util.Map;
-
-import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JMock;
import org.jmock.integration.junit4.JUnit4Mockery;
import user.jobengine.server.instructions.CallJobStepInstruction;
import user.jobengine.server.instructions.PushToStackInstruction;
import user.jobengine.server.steps.IJobStep;
-import user.jobengine.server.steps.JobStep;
@RunWith(JMock.class)
public class JobEngineTest {
private static Mockery context = null;
- private IJobEngine sut = null;
- private IProgram program = null;
- private IJobRuntime jobRuntime = null;
@BeforeClass
public static void setupClass() throws Exception {
context = new JUnit4Mockery();
}
+ private IJobEngine sut = null;
+ private IProgram program = null;
+
+ private IJobRuntime jobRuntime = null;
+
@Before
public void setup() throws Exception {
sut = new JobEngine();
}
@Test
- public void testAddStepExecutor() throws Exception {
+ public void testGetInputsFromStack() throws Exception {
// Fixture
- final Class<?> stepClass = IJobStep.class;
- final IJobStepExecutor executor = context.mock(IJobStepExecutor.class);
- context.checking(new Expectations() {
- {
- one(executor).getStepClass();
- will(returnValue(stepClass));
- }
- });
+ jobRuntime = new JobRuntime(sut, program);
+ final String value1 = "value1";
+ final Integer value2 = 2;
+ jobRuntime.pushToStack(value1);
+ jobRuntime.pushToStack(value2);
+ jobRuntime.pushToStack(2);
// Exercise
- sut.addStepExecutor(executor);
+ final Object[] inputs = sut.getInputsFromStack(jobRuntime);
// Verify
- Map<String, IJobStepExecutor> executors = sut.getExecutors();
- assertEquals(1, executors.size());
- assertEquals(executor, executors.get(stepClass));
-
- // Avoid unexpected shutdown
- executors.clear();
- }
-
- @Test
- public void testLoadPrograms() throws Exception {
- sut.loadPrograms();
- IProgram program = sut.getProgram("program1");
- assertTrue(program != null);
+ assertEquals(2, inputs.length);
+ assertEquals(value1, inputs[0]);
+ assertEquals(value2, inputs[1]);
}
@Test(expected = NullPointerException.class)
assertEquals(VAR2, jobRuntime.popFromStack());
}
- @Test
- public void testGetInputsFromStack() throws Exception {
- // Fixture
- jobRuntime = new JobRuntime(sut, program);
- final String value1 = "value1";
- final Integer value2 = 2;
- jobRuntime.pushToStack(value1);
- jobRuntime.pushToStack(value2);
- jobRuntime.pushToStack(2);
-
- // Exercise
- final Object[] inputs = sut.getInputsFromStack(jobRuntime);
-
- // Verify
- assertEquals(2, inputs.length);
- assertEquals(value1, inputs[0]);
- assertEquals(value2, inputs[1]);
- }
-
- @Test
- public void testAddToExecutorQueue() throws Exception {
- // Fixture
- jobRuntime = new JobRuntime(sut, program);
- jobRuntime.pushToStack(JobStep.class);
- final IJobStepExecutor executor = context.mock(IJobStepExecutor.class);
-
- context.checking(new Expectations() {
- {
- ignoring(executor).getStepClass();
- will(returnValue(new JobStep()));
- one(executor).submit(with(jobRuntime));
- ignoring(executor).shutdown();
- }
- });
-
- // Exercise
- sut.addStepExecutor(executor);
-
- // Exercise, Verify
- sut.addToExecutorQueue(jobRuntime);
- }
}
}
};
executor = new JobStepExecutor("user.jobengine.server.steps.JobStepSpy", 1);
- jobEngine.addStepExecutor(executor);
program = new Program();
parameters = new LinkedHashMap<String, Object>();
parameters.put(STEPRUN_IN_SECONDS, 0);
};
sut = new JobStepExecutor(IJobStep.class, 1) {
- @Override
- protected IJobStep createStepObject() throws InstantiationException, IllegalAccessException {
- return jobStep;
- }
};
sut.startup();
final IJobStepExecutor sut = new JobStepExecutor(IJobStep.class, expectedJobCount) {
@Override
- protected IJobStep createStepObject() throws InstantiationException, IllegalAccessException {
+ protected IJobStep createStep() throws Exception {
return jobStep;
}
final IJobStepExecutor sut = new JobStepExecutor(IJobStep.class, 1) {
@Override
- protected IJobStep createStepObject() throws InstantiationException, IllegalAccessException {
+ protected IJobStep createStep() throws Exception {
return jobStep;
}
import java.io.File;\r
import java.nio.file.Files;\r
import java.nio.file.Paths;\r
+\r
import org.junit.Test;\r
\r
import com.ibm.nosql.json.JSONUtil;\r
import com.ibm.nosql.json.api.BasicDBList;\r
import com.ibm.nosql.json.api.BasicDBObject;\r
\r
-\r
public class SchedulerConfigTest {\r
\r
@Test\r
- public void testConfigParsing() throws Exception{\r
+ public void testConfigParsing() throws Exception {\r
String configPath = null;\r
- if(System.getProperty("jobengine.jobscheduling.config") == null){\r
- System.out.println("There is no config at: " + System.getProperty("jobengine.jobscheduling.config"));\r
- configPath = "C:/Users/robi/workspace/-configuration/scheduledjobs.json";\r
- }else{\r
- configPath = System.getProperty("jobengine.jobscheduling.config");\r
- }\r
+ configPath = "C:/Users/robi/workspace/-configuration/scheduledjobs.json";\r
File schedulingConfigFile = new File(configPath);\r
- if(schedulingConfigFile.exists()){\r
+ if (schedulingConfigFile.exists()) {\r
String jsonConfig = new String(Files.readAllBytes(Paths.get(schedulingConfigFile.getAbsolutePath())));\r
- BasicDBObject dbo = (BasicDBObject)JSONUtil.jsonToDbObject(jsonConfig);\r
- BasicDBList jobList = (BasicDBList)dbo.get("joblist");\r
- for(int c=0; c<jobList.size(); c++){\r
- BasicDBObject sjob = (BasicDBObject)jobList.get(c);\r
+ BasicDBObject dbo = (BasicDBObject) JSONUtil.jsonToDbObject(jsonConfig);\r
+ BasicDBList jobList = (BasicDBList) dbo.get("joblist");\r
+ for (int c = 0; c < jobList.size(); c++) {\r
+ BasicDBObject sjob = (BasicDBObject) jobList.get(c);\r
System.out.println(sjob.getString("template"));\r
System.out.println(sjob.getBoolean("executeimmediate"));\r
System.out.println(sjob.getString("cronexpression"));\r
- \r
+\r
}\r
- \r
- \r
+\r
}\r
}\r
}\r
org.osgi.framework;version="1.8.0",
user.commons,
user.commons.cluster,
+ user.commons.configuration,
user.commons.nexio,
user.commons.octopus,
user.commons.rest,
<reference bind="bindService" cardinality="1..1" interface="user.commons.octopus.IOctopusAPI" name="IOctopusAPI" policy="static" unbind="unbindService"/>\r
<reference bind="bindService" cardinality="1..1" interface="user.commons.nexio.INexioAPI" name="INexioAPI" policy="static" unbind="unbindService"/>\r
<reference bind="bindService" cardinality="1..1" interface="user.jobengine.osgi.ws.nexio.NexioWSServlet" name="NexioWSServlet" policy="static" unbind="unbindService"/>\r
+ <reference bind="bindSystemConfiguration" cardinality="1..1" interface="user.commons.configuration.IConfiguration" policy="static"/>\r
</scr:component>\r
\r
import org.omnifaces.servlet.FileServlet;\r
\r
+import user.jobengine.osgi.rest.ComponentBinder;\r
+\r
public class MediaFileServlet extends FileServlet {\r
- private String root = System.getProperty("jobengine.mediacube.service.proxyroot", "/temp");\r
+ private String root = ComponentBinder.getSystemConfig().value("services.mediacube.proxy-root", "/temp");\r
private File folder;\r
\r
@Override\r
import org.apache.logging.log4j.Logger;\r
import org.apache.logging.log4j.MarkerManager;\r
\r
+import user.commons.configuration.IConfiguration;\r
import user.commons.nexio.INexioAPI;\r
import user.commons.nexio.NexioDispatcher;\r
import user.commons.octopus.IOctopusAPI;\r
private static IItemManager itemManager;\r
private static IOctopusAPI octopusAPI;\r
private static INexioAPI nexioAPI;\r
-\r
private static NexioWSServlet nexioServlet;\r
+ private static IConfiguration systemConfig;\r
\r
public static IItemManager getItemManager() {\r
if (itemManager == null)\r
return nexioAPI;\r
}\r
\r
- // public static NexioWSServlet getNexioWSServlet() {\r
- // if (nexioServlet == null)\r
- // throw new RuntimeException("IOctopusAPI is null");\r
- // return nexioServlet;\r
- // }\r
-\r
public static IOctopusAPI getOctopusAPI() {\r
if (octopusAPI == null)\r
throw new RuntimeException("IOctopusAPI is null");\r
return octopusAPI;\r
}\r
\r
+ public static IConfiguration getSystemConfig() {\r
+ return systemConfig;\r
+ }\r
+\r
public synchronized void bindService(Object service) {\r
//logger.info("Ref {}", service.getClass());\r
\r
}\r
}\r
\r
+ public synchronized void bindSystemConfiguration(Object service) {\r
+ if (service instanceof IConfiguration) {\r
+ systemConfig = (IConfiguration) service;\r
+ logger.info("IConfiguration service binded");\r
+ }\r
+ }\r
+\r
public void start() {\r
NexioDispatcher dispatcher = nexioAPI.getDispatcher();\r
dispatcher.setNexioChangeListener(nexioServlet);\r
return;\r
}\r
}\r
+\r
}\r
<reference bind="bindNexioService" unbind="unbindNexioService" cardinality="1..1" interface="user.commons.nexio.INexioAPI" name="INexioAPI" policy="static" />\r
<reference bind="bindMetadataProviderFactory" unbind="unbindMetadataProviderFactory" cardinality="0..1" interface="user.mediacube.metadata.interfaces.IMetadataProviderFactory" policy="static"/>\r
<reference bind="bindJobEngine" unbind="unbindJobEngine" cardinality="1..1" interface="user.jobengine.server.IJobEngine" name="IJobEngine" policy="static" />\r
+ <reference bind="bindSystemConfiguration" cardinality="1..1" interface="user.commons.configuration.IConfiguration" policy="static"/>\r
</scr:component>\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
+import user.commons.configuration.IConfiguration;\r
import user.commons.nexio.INexioAPI;\r
import user.jobengine.server.IJobEngine;\r
import user.mediacube.metadata.interfaces.IMetadataProviderFactory;\r
private static INexioAPI nexioAPI;\r
private static IMetadataProviderFactory metadataProviderFactory;\r
private static IJobEngine jobEngine;\r
+ private static IConfiguration systemConfig;\r
\r
public static void bindJobEngine(Object service) {\r
if (service instanceof IJobEngine) {\r
return nexioAPI;\r
}\r
\r
+ public static IConfiguration getSystemConfig() {\r
+ return systemConfig;\r
+ }\r
+\r
public synchronized void bindMetadataProviderFactory(Object service) {\r
if (service instanceof IMetadataProviderFactory) {\r
metadataProviderFactory = (IMetadataProviderFactory) service;\r
}\r
}\r
\r
+ public synchronized void bindSystemConfiguration(Object service) {\r
+ if (service instanceof IConfiguration) {\r
+ systemConfig = (IConfiguration) service;\r
+ logger.info("IConfiguration service binded");\r
+ }\r
+ }\r
+\r
public synchronized void unbindJobEngine(Object service) {\r
jobEngine = null;\r
logger.info("IJobEngine service unbinded");\r
private List<TypeFilter> topTypeFilters;\r
private List<TypeFilter> bottomTypeFilters;\r
private List<String> targetRestoreFilters;\r
+ private boolean maestroDisabled;\r
+ private boolean alternateRetrieveSelector;\r
+ private boolean disableStatistics;\r
+ private boolean disableHelp;\r
+ private boolean disableEditor;\r
\r
public MediaCubeAuthentication getAuthentication() {\r
return authentication;\r
return topTypeFilters;\r
}\r
\r
+ public boolean isAlternateRetrieveSelector() {\r
+ return alternateRetrieveSelector;\r
+ }\r
+\r
+ public boolean isDisableEditor() {\r
+ return disableEditor;\r
+ }\r
+\r
+ public boolean isDisableHelp() {\r
+ return disableHelp;\r
+ }\r
+\r
+ public boolean isDisableStatistics() {\r
+ return disableStatistics;\r
+ }\r
+\r
+ public boolean isMaestroDisabled() {\r
+ return maestroDisabled;\r
+ }\r
+\r
+ public void setAlternateRetrieveSelector(boolean alternateRetrieveSelector) {\r
+ this.alternateRetrieveSelector = alternateRetrieveSelector;\r
+ }\r
+\r
public void setAuthentication(MediaCubeAuthentication authentication) {\r
this.authentication = authentication;\r
}\r
this.bottomTypeFilters = bottomTypeFilters;\r
}\r
\r
+ public void setDisableEditor(boolean disableEditor) {\r
+ this.disableEditor = disableEditor;\r
+ }\r
+\r
+ public void setDisableHelp(boolean disableHelp) {\r
+ this.disableHelp = disableHelp;\r
+ }\r
+\r
+ public void setDisableStatistics(boolean disableStatistics) {\r
+ this.disableStatistics = disableStatistics;\r
+ }\r
+\r
public void setJobQueuePollInterval(int jobQueuePollInterval) {\r
this.jobQueuePollInterval = jobQueuePollInterval;\r
}\r
\r
+ public void setMaestroDisabled(boolean maestroDisabled) {\r
+ this.maestroDisabled = maestroDisabled;\r
+ }\r
+\r
public void setTargetRestoreFilters(List<String> targetRestoreFilters) {\r
this.targetRestoreFilters = targetRestoreFilters;\r
}\r
}\r
\r
public boolean isMaestroAvailable() {\r
- return "false".equals(System.getProperty("gui.maestro.disable", "false"));\r
+ return equals(SessionUtil.getMediaCubeConfig().isMaestroDisabled());\r
}\r
\r
@Command\r
\r
@Command\r
public void showBasket() {\r
- boolean useAlternate = System.getProperty("gui.jobs.alternate.selector", "false").equals("true");\r
+ boolean useAlternate = SessionUtil.getMediaCubeConfig().isAlternateRetrieveSelector();\r
String zul = useAlternate ? PAGES_ALTERNATE_RETRIEVEBATCHSELECTOR_ZUL : PAGES_RETRIEVEBATCHSELECTOR_ZUL;\r
Map<String, Object> arguments = new HashMap<String, Object>();\r
arguments.put("selectedItems", basketItems);\r
import user.jobengine.gui.ComponentBinder;\r
import user.jobengine.server.IJobChangedListener;\r
import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.JobEngineConfiguration;\r
import user.jobengine.zk.model.IndexModel;\r
import user.jobengine.zk.model.MaestroConfig;\r
import user.jobengine.zk.model.MediaCubeConfig;\r
\r
public class SessionUtil {\r
- private static final String MEDIACUBE_CONFIG = "mediaCubeConfig";\r
private static Logger logger = LogManager.getLogger();\r
- private static final String JOBENGINE_MEDIACUBE_CONFIG = "jobengine.mediacube.config";\r
- private static final String JOBENGINE_MAESTRO_CONFIG = "jobengine.maestro.config";\r
+ private static final String MEDIACUBE_CONFIG = "mediaCubeConfig";\r
+ private static final String MAESTRO_CONFIG = "maestroConfig";\r
private static final String SEARCH_FILTER = "searchFilter";\r
private static final String COLUMN_ORDERS = "columnOrders";\r
private static final String PAGE_SIZE = "pageSize";\r
private static final String USER_NAME = "userName";\r
private static final String USER_SETTINGS = "userSettings";\r
private static final String USERPRINCIPAL = "userPrincipal";\r
- private static final String AUTH_LOCATION = "mediacube.auth.location";\r
public static final String JOBLISTENER = "joblistener";\r
public static final String MENUMODEL = "menuModel";\r
public static final String HISTORY = "history";\r
MediaCubeConfig mediaCubeConfig = getMediaCubeConfig();\r
LocalUserHandler localUserHandler = new LocalUserHandler(account, password, mediaCubeConfig.getAuthentication());\r
UserPrincipal userPrincipal = localUserHandler.getUserPrincipal();\r
- // Object nexioStatus = System.getProperty(NEXIO);\r
if (userPrincipal == null) {\r
LDAPUserHandler ldapUserHandler = new LDAPUserHandler(account, password, mediaCubeConfig.getAuthentication());\r
userPrincipal = ldapUserHandler.getUserPrincipal();\r
\r
setAttribute(USERPRINCIPAL, userPrincipal);\r
try {\r
- setAttribute("nexioDisable", Boolean.parseBoolean(System.getProperty(NEXIO_DISABLE)));\r
+ setAttribute("nexioDisable", ComponentBinder.getSystemConfig().value("services.nexio.disabled"));\r
} catch (Exception e) {\r
logger.catching(e);\r
}\r
\r
try {\r
- setAttribute("guiStatisticsDisable", Boolean.parseBoolean(System.getProperty(GUI_STAT_DISABLE)));\r
+ setAttribute("guiStatisticsDisable", getMediaCubeConfig().isDisableStatistics());\r
} catch (Exception e) {\r
logger.catching(e);\r
}\r
\r
try {\r
- setAttribute("guiHelpDisable", Boolean.parseBoolean(System.getProperty(GUI_HELP_DISABLE)));\r
+ setAttribute("guiHelpDisable", getMediaCubeConfig().isDisableHelp());\r
} catch (Exception e) {\r
logger.catching(e);\r
}\r
\r
try {\r
- setAttribute("guiEditorDisable", Boolean.parseBoolean(System.getProperty(GUI_EDITOR_DISABLE)));\r
+ setAttribute("guiEditorDisable", getMediaCubeConfig().isDisableEditor());\r
} catch (Exception e) {\r
logger.catching(e);\r
}\r
public static MaestroConfig getMaestroConfig() {\r
MaestroConfig result = null;\r
try {\r
- //result = (MaestroConfig) getAttribute(JOBENGINE_MAESTRO_CONFIG);\r
+ result = (MaestroConfig) getAttribute(MAESTRO_CONFIG);\r
if (result == null) {\r
- result = JSONConfig.read(JOBENGINE_MAESTRO_CONFIG, MaestroConfig.class);\r
- setAttribute(JOBENGINE_MAESTRO_CONFIG, result);\r
+ String configFilePath = ComponentBinder.getSystemConfig().getConfig(JobEngineConfiguration.CONF_MAESTRO);\r
+ result = JSONConfig.read(configFilePath, MaestroConfig.class);\r
+ setAttribute(MAESTRO_CONFIG, result);\r
}\r
} catch (Exception e) {\r
- logger.catching(e);\r
+ logger.error(e.getMessage());\r
}\r
return result;\r
}\r
\r
public static MediaCubeConfig getMediaCubeConfig() {\r
MediaCubeConfig result = null;\r
-\r
- result = (MediaCubeConfig) getAttribute(MEDIACUBE_CONFIG);\r
-\r
- if (result == null) {\r
- try {\r
- result = JSONConfig.read(JOBENGINE_MEDIACUBE_CONFIG, MediaCubeConfig.class);\r
+ try {\r
+ result = (MediaCubeConfig) getAttribute(MEDIACUBE_CONFIG);\r
+ if (result == null) {\r
+ String configFilePath = ComponentBinder.getSystemConfig().getConfig(JobEngineConfiguration.CONF_MEDIACUBE);\r
+ result = JSONConfig.read(configFilePath, MediaCubeConfig.class);\r
setAttribute(MEDIACUBE_CONFIG, result);\r
- } catch (Exception e) {\r
- logger.error(e.getMessage());\r
}\r
+ } catch (Exception e) {\r
+ logger.error(e.getMessage());\r
}\r
return result;\r
}\r
DynamicImport-Package: *
Require-Bundle: org.mybatis.mybatis;bundle-version="3.5.2",
com.microsoft.sqlserver.sqljdbc,
- com.ibm.db2.jcc;bundle-version="1.4.0"
+ com.ibm.db2.jcc;bundle-version="1.4.0",
+ user.jobengine.osgi.commons;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Import-Package: com.ibm.nosql.bson,
com.ibm.nosql.json.api,
+ org.apache.logging.log4j;version="2.8.2",
org.junit,
user.mediacube.metadata.interfaces
Bundle-ClassPath: .
<service>\r
<provide interface="user.mediacube.metadata.interfaces.IMetadataProviderFactory"/>\r
</service>
+ <reference bind="bindSystemConfiguration" cardinality="1..1" interface="user.commons.configuration.IConfiguration" policy="static"/>\r
</scr:component>\r
import java.util.HashMap;\r
import java.util.Map;\r
\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.configuration.IConfiguration;\r
import user.mediacube.metadata.hsm.HSMMetadataProvider;\r
import user.mediacube.metadata.interfaces.IMetadataProvider;\r
import user.mediacube.metadata.interfaces.IMetadataProviderFactory;\r
import user.mediacube.metadata.planair.PlanAirMetadataProvider;\r
\r
public class MetadataProviderFactory implements IMetadataProviderFactory {\r
+ private static Logger logger = LogManager.getLogger();\r
+\r
+ private static IConfiguration systemConfig;\r
+\r
+ public static IConfiguration getSystemConfig() {\r
+ return systemConfig;\r
+ }\r
\r
private Map<MetadataProviderType, IMetadataProvider> providers = new HashMap<>();\r
\r
public MetadataProviderFactory() {\r
- try {\r
- providers.put(MetadataProviderType.PLANAIR, new PlanAirMetadataProvider());\r
- providers.put(MetadataProviderType.HSM, new HSMMetadataProvider());\r
- } catch (Exception e) {\r
+ }\r
+\r
+ public synchronized void bindSystemConfiguration(Object service) {\r
+ if (service instanceof IConfiguration) {\r
+ systemConfig = (IConfiguration) service;\r
+ logger.info("IConfiguration service binded");\r
+ try {\r
+ providers.put(MetadataProviderType.PLANAIR, new PlanAirMetadataProvider());\r
+ providers.put(MetadataProviderType.HSM, new HSMMetadataProvider());\r
+ } catch (Exception e) {\r
+ }\r
}\r
}\r
\r
public IMetadataProvider getProvider(MetadataProviderType type) {\r
return providers.get(type);\r
}\r
+\r
}\r
\r
import com.ibm.nosql.json.api.BasicDBObject;\r
\r
+import user.mediacube.metadata.MetadataProviderFactory;\r
import user.mediacube.metadata.MyBatisMetadataProvider;\r
import user.mediacube.metadata.interfaces.IMetadata;\r
import user.mediacube.metadata.interfaces.IMetadataListOptions;\r
\r
public class HSMMetadataProvider extends MyBatisMetadataProvider {\r
private static final String JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver";\r
- private static final String JDBC_URL = System.getProperty("jobengine.hsm.db.url", "jdbc:db2://10.11.1.89:51500/tsmdb1");\r
- private static final String JDBC_USER = System.getProperty("jobengine.hsm.db.user", "tsminst1");\r
- private static final String JDBC_PWD = System.getProperty("jobengine.hsm.db.password", "tsminst1");\r
+ private static final String JDBC_URL = MetadataProviderFactory.getSystemConfig().value("datasource.hsm.url");\r
+ private static final String JDBC_USER = MetadataProviderFactory.getSystemConfig().value("datasource.hsm.user");\r
+ private static final String JDBC_PWD = MetadataProviderFactory.getSystemConfig().value("datasource.hsm.password");\r
\r
public HSMMetadataProvider() throws Exception {\r
super();\r
\r
import com.ibm.nosql.json.api.BasicDBObject;\r
\r
+import user.mediacube.metadata.MetadataProviderFactory;\r
import user.mediacube.metadata.MyBatisMetadataProvider;\r
import user.mediacube.metadata.hsm.HSMListOptions;\r
import user.mediacube.metadata.interfaces.IMetadata;\r
import user.mediacube.metadata.interfaces.PlanAirMetadataListOptions;\r
\r
public class PlanAirMetadataProvider extends MyBatisMetadataProvider {\r
- private static final String JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";\r
- private static final String JDBC_URL = System.getProperty("jobengine.planair.db.url", "jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis;");\r
- private static final String JDBC_USER = System.getProperty("jobengine.planair.db.user", "MAM");\r
- private static final String JDBC_PWD = System.getProperty("jobengine.planair.db.password", "VDani");\r
- public static final String JDBC_PROCEDURE = System.getProperty("jobengine.planair.db.procedure", "clIFsp_ORI_MAM");\r
+ String JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";\r
\r
public PlanAirMetadataProvider() throws Exception {\r
super();\r
\r
@Override\r
protected DataSource createDataSource() {\r
+ String JDBC_URL = MetadataProviderFactory.getSystemConfig().value("datasource.planair.url");\r
+ String JDBC_USER = MetadataProviderFactory.getSystemConfig().value("datasource.planair.user");\r
+ String JDBC_PWD = MetadataProviderFactory.getSystemConfig().value("datasource.planair.password");\r
return new PooledDataSource(JDBC_DRIVER, JDBC_URL, JDBC_USER, JDBC_PWD);\r
}\r
\r