Package org.springframework.xd.dirt.stream

Examples of org.springframework.xd.dirt.stream.JobDefinition


        pagedResources.getLinks());
  }

  @Override
  protected JobDefinition createDefinition(String name, String definition) {
    return new JobDefinition(name, definition);
  }
View Full Code Here


    try {
      Stat definitionStat = client.checkExists().forPath(path);
      if (definitionStat != null) {
        byte[] data = zkConnection.getClient().getData().forPath(path);
        Map<String, String> map = ZooKeeperUtils.bytesToMap(data);
        Job job = new Job(new JobDefinition(id, map.get("definition")));

        Stat deployStat = client.checkExists().forPath(Paths.build(Paths.JOB_DEPLOYMENTS, id));
        if (deployStat != null) {
          job.setStartedAt(new Date(deployStat.getCtime()));
          job.setStatus(getDeploymentStatus(id));
View Full Code Here

      byte[] bytes = zkConnection.getClient().getData().forPath(Paths.build(Paths.JOBS, id));
      if (bytes == null) {
        return null;
      }
      Map<String, String> map = ZooKeeperUtils.bytesToMap(bytes);
      return new JobDefinition(id, map.get("definition"));
    }
    catch (Exception e) {
      ZooKeeperUtils.wrapAndThrowIgnoring(e, NoNodeException.class);
    }
    return null;
View Full Code Here

    stream1.setStatus(new DeploymentUnitStatus(State.failed));

    ModuleMetadata entity2 = new ModuleMetadata(new ModuleMetadata.Id("2", "s2.sink.log.1"),
        entityProps2, deploymentProps2, DeploymentUnitStatus.State.deployed);

    Job job1 = new Job(new JobDefinition("j3", "job"));
    job1.setStatus(new DeploymentUnitStatus(State.deployed));

    ModuleMetadata entity3 = new ModuleMetadata(new ModuleMetadata.Id("3", "j3.job.myjob.0"),
        entityProps3, deploymentProps3, State.deployed);
    List<ModuleMetadata> entities1 = new ArrayList<ModuleMetadata>();
View Full Code Here

  @Test
  public void testSuccessfulJobCreateAndDeploy() throws Exception {
    mockMvc.perform(
        post("/jobs/definitions").param("name", "job5").param("definition", JOB_DEFINITION).accept(
            MediaType.APPLICATION_JSON)).andExpect(status().isCreated());
    JobDefinition jobDefinition = jobDefinitionRepository.findOne("job5");
    assertNotNull(jobDefinition);
    assertEquals("job5", jobDefinition.getName());
    assertNotNull(xdJobRepository.findOne(jobDefinition.getName()));
  }
View Full Code Here

TOP

Related Classes of org.springframework.xd.dirt.stream.JobDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.