com.enioka.jqm.model.Node.getDlRepo()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(11.6k)|赞(0)|评价(0)|浏览(255)

本文整理了Java中com.enioka.jqm.model.Node.getDlRepo()方法的一些代码示例,展示了Node.getDlRepo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getDlRepo()方法的具体详情如下:
包路径:com.enioka.jqm.model.Node
类名称:Node
方法名:getDlRepo

Node.getDlRepo介绍

[英]The directory that will store all the Deliverables created by job instances.
Max length is 1024.
[中]将存储作业实例创建的所有可交付成果的目录。
最大长度为1024。

代码示例

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. jqmlogger.info("\tfile produced storage directory: " + n.getDlRepo());
  2. jqmlogger.info("\tHTTP listening interface: " + n.getDns());
  3. jqmlogger.info("\tlooks for payloads inside: " + n.getRepo());

代码示例来源:origin: enioka/jqm

  1. jqmlogger.info("\tfile produced storage directory: " + n.getDlRepo());
  2. jqmlogger.info("\tHTTP listening interface: " + n.getDns());
  3. jqmlogger.info("\tlooks for payloads inside: " + n.getRepo());

代码示例来源:origin: com.enioka.jqm/jqm-tst

  1. /**
  2. * Version of {@link JqmClient#getDeliverableContent(Deliverable)} which does not require the web service APIs to be enabled to work.
  3. * Also, returned files do not self-destruct on stream close.<br>
  4. * See the javadoc of the original method for details.
  5. *
  6. * @throws FileNotFoundException
  7. */
  8. public InputStream getDeliverableContent(Deliverable file) throws FileNotFoundException
  9. {
  10. List<com.enioka.jqm.model.Deliverable> dd = com.enioka.jqm.model.Deliverable.select(cnx, "deliverable_select_by_id", file.getId());
  11. if (dd.isEmpty())
  12. {
  13. throw new JqmInvalidRequestException("no deliverable with this ID");
  14. }
  15. com.enioka.jqm.model.Deliverable d = dd.get(0);
  16. JobInstance ji = Query.create().setJobInstanceId(d.getJobId()).run().get(0);
  17. String nodeName = ji.getNodeName();
  18. Node n = nodes.get(nodeName);
  19. return new FileInputStream(FilenameUtils.concat(n.getDlRepo(), file.getFilePath()));
  20. }
  21. }

代码示例来源:origin: enioka/jqm

  1. /**
  2. * Version of {@link JqmClient#getDeliverableContent(Deliverable)} which does not require the web service APIs to be enabled to work.
  3. * Also, returned files do not self-destruct on stream close.<br>
  4. * See the javadoc of the original method for details.
  5. *
  6. * @throws FileNotFoundException
  7. */
  8. public InputStream getDeliverableContent(Deliverable file) throws FileNotFoundException
  9. {
  10. List<com.enioka.jqm.model.Deliverable> dd = com.enioka.jqm.model.Deliverable.select(cnx, "deliverable_select_by_id", file.getId());
  11. if (dd.isEmpty())
  12. {
  13. throw new JqmInvalidRequestException("no deliverable with this ID");
  14. }
  15. com.enioka.jqm.model.Deliverable d = dd.get(0);
  16. JobInstance ji = Query.create().setJobInstanceId(d.getJobId()).run().get(0);
  17. String nodeName = ji.getNodeName();
  18. Node n = nodes.get(nodeName);
  19. return new FileInputStream(FilenameUtils.concat(n.getDlRepo(), file.getFilePath()));
  20. }
  21. }

代码示例来源:origin: enioka/jqm

  1. @Override
  2. public Integer addDeliverable(String path, String fileLabel)
  3. {
  4. DbConn cnx = Helpers.getNewDbSession();
  5. try
  6. {
  7. String outputRoot = this.ji.getNode().getDlRepo();
  8. String ext = FilenameUtils.getExtension(path);
  9. String relDestPath = ji.getJD().getApplicationName() + "/" + ji.getId() + "/" + UUID.randomUUID() + "." + ext;
  10. String absDestPath = FilenameUtils.concat(outputRoot, relDestPath);
  11. String fileName = FilenameUtils.getName(path);
  12. jqmlogger.debug("A deliverable is added. Stored as " + absDestPath + ". Initial name: " + fileName);
  13. FileUtils.moveFile(new File(path), new File(absDestPath));
  14. cnx.commit();
  15. int res = Helpers.createDeliverable(relDestPath, fileName, fileLabel, this.ji.getId(), cnx);
  16. cnx.commit();
  17. return res;
  18. }
  19. catch (IOException e)
  20. {
  21. throw new JqmClientException(e);
  22. }
  23. finally
  24. {
  25. Helpers.closeQuietly(cnx);
  26. }
  27. }

代码示例来源:origin: com.enioka.jqm/jqm-test-helpers

  1. File f = TestHelpers.node == null ? null : new File(TestHelpers.node.getDlRepo());
  2. if (f != null && f.isDirectory())
  3. FileUtils.cleanDirectory(new File(TestHelpers.node.getDlRepo()));

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. @Override
  2. public Integer addDeliverable(String path, String fileLabel)
  3. {
  4. DbConn cnx = Helpers.getNewDbSession();
  5. try
  6. {
  7. String outputRoot = this.ji.getNode().getDlRepo();
  8. String ext = FilenameUtils.getExtension(path);
  9. String relDestPath = ji.getJD().getApplicationName() + "/" + ji.getId() + "/" + UUID.randomUUID() + "." + ext;
  10. String absDestPath = FilenameUtils.concat(outputRoot, relDestPath);
  11. String fileName = FilenameUtils.getName(path);
  12. jqmlogger.debug("A deliverable is added. Stored as " + absDestPath + ". Initial name: " + fileName);
  13. FileUtils.moveFile(new File(path), new File(absDestPath));
  14. cnx.commit();
  15. int res = Helpers.createDeliverable(relDestPath, fileName, fileLabel, this.ji.getId(), cnx);
  16. cnx.commit();
  17. return res;
  18. }
  19. catch (IOException e)
  20. {
  21. throw new JqmClientException(e);
  22. }
  23. finally
  24. {
  25. Helpers.closeQuietly(cnx);
  26. }
  27. }

代码示例来源:origin: enioka/jqm

  1. File f = TestHelpers.node == null ? null : new File(TestHelpers.node.getDlRepo());
  2. if (f != null && f.isDirectory())
  3. FileUtils.cleanDirectory(new File(TestHelpers.node.getDlRepo()));

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. if (!StringUtils.hasText(nn.getDlRepo()) || !StringUtils.hasText(nn.getRepo()) || !StringUtils.hasText(nn.getTmpDirectory()))

代码示例来源:origin: enioka/jqm

  1. if (!StringUtils.hasText(nn.getDlRepo()) || !StringUtils.hasText(nn.getRepo()) || !StringUtils.hasText(nn.getTmpDirectory()))

代码示例来源:origin: enioka/jqm

  1. /**
  2. * Retrieve all the files created by a job, with auth, without SSL
  3. */
  4. @Test
  5. public void testGetDeliverables() throws Exception
  6. {
  7. Helpers.setSingleParam("disableWsApi", "false", cnx);
  8. Helpers.setSingleParam("enableWsApiAuth", "true", cnx);
  9. Helpers.setSingleParam("enableWsApiSsl", "false", cnx);
  10. int id = JqmSimpleTest.create(cnx, "pyl.EngineApiSendDeliverable").addDefParameter("filepath", TestHelpers.node.getDlRepo())
  11. .addDefParameter("fileName", "jqm-test-deliverable1.txt").run(this);
  12. List<InputStream> tmp = JqmClientFactory.getClient().getJobDeliverablesContent(id);
  13. // Assert.assertTrue(tmp.get(0).available() > 0);
  14. String res = IOUtils.toString(tmp.get(0), Charset.defaultCharset());
  15. Assert.assertTrue(res.startsWith("Hello World!"));
  16. tmp.get(0).close();
  17. }

代码示例来源:origin: enioka/jqm

  1. /**
  2. * Retrieve a remote file with authentication, without SSL.
  3. */
  4. @Test
  5. public void testGetOneDeliverableWithAuth() throws Exception
  6. {
  7. Helpers.setSingleParam("disableWsApi", "false", cnx);
  8. Helpers.setSingleParam("enableWsApiAuth", "true", cnx);
  9. Helpers.setSingleParam("enableWsApiSsl", "false", cnx);
  10. int jobId = JqmSimpleTest.create(cnx, "pyl.EngineApiSendDeliverable").addDefParameter("filepath", TestHelpers.node.getDlRepo())
  11. .addDefParameter("fileName", "jqm-test-deliverable2.txt").run(this);
  12. File f = new File(TestHelpers.node.getDlRepo() + "jqm-test-deliverable2.txt");
  13. Assert.assertEquals(false, f.exists()); // file should have been moved
  14. List<com.enioka.jqm.api.Deliverable> files = JqmClientFactory.getClient().getJobDeliverables(jobId);
  15. Assert.assertEquals(1, files.size());
  16. InputStream tmp = JqmClientFactory.getClient().getDeliverableContent(files.get(0));
  17. Assert.assertTrue(tmp.available() > 0);
  18. String res = IOUtils.toString(tmp, Charset.defaultCharset());
  19. Assert.assertTrue(res.startsWith("Hello World!"));
  20. tmp.close();
  21. }

代码示例来源:origin: enioka/jqm

  1. /**
  2. * Same as above, except authentication is disabled as well as SSL.
  3. */
  4. @Test
  5. public void testGetOneDeliverableWithoutAuth() throws Exception
  6. {
  7. Helpers.setSingleParam("disableWsApi", "false", cnx);
  8. Helpers.setSingleParam("enableWsApiAuth", "false", cnx);
  9. Helpers.setSingleParam("enableWsApiSsl", "false", cnx);
  10. int jobId = JqmSimpleTest.create(cnx, "pyl.EngineApiSendDeliverable").addDefParameter("filepath", TestHelpers.node.getDlRepo())
  11. .addDefParameter("fileName", "jqm-test-deliverable3.txt").run(this);
  12. File f = new File(TestHelpers.node.getDlRepo() + "jqm-test-deliverable3.txt");
  13. Assert.assertEquals(false, f.exists()); // file should have been moved
  14. List<com.enioka.jqm.api.Deliverable> files = JqmClientFactory.getClient().getJobDeliverables(jobId);
  15. Assert.assertEquals(1, files.size());
  16. InputStream tmp = JqmClientFactory.getClient().getDeliverableContent(files.get(0));
  17. Assert.assertTrue(tmp.available() > 0);
  18. String res = IOUtils.toString(tmp, Charset.defaultCharset());
  19. Assert.assertTrue(res.startsWith("Hello World!"));
  20. tmp.close();
  21. }

