Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) 2014 Spotify AB.
   *
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 
 package com.spotify.helios.common.descriptors;
 
 
 
Basically, a pair of JobId and Goal. This is different than Task which has a Job and not a JobId. A typical JSON representation might be:
 {
   "job": "myservice:0.5:3539b7bc2235d53f79e6e8511942bbeaa8816265",
   "goal": "START",
 }
 
 
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class Deployment extends Descriptor {
 
   public static final String EMTPY_DEPLOYER_USER = null;
   public static final String EMPTY_DEPLOYER_MASTER = null;
   public static final String EMPTY_DEPLOYMENT_GROUP_NAME = null;
 
   private final JobId jobId;
   private final Goal goal;
   private final String deployerUser;
 
   private final String deployerMaster;
 
   private final String deploymentGroupName;

  
Constructor

Parameters:
jobId The id of the job.
goal The desired state (i.e. goal) of the task/deployment.
deployerUser The user doing the deployment.
deployerMaster The master that created this deployment.
deploymentGroupName The deployment group this deployment is created by.
 
   public Deployment(@JsonProperty("job"final JobId jobId,
                     @JsonProperty("goal"final Goal goal,
                     @JsonProperty("deployerUser") @Nullable final String deployerUser,
                     @JsonProperty("deployerMaster") @Nullable final String deployerMaster,
                     @JsonProperty("deploymentGroupName") @Nullable final String deploymentGroupName)
   {
     this.  = jobId;
     this. = goal;
     this. = deployerUser;
     this. = deploymentGroupName;
     this. = deployerMaster;
   }
 
   public static Deployment of(final JobId jobIdfinal Goal goal) {
     return newBuilder()
         .setJobId(jobId)
         .setGoal(goal)
         .build();
   }
 
   public static Deployment of(final JobId jobIdfinal Goal goalfinal String deployerUser) {
     return newBuilder()
         .setJobId(jobId)
         .setGoal(goal)
         .setDeployerUser(deployerUser)
         .build();
   }
 
   public static Deployment of(final JobId jobIdfinal Goal goalfinal String deployerUser,
                               final String deployerMasterfinal String deploymentGroupName)
   {
    return newBuilder()
        .setJobId(jobId)
        .setGoal(goal)
        .setDeployerUser(deployerUser)
        .setDeployerMaster(deployerMaster)
        .setDeploymentGroupName(deploymentGroupName)
        .build();
  }
  public JobId getJobId() {
    return ;
  }
  public Goal getGoal() {
    return ;
  }
  public String getDeployerUser() {
    return ;
  }
    return ;
  }
  public String getDeployerMaster() {
    return ;
  }
  public String toString() {
    return Objects.toStringHelper(this)
        .add("jobId")
        .add("goal")
        .add("deployerUser")
        .add("deployerMaster")
        .add("deploymentGroupName")
        .toString();
  }
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Deployment that = (Deploymento;
    if ( != null ? !.equals(that.jobId) : that.jobId != null) {
      return false;
    }
    if ( != that.goal) {
      return false;
    }
    if ( != null ? !.equals(that.deployerUser)
                             : that.deployerUser != null) {
      return false;
    }
    if ( != null ? !.equals(that.deploymentGroupName)
                                    : that.deploymentGroupName != null) {
      return false;
    }
    return !( != null ? !
        .equals(that.deployerMaster)
                                           : that.deployerMaster != null);
  }
  public int hashCode() {
    int result =  != null ? .hashCode() : 0;
    result = 31 * result + ( != null ? .hashCode() : 0);
    result = 31 * result + ( != null ? .hashCode() : 0);
    result = 31 * result + ( != null ? .hashCode() : 0);
    result = 31 * result + ( != null ? .hashCode() : 0);
    return result;
  }
  public Builder toBuilder() {
    return newBuilder()
        .setGoal()
        .setJobId();
  }
  public static Builder newBuilder() {
    return new Builder();
  }
  public static class Builder {
    private JobId jobId;
    private Goal goal;
    private String deployerUser;
    private String deployerMaster;
    private String deploymentGroupName;
    public Builder setJobId(final JobId jobId) {
      this. = jobId;
      return this;
    }
    public Builder setGoal(final Goal goal) {
      this. = goal;
      return this;
    }
    public Builder setDeployerUser(final String deployerUser) {
      this. = deployerUser;
      return this;
    }
    public Builder setDeploymentGroupName(String deploymentGroupName) {
      this. = deploymentGroupName;
      return this;
    }
    public Builder setDeployerMaster(String deployerMaster) {
      this. = deployerMaster;
      return this;
    }
    public Deployment build() {
    }
  }
New to GrepCode? Check out our FAQ X