001/*
002 * Stallion Core: A Modern Web Framework
003 *
004 * Copyright (C) 2015 - 2016 Stallion Software LLC.
005 *
006 * This program is free software: you can redistribute it and/or modify it under the terms of the
007 * GNU General Public License as published by the Free Software Foundation, either version 2 of
008 * the License, or (at your option) any later version. This program is distributed in the hope that
009 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
011 * License for more details. You should have received a copy of the GNU General Public License
012 * along with this program.  If not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
013 *
014 *
015 *
016 */
017
018package io.stallion.boot;
019
020import org.kohsuke.args4j.Option;
021
022import static io.stallion.utils.Literals.*;
023import static io.stallion.Context.*;
024
025
026public class ForceActionOptions extends CommandOptionsBase {
027    @Option(name="-localMode", usage="Set to 'false' if you want to simulate a server environment, with bundled assets, logging to file instead of console, etc.")
028    private String localMode = null;
029
030    @Option(name="-jobName", usage="The job to run")
031    private String jobName = "";
032
033    @Option(name="-taskId", usage="The task to run")
034    private Long taskId = 0L;
035
036    @Option(name="-force", usage="Force to run, even if it is locked")
037    private Boolean force = false;
038
039
040    public Boolean getLocalMode() {
041        if (localMode == null) {
042            return null;
043        }
044        return localMode.toLowerCase().equals("true");
045    }
046
047    public void setLocalMode(String localMode) {
048        this.localMode = localMode;
049    }
050
051
052    public String getJobName() {
053        return jobName;
054    }
055
056    public ForceActionOptions setJobName(String jobName) {
057        this.jobName = jobName;
058        return this;
059    }
060
061    public Long getTaskId() {
062        return taskId;
063    }
064
065    public ForceActionOptions setTaskId(Long taskId) {
066        this.taskId = taskId;
067        return this;
068    }
069
070    public Boolean getForce() {
071        return force;
072    }
073
074    public ForceActionOptions setForce(Boolean force) {
075        this.force = force;
076        return this;
077    }
078}