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

org.wildfly.plugin.cli.CliSession Maven / Gradle / Ivy

Go to download

A maven plugin that allows various management operations to be executed on WildFly Application Server.

There is a newer version: 5.1.0.Alpha1
Show newest version
/*
 * Copyright 2021 Red Hat, Inc. and/or its affiliates
 * and other contributors as indicated by the @author tags.
 *
 * Licensed 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 org.wildfly.plugin.cli;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * A CLI execution.
 *
 * @author jdenise
 */
public class CliSession {

    private List scripts = Collections.emptyList();
    private List propertiesFiles = Collections.emptyList();
    private String[] javaOpts = {};
    boolean resolveExpressions = false;
    private List commands = new ArrayList<>();

    /**
     * Set the list of CLI commands to execute.
     *
     * @param commands List of script CLI commands
     */
    public void setCommands(List commands) {
        this.commands = commands;
    }

    /**
     * Get the list of CLI commands to execute.
     *
     * @return The list of CLI commands.
     */
    public List getCommands() {
        return commands;
    }

    /**
     * Set the list of JVM options to pass to CLI process.
     *
     * @param javaOpts List of JVM Options.
     */
    public void setJavaOpts(String[] javaOpts) {
        this.javaOpts = javaOpts;
    }

    /**
     * Get the list of JVM options to pass to CLI process.
     *
     * @return The list of Java Options
     */
    public String[] getJavaOpts() {
        return javaOpts;
    }

    /**
     * Set the list of CLI script files to execute.
     *
     * @param scripts List of script file paths.
     */
    public void setScripts(List scripts) {
        this.scripts = scripts;
    }

    /**
     * Get the list of CLI script files to execute.
     *
     * @return The list of file paths.
     */
    public List getScripts() {
        return scripts;
    }

    /**
     * Set the properties files used when executing the CLI.
     *
     * @param propertiesFiles List of Path to properties file.
     */
    public void setPropertiesFiles(List propertiesFiles) {
        this.propertiesFiles = propertiesFiles;
    }

    /**
     * Get the properties files used when executing the CLI.
     *
     * @return The properties file path.
     */
    public List getPropertiesFiles() {
        return propertiesFiles;
    }

    /**
     * By default, the CLI doesn't resolve expressions located in scripts locally. In order to have the expressions
     * resolved locally, set this value to true.
     *
     * @param resolveExpressions True to resolve locally, false to resolve at server execution time.
     */
    public void setResolveExpressions(boolean resolveExpressions) {
        this.resolveExpressions = resolveExpressions;
    }

    /**
     * Get the expression resolution value.
     *
     * @return The expression resolution value.
     */
    public boolean getResolveExpression() {
        return resolveExpressions;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy