All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rapture.common.RaptureJob Maven / Gradle / Ivy

/**
 * The MIT License (MIT)
 *
 * Copyright (C) 2011-2016 Incapture Technologies LLC
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/**
 * This file is autogenerated and any changes will be overwritten.
 */

package rapture.common;

import rapture.common.*;
import rapture.object.Searchable;
import rapture.object.Storable;
import rapture.object.Debugable;
import rapture.common.version.ApiVersion;
import rapture.common.impl.jackson.JacksonUtil;
import java.util.Map;
import rapture.common.Scheme;
import rapture.object.Addressable;
import rapture.common.model.IndexConfig;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* 
**/
@SuppressWarnings("all")
public class RaptureJob  implements RaptureTransferObject, Debugable ,Storable , Addressable {
    /*
    *  Start of field 'jobURI' (String) 
    */
    private String jobURI;

    @JsonProperty("jobURI")
    public String getJobURI() {
       return jobURI;
    }

    @JsonProperty("jobURI")
    public void setJobURI(String jobURI) {
       this.jobURI =  new RaptureURI(jobURI, Scheme.JOB).toString() /* TODO remove toString */  ;
    }
    /*
    *  end of field 'jobURI' (String) 
    */


    /*
    *  Start of field 'description' (String) 
    */
    private String description;

    @JsonProperty("description")
    public String getDescription() {
       return description;
    }

    @JsonProperty("description")
    public void setDescription(String description) {
       this.description =  description ;
    }
    /*
    *  end of field 'description' (String) 
    */


    /*
    *  Start of field 'scriptURI' (String) 
    */
    private String scriptURI;

    @JsonProperty("scriptURI")
    public String getScriptURI() {
       return scriptURI;
    }

    @JsonProperty("scriptURI")
    public void setScriptURI(String scriptURI) {
       this.scriptURI =  new RaptureURI(scriptURI, Scheme.SCRIPT).toString() /* TODO remove toString */  ;
    }
    /*
    *  end of field 'scriptURI' (String) 
    */


    /*
    *  Start of field 'cronSpec' (String) 
    */
    private String cronSpec;

    @JsonProperty("cronSpec")
    public String getCronSpec() {
       return cronSpec;
    }

    @JsonProperty("cronSpec")
    public void setCronSpec(String cronSpec) {
       this.cronSpec =  cronSpec ;
    }
    /*
    *  end of field 'cronSpec' (String) 
    */


    /*
    *  Start of field 'timeZone' (String) 
    */
    private String timeZone = "America/New_York";

    @JsonProperty("timeZone")
    public String getTimeZone() {
       return timeZone;
    }

    @JsonProperty("timeZone")
    public void setTimeZone(String timeZone) {
       this.timeZone =  timeZone ;
    }
    /*
    *  end of field 'timeZone' (String) 
    */


    /*
    *  Start of field 'params' (Map) 
    */
    private Map params;

    @JsonProperty("params")
    public Map getParams() {
       return params;
    }

    @JsonProperty("params")
    public void setParams(Map params) {
       this.params =  params ;
    }
    /*
    *  end of field 'params' (Map) 
    */


    /*
    *  Start of field 'autoActivate' (Boolean) 
    */
    private Boolean autoActivate = true;

    @JsonProperty("autoActivate")
    public Boolean getAutoActivate() {
       return autoActivate;
    }

    @JsonProperty("autoActivate")
    public void setAutoActivate(Boolean autoActivate) {
       this.autoActivate =  autoActivate ;
    }
    /*
    *  end of field 'autoActivate' (Boolean) 
    */


    /*
    *  Start of field 'activated' (Boolean) 
    */
    private Boolean activated = true;

    @JsonProperty("activated")
    public Boolean getActivated() {
       return activated;
    }

    @JsonProperty("activated")
    public void setActivated(Boolean activated) {
       this.activated =  activated ;
    }
    /*
    *  end of field 'activated' (Boolean) 
    */


    /*
    *  Start of field 'jobType' (JobType) 
    */
    private JobType jobType;

    @JsonProperty("jobType")
    public JobType getJobType() {
       return jobType;
    }

    @JsonProperty("jobType")
    public void setJobType(JobType jobType) {
       this.jobType =  jobType ;
    }
    /*
    *  end of field 'jobType' (JobType) 
    */


    /*
    *  Start of field 'maxRuntimeMinutes' (Integer) 
    */
    private Integer maxRuntimeMinutes = -1;

    @JsonProperty("maxRuntimeMinutes")
    public Integer getMaxRuntimeMinutes() {
       return maxRuntimeMinutes;
    }

    @JsonProperty("maxRuntimeMinutes")
    public void setMaxRuntimeMinutes(Integer maxRuntimeMinutes) {
       this.maxRuntimeMinutes =  maxRuntimeMinutes ;
    }
    /*
    *  end of field 'maxRuntimeMinutes' (Integer) 
    */


    /*
    *  Start of field 'appStatusNamePattern' (String) 
    */
    private String appStatusNamePattern;

    @JsonProperty("appStatusNamePattern")
    public String getAppStatusNamePattern() {
       return appStatusNamePattern;
    }