代码示例来源:origin: enioka/jqm

  1. /**
  2. * Retrieve a remote file with authentication, with SSL.
  3. */
  4. @Test
  5. public void testGetOneDeliverableWithAuthWithSsl() throws Exception
  6. {
  7. Helpers.setSingleParam("disableWsApi", "false", cnx);
  8. Helpers.setSingleParam("enableWsApiAuth", "true", cnx);
  9. Helpers.setSingleParam("enableWsApiSsl", "true", cnx);
  10. JqmClientFactory.resetClient(null);
  11. JqmClientFactory.setProperty("com.enioka.jqm.ws.truststoreFile", "./conf/trusted.jks");
  12. JqmClientFactory.setProperty("com.enioka.jqm.ws.truststorePass", "SuperPassword");
  13. int jobId = JqmSimpleTest.create(cnx, "pyl.EngineApiSendDeliverable").addDefParameter("filepath", TestHelpers.node.getDlRepo())
  14. .addDefParameter("fileName", "jqm-test-deliverable4.txt").run(this);
  15. File f = new File(TestHelpers.node.getDlRepo() + "jqm-test-deliverable4.txt");
  16. Assert.assertEquals(false, f.exists()); // file should have been moved
  17. List<com.enioka.jqm.api.Deliverable> files = JqmClientFactory.getClient().getJobDeliverables(jobId);
  18. Assert.assertEquals(1, files.size());
  19. InputStream tmp = JqmClientFactory.getClient().getDeliverableContent(files.get(0));
  20. Assert.assertTrue(tmp.available() > 0);
  21. String res = IOUtils.toString(tmp, Charset.defaultCharset());
  22. Assert.assertTrue(res.startsWith("Hello World!"));
  23. tmp.close();
  24. }

代码示例来源:origin: enioka/jqm

  1. /**
  2. * This test is DB only - no simple service use
  3. */
  4. @Test
  5. public void testGetAllDeliverables() throws Exception
  6. {
  7. int jobId = JqmSimpleTest.create(cnx, "pyl.EngineApiSendDeliverable").addDefParameter("filepath", TestHelpers.node.getDlRepo())
  8. .addDefParameter("fileName", "jqm-test-deliverable5.txt").run(this);
  9. List<com.enioka.jqm.api.Deliverable> tmp = JqmClientFactory.getClient().getJobDeliverables(jobId);
  10. Assert.assertEquals(1, tmp.size());
  11. }
  12. }

代码示例来源:origin: enioka/jqm

  1. tmp.add("NormalQueue");
  2. XmlQueueExporter.export(TestHelpers.node.getDlRepo() + "xmlexportqueuetest.xml", cnx, tmp);
  3. File t = new File(TestHelpers.node.getDlRepo() + "xmlexportqueuetest.xml");
  4. Assert.assertEquals(true, t.exists());
  5. XmlQueueParser.parse(TestHelpers.node.getDlRepo() + "xmlexportqueuetest.xml", cnx);

代码示例来源:origin: enioka/jqm

  1. "DateTime", null, "Franquin", "ModuleMachin", "other", "other", false, cnx);
  2. XmlQueueExporter.export(TestHelpers.node.getDlRepo() + "xmlexportqueuetest.xml", cnx);
  3. File t = new File(TestHelpers.node.getDlRepo() + "xmlexportqueuetest.xml");
  4. Assert.assertEquals(true, t.exists());
  5. XmlQueueParser.parse(TestHelpers.node.getDlRepo() + "xmlexportqueuetest.xml", cnx);

代码示例来源:origin: com.enioka.jqm/jqm-test-helpers

  1. TestHelpers.dpSlow3 = DeploymentParameter.create(cnx, node3, 1, 1000, qSlow3);
  2. if (!(new File(TestHelpers.node.getDlRepo())).isDirectory() && !(new File(TestHelpers.node.getDlRepo())).mkdir())

代码示例来源:origin: enioka/jqm

  1. TestHelpers.dpSlow3 = DeploymentParameter.create(cnx, node3, 1, 1000, qSlow3);
  2. if (!(new File(TestHelpers.node.getDlRepo())).isDirectory() && !(new File(TestHelpers.node.getDlRepo())).mkdir())

代码示例来源:origin: enioka/jqm

  1. "DateTime2", null, "Franquin", "ModuleMachin", "other", "other", false, cnx);
  2. XmlJobDefExporter.export(TestHelpers.node.getDlRepo() + "xmlexportjobdeftest.xml", cnx);
  3. File f = new File(TestHelpers.node.getDlRepo() + "xmlexportjobdeftest.xml");
  4. Assert.assertEquals(true, f.exists());
  5. XmlJobDefParser.parse(TestHelpers.node.getDlRepo() + "xmlexportjobdeftest.xml", cnx);

相关文章