001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008-2009 Sun Microsystems, Inc.
015 * Portions Copyright 2014-2016 ForgeRock AS.
016 */
017
018package org.opends.guitools.controlpanel.task;
019
020import static org.opends.messages.AdminToolMessages.*;
021
022import java.util.ArrayList;
023
024import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo;
025import org.opends.guitools.controlpanel.ui.ProgressDialog;
026import org.forgerock.i18n.LocalizableMessage;
027
028/** The task called when we want to start the server. */
029public class StartServerTask extends StartStopTask
030{
031
032  /**
033   * Constructor of the task.
034   * @param info the control panel information.
035   * @param dlg the progress dialog where the task progress will be displayed.
036   */
037  public StartServerTask(ControlPanelInfo info, ProgressDialog dlg)
038  {
039    super(info, dlg);
040  }
041
042  @Override
043  public Type getType()
044  {
045    return Type.START_SERVER;
046  }
047
048  @Override
049  public LocalizableMessage getTaskDescription()
050  {
051    return INFO_CTRL_PANEL_START_SERVER_TASK_DESCRIPTION.get();
052  }
053
054  @Override
055  protected String getCommandLinePath()
056  {
057    return getCommandLinePath("start-ds");
058  }
059
060  @Override
061  protected ArrayList<String> getCommandLineArguments()
062  {
063    ArrayList<String> args = new ArrayList<>();
064    args.add("--timeout");
065    args.add("0");
066    return args;
067  }
068}