Package org.springframework.xd.dirt.core

Examples of org.springframework.xd.dirt.core.JobDeploymentsPath


    undeployModule(streamName, moduleType, moduleLabel);

    String path;
    if (ModuleType.job.toString().equals(moduleType)) {
      path = new JobDeploymentsPath().setJobName(streamName).setModuleLabel(moduleLabel)
          .setContainer(containerAttributes.getId()).build();
    }
    else {
      path = new StreamDeploymentsPath().setStreamName(streamName).setModuleType(moduleType)
          .setModuleLabel(moduleLabel).setModuleSequence(moduleSequence)
View Full Code Here


   */
  private Module deployJobModule(CuratorFramework client, String jobName, String jobLabel,
      RuntimeModuleDeploymentProperties properties) throws Exception {
    logger.info("Deploying job '{}'", jobName);

    String jobDeploymentPath = new JobDeploymentsPath().setJobName(jobName).setModuleLabel(jobLabel)
        .setModuleSequence(properties.getSequenceAsString()).setContainer(containerAttributes.getId()).build();

    Module module = null;
    Job job = DeploymentLoader.loadJob(client, jobName, jobFactory);
    if (job != null) {
View Full Code Here

    @Override
    public void process(WatchedEvent event) throws Exception {
      CuratorFramework client = zkConnection.getClient();

      if (event.getType() == Watcher.Event.EventType.NodeDeleted) {
        JobDeploymentsPath jobDeploymentsPath = new JobDeploymentsPath(event.getPath());
        String jobName = jobDeploymentsPath.getJobName();
        String moduleLabel = jobDeploymentsPath.getModuleLabel();
        String moduleSequence = jobDeploymentsPath.getModuleSequenceAsString();

        undeployModule(jobName, ModuleType.job.toString(), moduleLabel);

        String deploymentPath = new ModuleDeploymentsPath().setContainer(containerAttributes.getId())
            .setDeploymentUnitName(jobName).setModuleType(ModuleType.job.toString())
View Full Code Here

      if (job != null) {
        String jobModulesPath = Paths.build(Paths.JOB_DEPLOYMENTS, jobName, Paths.MODULES);
        List<ModuleDeploymentStatus> statusList = new ArrayList<ModuleDeploymentStatus>();
        List<String> moduleDeployments = client.getChildren().forPath(jobModulesPath);
        for (String moduleDeployment : moduleDeployments) {
          JobDeploymentsPath jobDeploymentsPath = new JobDeploymentsPath(
              Paths.build(jobModulesPath, moduleDeployment));
          statusList.add(new ModuleDeploymentStatus(
              jobDeploymentsPath.getContainer(),
              jobDeploymentsPath.getModuleSequence(),
              new ModuleDescriptor.Key(jobName, ModuleType.job, jobDeploymentsPath.getModuleLabel()),
              ModuleDeploymentStatus.State.deployed, null));
        }
        DeploymentUnitStatus status = stateCalculator.calculate(job,
            new DefaultModuleDeploymentPropertiesProvider(job), statusList);
View Full Code Here

    String moduleLabel = descriptor.getModuleLabel();
    String moduleDeploymentPath = Paths.build(Paths.JOB_DEPLOYMENTS, descriptor.getGroup(), Paths.MODULES);
    try {
      List<String> moduleDeployments = getClient().getChildren().forPath(moduleDeploymentPath);
      for (String moduleDeployment : moduleDeployments) {
        JobDeploymentsPath path = new JobDeploymentsPath(
            Paths.build(moduleDeploymentPath, moduleDeployment));
        if (path.getModuleLabel().equals(moduleLabel)) {
          containers.add(path.getContainer());
        }
      }
    }
    catch (KeeperException.NoNodeException e) {
      // job has not been (or is no longer) deployed
View Full Code Here

        label = streamDeploymentsPath.getModuleLabel();
        moduleSequence = streamDeploymentsPath.getModuleSequence();
        container = streamDeploymentsPath.getContainer();
      }
      else {
        JobDeploymentsPath jobDeploymentsPath = new JobDeploymentsPath(Paths.build(path, module));
        deploymentUnitName = jobDeploymentsPath.getJobName();
        Assert.state(deploymentUnitName.equals(deploymentUnit.getName()));
        type = ModuleType.job;
        label = jobDeploymentsPath.getModuleLabel();
        moduleSequence = jobDeploymentsPath.getModuleSequence();
        container = jobDeploymentsPath.getContainer();
      }

      ModuleDescriptor.Key moduleDescriptorKey = new ModuleDescriptor.Key(deploymentUnitName, type, label);
      results.add(new ModuleDeploymentStatus(container, moduleSequence, moduleDescriptorKey,
          ModuleDeploymentStatus.State.deployed, null));
View Full Code Here

        List<ModuleDeploymentRequestsPath> requestedModules = ModuleDeploymentRequestsPath.getModulesForDeploymentUnit(
            requestedModulesPaths, jobName);
        Set<String> previouslyDeployed = new HashSet<String>();

        for (String deployedModule : client.getChildren().forPath(Paths.build(data.getPath(), Paths.MODULES))) {
          previouslyDeployed.add(Paths.stripPath(new JobDeploymentsPath(Paths.build(data.getPath(),
              Paths.MODULES,
              deployedModule)).getModuleInstanceAsString()));
        }

        for (ModuleDeploymentRequestsPath path : requestedModules) {
View Full Code Here

TOP

Related Classes of org.springframework.xd.dirt.core.JobDeploymentsPath

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.