

package com.sun.jini.qa.harness;

import java.io.Serializable;

/**
 * A <code>SlaveTestRequest</code> which sets a dynamic parameter
 * on the slave.
 */
class SetDynamicParameterRequest implements SlaveRequest {

    /** the name of the parameter */
    String name;

    /** the value of the parameter */
    String value;

    /**
     * Construct the request.
     *
     * @param name the parameter name
     * @param value the parameter value
     */
    public SetDynamicParameterRequest(String name, String value) {
	this.name = name;
	this.value = value;
    }

    /**
     * Called by the <code>SlaveTest</code> to set the value of the
     * dynamic parameter for the test.
     *
     * @param slaveTest a reference to the <code>SlaveTest</code>.
     * @return <code>null</code>
     * @throws Exception never
     */
    public Object doSlaveRequest(SlaveTest slaveTest) throws Exception {
	QAConfig config = slaveTest.getConfig();
	config.setDynamicParameter(name, value);
	return null;
    }
}
