org.silverpeas.exec
Class ExternalExecution.Config

java.lang.Object
  extended by org.silverpeas.exec.ExternalExecution.Config
Enclosing class:
ExternalExecution

public static class ExternalExecution.Config
extends Object

This class permits to parametrize the external execution of a command.


Method Summary
 ExternalExecution.Config doNotDisplayErrorTrace()
          Calling this method avoids to log errors thrown during the execution of a command into log handlers of the server.
 int getSuccessfulExitStatusValue()
          Gets the code value of a successful exit status.
static ExternalExecution.Config init()
          Initializes a config with default values: the code value of a successful exit status is 0 the exception errors are traced by SilverTrace.error(String, String, String)
 boolean isDisplayErrorTraceEnabled()
          Indicates if the Silverpeas error trace must be displayed when an execution error is detected.
 ExternalExecution.Config successfulExitStatusValueIs(int successfulExitStatusValue)
          Sets the code value of a successful exit status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static ExternalExecution.Config init()
Initializes a config with default values:

Returns:
an instance of ExternalExecution.Config initialized with default values.

successfulExitStatusValueIs

public ExternalExecution.Config successfulExitStatusValueIs(int successfulExitStatusValue)
Sets the code value of a successful exit status.

Parameters:
successfulExitStatusValue - an Integer that represents the code value of a successful exit status.
Returns:
the ExternalExecution.Config instance completed with the given information.

getSuccessfulExitStatusValue

public int getSuccessfulExitStatusValue()
Gets the code value of a successful exit status.

Returns:
an integer that represents the code value.

doNotDisplayErrorTrace

public ExternalExecution.Config doNotDisplayErrorTrace()
Calling this method avoids to log errors thrown during the execution of a command into log handlers of the server.
It is useful for a command for which an execution error can be interpreted as a functional information. For example, a command that verifies the existence of an external tool.

Returns:
the ExternalExecution.Config instance completed with the given information.

isDisplayErrorTraceEnabled

public boolean isDisplayErrorTraceEnabled()
Indicates if the Silverpeas error trace must be displayed when an execution error is detected.

Returns:
true if errors must be traced, false otherwise.


Copyright © 2016 Silverpeas. All Rights Reserved.