EAC Toolkit 3.2.1

com.endeca.soleng.eac.toolkit.utility.perl
Class CleanDirUtility

java.lang.Object
  extended by com.endeca.soleng.eac.toolkit.base.EacElement
      extended by com.endeca.soleng.eac.toolkit.utility.Utility
          extended by com.endeca.soleng.eac.toolkit.utility.ShellUtility
              extended by com.endeca.soleng.eac.toolkit.utility.perl.PerlUtility
                  extended by com.endeca.soleng.eac.toolkit.utility.perl.PerlInlineScriptUtility
                      extended by com.endeca.soleng.eac.toolkit.utility.perl.CleanDirUtility

public class CleanDirUtility
extends PerlInlineScriptUtility

Utility used to clean a directory. Utility removes the directory and all of its contents (including files and subdirectories), then re-creates the empty directory.

Author:
sshusteff

Field Summary
 
Fields inherited from class com.endeca.soleng.eac.toolkit.utility.Utility
EAC_MAX_TOKEN_LENGTH, ENDECA_CONF, IS_WINDOWS, WINDOWS_MAX_PATH_LENGTH
 
Fields inherited from class com.endeca.soleng.eac.toolkit.base.EacElement
appName, dataPrefix, eacHost, eacPort, elementId, lockManager, logDir, sslEnabled, workingDir
 
Constructor Summary
CleanDirUtility(java.lang.String appName, java.lang.String eacHost, int eacPort, boolean sslEnabled)
          Default (inherited) constructor.
 
Method Summary
 java.lang.String getDir()
           
 java.lang.String getHost()
           
 void init(java.lang.String host, java.lang.String dir)
          Convenience wrapper of init(host, dir, workingDir) that specifies a null workingDir.
 void init(java.lang.String host, java.lang.String dir, java.lang.String workingDir)
          CleanDir initializer.
 void init(java.lang.String host, java.lang.String dir, java.lang.String workingDir, boolean skipTestingForFiles)
          CleanDir initializer.
 boolean isSkipTestingForFiles()
           
 void run()
          Runs the utility synchronously.
 void setDir(java.lang.String dir)
           
 void setHost(java.lang.String host)
           
 void setSkipTestingForFiles(boolean skipTestingForFiles)
           
 
Methods inherited from class com.endeca.soleng.eac.toolkit.utility.perl.PerlInlineScriptUtility
init
 
Methods inherited from class com.endeca.soleng.eac.toolkit.utility.perl.PerlUtility
getPerlBinary
 
Methods inherited from class com.endeca.soleng.eac.toolkit.utility.ShellUtility
buildEacStub, conditionalRun, getCommand, getHostId, initializeEacStub, maximumAllowedTokenLength, setCommand, setHostId
 
Methods inherited from class com.endeca.soleng.eac.toolkit.utility.Utility
getDirContents, getMaxMissedStatusChecksAllowed, getMaxWaitTimeSeconds, getMinWaitTimeSeconds, getNonNullPositiveLongValueOrDefault, getNumMissedStatusChecks, getSlowPollingIntervalMs, getStandardPollingIntervalMs, getStatus, incrementMissedStatusQueries, initializeEacStub, isActive, isFailed, runInParallel, setElementId, setMaxMissedStatusQueriesAllowed, setMaxWaitSeconds, setMinWaitSeconds, setNumMissedStatusChecks, setPollingIntervalMs, setSlowPollingIntervalMs, start, stop, waitForFinished
 
Methods inherited from class com.endeca.soleng.eac.toolkit.base.EacElement
getAppName, getDataPrefix, getEacHost, getEacPort, getElementId, getLockManager, getLogDir, getWorkingDir, isSslEnabled, setAppName, setDataPrefix, setEacHost, setEacPort, setLockManager, setLogDir, setSslEnabled, setWorkingDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CleanDirUtility

public CleanDirUtility(java.lang.String appName,
                       java.lang.String eacHost,
                       int eacPort,
                       boolean sslEnabled)
                throws AppConfigurationException
Default (inherited) constructor.

Throws:
AppConfigurationException - If the application name or EAC host is null.
Method Detail

init

public void init(java.lang.String host,
                 java.lang.String dir)
Convenience wrapper of init(host, dir, workingDir) that specifies a null workingDir.

Parameters:
host - ID of the host on which to execute the command.
dir - Directory to remove.

init

public void init(java.lang.String host,
                 java.lang.String dir,
                 java.lang.String workingDir)
CleanDir initializer.

Parameters:
host - ID of the host on which to execute the command.
dir - Directory to clean.
workingDir - Working directory from which to execute the command.

init

public void init(java.lang.String host,
                 java.lang.String dir,
                 java.lang.String workingDir,
                 boolean skipTestingForFiles)
CleanDir initializer.

Parameters:
host - ID of the host on which to execute the command.
dir - Directory to clean.
workingDir - Working directory from which to execute the command.
skipTestingForFiles - Defaults to false, causing utility to test the target directory for files before executing the cleanup shell call. To skip this test, set this parameter to true.

run

public void run()
         throws EacCommunicationException,
                EacComponentControlException
Description copied from class: Utility
Runs the utility synchronously. Starts the utility, polls for the status until the utility fails or stops.

Overrides:
run in class Utility
Throws:
EacCommunicationException - If a communication error occurs while requesting the status of the utility from the EAC.
EacComponentControlException - If an error occurs while trying to start the utility.

getDir

public java.lang.String getDir()

setDir

public void setDir(java.lang.String dir)

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

isSkipTestingForFiles

public boolean isSkipTestingForFiles()

setSkipTestingForFiles

public void setSkipTestingForFiles(boolean skipTestingForFiles)

EAC Toolkit 3.2.1

Copyright © 2011 Endeca Technologies, Inc. All Rights Reserved.
@VERSION
PRODUCT: EAC Toolkit (eacToolkit)
VERSION: 3.2.1
BUILD:   NONE
ARCH_OS: n/a
DATE:    2011-11-10T16:21:05-0500