    @JsonProperty("appStatusNamePattern")
    public void setAppStatusNamePattern(String appStatusNamePattern) {
       this.appStatusNamePattern =  appStatusNamePattern ;
    }
    /*
    *  end of field 'appStatusNamePattern' (String) 
    */


   
    //@Override
    public RaptureURI getAddressURI() {
        return new RaptureURI(getStoragePath(), Scheme.JOB);
    	// return new JOBURI(getStoragePath());
    	
    }

    public static final Scheme scheme = Scheme.JOB;
    //@Override
    public Scheme getScheme() {
    	return scheme;
    }	



    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((cronSpec == null) ? 0 : cronSpec.hashCode());
        result = prime * result + ((jobURI == null) ? 0 : jobURI.hashCode());
        result = prime * result + ((scriptURI == null) ? 0 : scriptURI.hashCode());
        result = prime * result + ((description == null) ? 0 : description.hashCode());
        result = prime * result + ((timeZone == null) ? 0 : timeZone.hashCode());
        result = prime * result + ((appStatusNamePattern == null) ? 0 : appStatusNamePattern.hashCode());
        result = prime * result + ((maxRuntimeMinutes == null) ? 0 : maxRuntimeMinutes.hashCode());
        result = prime * result + ((params == null) ? 0 : params.hashCode());
        result = prime * result + ((autoActivate == null) ? 0 : autoActivate.hashCode());
        result = prime * result + ((jobType == null) ? 0 : jobType.hashCode());
        result = prime * result + ((activated == null) ? 0 : activated.hashCode());
        return result;
    }


    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        
        RaptureJob other = (RaptureJob) obj;

        if (cronSpec == null) {
            if (other.cronSpec != null) {
                return false;
            }
        } else if (!cronSpec.equals(other.cronSpec)) {
            return false;
        }

        if (jobURI == null) {
            if (other.jobURI != null) {
                return false;
            }
        } else if (!jobURI.equals(other.jobURI)) {
            return false;
        }

        if (scriptURI == null) {
            if (other.scriptURI != null) {
                return false;
            }
        } else if (!scriptURI.equals(other.scriptURI)) {
            return false;
        }

        if (description == null) {
            if (other.description != null) {
                return false;
            }
        } else if (!description.equals(other.description)) {
            return false;
        }

        if (timeZone == null) {
            if (other.timeZone != null) {
                return false;
            }
        } else if (!timeZone.equals(other.timeZone)) {
            return false;
        }

        if (appStatusNamePattern == null) {
            if (other.appStatusNamePattern != null) {
                return false;
            }
        } else if (!appStatusNamePattern.equals(other.appStatusNamePattern)) {
            return false;
        }

        if (maxRuntimeMinutes == null) {
            if (other.maxRuntimeMinutes != null) {
                return false;
            }
        } else if (!maxRuntimeMinutes.equals(other.maxRuntimeMinutes)) {
            return false;
        }

        if (params == null) {
            if (other.params != null) {
                return false;
            }
        } else if (!params.equals(other.params)) {
            return false;
        }

        if (autoActivate == null) {
            if (other.autoActivate != null) {
                return false;
            }
        } else if (!autoActivate.equals(other.autoActivate)) {
            return false;
        }

        if (jobType == null) {
            if (other.jobType != null) {
                return false;
            }
        } else if (!jobType.equals(other.jobType)) {
            return false;
        }

        if (activated == null) {
            if (other.activated != null) {
                return false;
            }
        } else if (!activated.equals(other.activated)) {
            return false;
        }

           
        return true;
    }


    /**/
    public String debug() {
        StringBuilder sb = new StringBuilder();
            {
                sb.append(" cronSpec= ");
                Object o = cronSpec;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" jobURI= ");
                Object o = jobURI;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" scriptURI= ");
                Object o = scriptURI;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" description= ");
                Object o = description;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" timeZone= ");
                Object o = timeZone;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" appStatusNamePattern= ");
                Object o = appStatusNamePattern;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" maxRuntimeMinutes= ");
                Object o = maxRuntimeMinutes;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" params= ");
                Object o = params;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" autoActivate= ");
                Object o = autoActivate;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" jobType= ");
                Object o = jobType;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" activated= ");
                Object o = activated;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

        return sb.append("\n").toString();
    }


    @Override
    public String getStoragePath() {
     // Add key fields
      return new RaptureJobPathBuilder()
        .jobURI(getJobURI())
        .buildStoragePath();
    }
    
    @Override
    public RaptureURI getStorageLocation() {
       return new RaptureJobPathBuilder()
         .jobURI(getJobURI())
         .buildStorageLocation();
    }
    
    


    @Override
    public String toString() {
        return JacksonUtil.jsonFromObject(this);
    }

    private ApiVersion _raptureVersion;

    @JsonProperty("_raptureVersion")
    public ApiVersion get_raptureVersion() {
        return _raptureVersion;
    }

    @JsonProperty("_raptureVersion")
    public void set_raptureVersion(ApiVersion _raptureVersion) {
        this._raptureVersion = _raptureVersion;
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy