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-2015 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/** 029 * The task called when we want to start the server. 030 * 031 */ 032public class StartServerTask extends StartStopTask 033{ 034 035 /** 036 * Constructor of the task. 037 * @param info the control panel information. 038 * @param dlg the progress dialog where the task progress will be displayed. 039 */ 040 public StartServerTask(ControlPanelInfo info, ProgressDialog dlg) 041 { 042 super(info, dlg); 043 } 044 045 /** {@inheritDoc} */ 046 public Type getType() 047 { 048 return Type.START_SERVER; 049 } 050 051 /** {@inheritDoc} */ 052 public LocalizableMessage getTaskDescription() 053 { 054 return INFO_CTRL_PANEL_START_SERVER_TASK_DESCRIPTION.get(); 055 } 056 057 /** {@inheritDoc} */ 058 protected String getCommandLinePath() 059 { 060 return getCommandLinePath("start-ds"); 061 } 062 063 /** {@inheritDoc} */ 064 protected ArrayList<String> getCommandLineArguments() 065 { 066 ArrayList<String> args = new ArrayList<>(); 067 args.add("--timeout"); 068 args.add("0"); 069 return args; 070 } 071}