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

org.glassfish.embed.CommandParameters Maven / Gradle / Ivy

The newest version!
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.glassfish.embed;

import java.util.Properties;

/**
 * Used in Server execute(String commandName, CommandParameters params)
 * to pass the asadmin command parameters.
 *
 * @author Jennifer
 * @see asadmin commands
 */
public class CommandParameters {
    /**
     * Sets the operand of an asadmin command to be executed on
     * Server.
     *
     * 
     * CommandParameters cp = new CommandParameters();
     * File myWar = new File("c:\samples\hello.war");
     * cp.setOperand(myWar);
     * CommandExecution ce = server.execute("deploy", cp);
     * 
     *
     * The command is deploy. The operand is myWar
     *
     * asadmin deploy command:
     * 
     *  asadmin deploy c:\samples\hello.war
     * 
     * 
     * @param operand operand of an asadmin command
     */
    public void setOperand(String operand) {
        params.setProperty(DEFAULT_OPERAND, operand);
    }

    /**
     * Set an option of an asadmin command to be executed on Server.
     *
     * 
     * CommandParameters cp = new CommandParameters();
     * cp.setOperand("jdbc/__default");
     * cp.setOption("connectionpoolid", "DerbyPool");
     * ce = myGF.execute("create-jdbc-resource", cp);
     * 
     *
     * An option of the asadmin command create-jdbc-connection-pool
     * is datasourceclassname.  Call setOption("datasourceclassname", "myDataSourceClass")
     * to set the datasourceclassname option.
     *
     * @param optionName option name of an asadmin command
     * @param optionValue option value of an asadmin command
     */
    public void setOption(String optionName, String optionValue) {
        params.setProperty(optionName, optionValue);
    }

    Properties getParams() {
        return params;
    }

    private String DEFAULT_OPERAND = "DEFAULT";
    private Properties params = new Properties();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy