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

com.anrisoftware.sscontrol.scripts.unix.StopServicesFactory Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2014-2015 Erwin Müller 
 *
 * This file is part of sscontrol-scripts-unix.
 *
 * sscontrol-scripts-unix is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * sscontrol-scripts-unix is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with sscontrol-scripts-unix. If not, see .
 */
package com.anrisoftware.sscontrol.scripts.unix;

import java.util.List;
import java.util.Map;

import org.joda.time.Duration;

import com.anrisoftware.globalpom.exec.api.ProcessTask;
import com.anrisoftware.globalpom.exec.runcommands.RunCommands;
import com.anrisoftware.globalpom.exec.scriptprocess.AbstractProcessExec;
import com.anrisoftware.globalpom.threads.api.Threads;

/**
 * Factory to create the stop services.
 *
 * @author Erwin Mueller, [email protected]
 * @since 1.0
 */
public interface StopServicesFactory {

    /**
     * Create the stop services.
     *
     * @param args
     *            the {@link Map} arguments:
     *            
    *
  • {@code log} the logger that logs the command output; * *
  • {@code command} the stop service {@link String} command; * *
  • {@code services} the {@link List} the services to stop; * *
  • {@code flags} optionally, set the extra {@link String} * flags for the restart command that is attached after the list * of services. * *
  • {@code runCommands} optionally, set to the * {@link RunCommands} to record the command. * *
  • {@code outString} optionally, set to {@code true} to save * the output in a {@link String} for later parsing, see * {@link ProcessTask#getOut()}. Per default it is set to * {@link AbstractProcessExec#OUT_STRING_DEFAULT}. * *
  • {@code timeout} optionally, set the timeout * {@link Duration}. Per default it is set to * {@link AbstractProcessExec#TIMEOUT_DEFAULT}. * *
  • {@code destroyOnTimeout} optionally, set to {@code true} * to destroy the process on timeout. Per default it is set to * {@link AbstractProcessExec#DESTROY_ON_TIMEOUT_DEFAULT}. * *
  • {@code checkExitCodes} optionally, set to {@code true} to * check the exit code(s) of the process; * *
  • {@code exitCodes} optionally, set a {@link List} of * success exit codes; * *
  • {@code exitCode} optionally, set the success exit code of * the process. Per default it is set to * {@link AbstractProcessExec#EXIT_CODE_DEFAULT}. *
* * @param parent * the {@link Object} parent script. * * @param threads * the {@link Threads} pool. * * @return the {@link StopServices}. */ StopServices create(Map args, Object parent, Threads threads); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy