|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.deploy.Machine
public abstract class Machine
Machine defines an abstract representation of a physical computer at a physical location. The actual instances are depending on the operation system: LinuxMachine and WindowsMachine. All non-OS specific methods are implemented this machine class.
Field Summary | |
---|---|
protected java.util.List<Application> |
applications
The list of the application on this machine. |
protected java.io.File |
arcDatabaseFile
The inherited archive database file name. |
protected java.io.File |
databaseFile
The inherited database file name. |
protected java.io.File |
inheritedLogPropFile
The inherited log.prop file. |
protected java.io.File |
inheritedSecurityPolicyFile
The inherited security.policy file. |
protected java.io.File |
jarFolder
The folder containing the external jar library files. |
protected org.apache.commons.logging.Log |
log
the log, for logging stuff instead of displaying them directly. |
protected java.io.File |
machineDirectory
The directory for this machine. |
protected Parameters |
machineParameters
The machine parameters. |
protected org.dom4j.Element |
machineRoot
The root-branch for this machine in the XML tree. |
protected java.lang.String |
name
The name of this machine. |
protected java.lang.String |
netarchiveSuiteFileName
The name of the NetarchiveSuite.zip file. |
protected java.lang.String |
operatingSystem
The operating system on this machine: 'windows' or 'linux'. |
protected boolean |
resetTempDir
Whether the temp dir should be cleaned. |
protected java.lang.String |
scriptExtension
The extension on the scipt files (specified by operating system). |
protected XmlStructure |
settings
The settings, inherited from parent and overwritten. |
Constructor Summary | |
---|---|
Machine(org.dom4j.Element subTreeRoot,
XmlStructure parentSettings,
Parameters param,
java.lang.String netarchiveSuiteSource,
java.io.File logProp,
java.io.File securityPolicy,
java.io.File dbFileName,
java.io.File archiveDbFileName,
boolean resetDir,
java.io.File externalJarFolder)
A machine is referring to an actual computer at a physical location, which can have independent applications from the other machines at the same location. |
Method Summary | |
---|---|
protected abstract java.lang.String |
changeFileDirPathForSecurity(java.lang.String path)
Changes the file directory path to the format used in the security policy. |
protected abstract void |
createApplicationKillScripts(java.io.File directory)
Creates the kill scripts for all the applications. |
protected abstract void |
createApplicationStartScripts(java.io.File directory)
Creates the start scripts for all the applications. |
protected abstract void |
createArchiveDatabaseKillScript(java.io.File dir)
Creates a script for killing the archive database on a given machine. |
protected abstract void |
createArchiveDatabaseStartScript(java.io.File dir)
Creates a script for starting the archive database on a given machine. |
protected abstract void |
createHarvestDatabaseKillScript(java.io.File dir)
Creates a script for killing the harvest database on a given machine. |
protected abstract void |
createHarvestDatabaseStartScript(java.io.File dir)
Creates a script for starting the harvest database on a given machine. |
protected abstract void |
createInstallDirScript(java.io.File dir)
Function to create the script which installs the new directories. |
protected void |
createJmxRemoteAccessFile(java.io.File directory)
Creates the jmxremote.password file, based on the settings. |
protected void |
createJmxRemotePasswordFile(java.io.File directory)
Creates the jmxremote.password file, based on the settings. |
protected void |
createLogPropertyFiles(java.io.File directory)
Creates a the log property file for every application. |
protected abstract void |
createOSLocalKillAllScript(java.io.File directory)
This function creates the script to kill all applications on this machine. |
protected abstract void |
createOSLocalStartAllScript(java.io.File directory)
This function creates the script to start all applications on this machine. |
protected abstract void |
createRestartScript(java.io.File dir)
Creates a script for restating all the applications on a given machine. |
protected void |
createSecurityPolicyFile(java.io.File directory)
Copy inherited securityPolicyFile to local directory. |
protected abstract java.lang.String |
getAppDirectories()
Creates the script for creating the application specified directories. |
protected abstract java.lang.String |
getConfDirPath()
The operation system specific path to the conf directory. |
protected java.lang.String |
getEnvironmentName()
For retrieving the environment name variable. |
protected java.lang.String |
getHeritrixLogin()
For finding the jmxUsernames and jmxPasswords under the harvest.harvesting.heritrix branch under in the settings. |
protected java.lang.String |
getHeritrixUsername()
For retrieving the Heritrix username for the jmxremote.access file. |
protected abstract java.lang.String |
getInstallDirPath()
The operation system specific path to the installation directory. |
protected abstract java.lang.String |
getJMXremoteFilesCommand()
This method does the following: Retrieves the path to the jmxremote.access and jmxremote.password files. |
protected java.lang.String |
getMonitorLogin()
For finding the jmxUsernames and jmxPasswords under the monitor branch in the settings. |
protected java.lang.String |
getMonitorUsername()
For retrieving the monitor username for the jmxremote.access file. |
protected java.lang.String |
machineUserLogin()
The string for accessing this machine through SSH. |
protected abstract java.lang.String |
osGetClassPath(Application app)
Makes all the class paths into the operation system specific syntax, and puts them into a string where they are separated by the operation system specific separator (':' for linux, ';' for windows). |
protected abstract java.lang.String |
osInstallArchiveDatabase()
Checks if a specific directory for the archive database is given in the settings, and thus if the archive database should be installed on this machine. |
protected abstract java.lang.String |
osInstallDatabase()
Checks if a specific directory for the database is given in the settings, and thus if the database should be installed on this machine. |
protected abstract java.lang.String |
osInstallExternalJarFiles()
This function makes the part of the install script for installing the external jar files from within the jarFolder. |
protected abstract java.lang.String |
osInstallScript()
Creates the operation system specific installation script for this machine. |
protected abstract java.lang.String |
osInstallScriptCreateDir()
Creates the specified directories in the deploy-configuration file. |
protected abstract java.lang.String |
osKillScript()
Creates the operation system specific killing script for this machine. |
protected abstract java.lang.String |
osStartScript()
Creates the operation system specific starting script for this machine. |
protected abstract java.lang.String |
scriptCreateDir(java.lang.String dir,
boolean clean)
This functions makes the script for creating the new directories. |
void |
write(java.io.File parentDirectory)
Create the directory for the specific configurations of this machine and call the functions for creating all the scripts in this directory. |
java.lang.String |
writeToGlobalInstallScript()
Make the script for installing this machine. |
java.lang.String |
writeToGlobalKillScript()
Make the script for killing this machine. |
java.lang.String |
writeToGlobalStartScript()
Make the script for starting this machine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log log
protected org.dom4j.Element machineRoot
protected XmlStructure settings
protected Parameters machineParameters
protected java.util.List<Application> applications
protected java.lang.String name
protected java.lang.String operatingSystem
protected java.lang.String scriptExtension
protected java.lang.String netarchiveSuiteFileName
protected java.io.File inheritedLogPropFile
protected java.io.File inheritedSecurityPolicyFile
protected java.io.File databaseFile
protected java.io.File arcDatabaseFile
protected java.io.File machineDirectory
protected boolean resetTempDir
protected java.io.File jarFolder
Constructor Detail |
---|
public Machine(org.dom4j.Element subTreeRoot, XmlStructure parentSettings, Parameters param, java.lang.String netarchiveSuiteSource, java.io.File logProp, java.io.File securityPolicy, java.io.File dbFileName, java.io.File archiveDbFileName, boolean resetDir, java.io.File externalJarFolder) throws ArgumentNotValid
subTreeRoot
- The root of this instance in the XML document.parentSettings
- The setting inherited by the parent.param
- The machine parameters inherited by the parent.netarchiveSuiteSource
- The name of the NetarchiveSuite
package file.logProp
- The logging property file.securityPolicy
- The security policy file.dbFileName
- The name of the database file.archiveDbFileName
- The name of the archive database file.resetDir
- Whether the temporary directory should be reset.externalJarFolder
- The folder containing the external jar
library files.
ArgumentNotValid
- If one of the following arguments are null:
subTreeRoot, parentSettings, param, netarchiveSuiteSource, logProp,
securityPolicy.Method Detail |
---|
public void write(java.io.File parentDirectory) throws ArgumentNotValid
parentDirectory
- The directory where to write the files.
ArgumentNotValid
- If the parenteDirectory is null.public java.lang.String writeToGlobalKillScript()
public java.lang.String writeToGlobalInstallScript()
public java.lang.String writeToGlobalStartScript()
protected void createSecurityPolicyFile(java.io.File directory) throws IOFailure
directory
- The local directory for this machine.
IOFailure
- If an error occurred during the creation of the
security policy file.protected void createLogPropertyFiles(java.io.File directory) throws IOFailure
directory
- The local directory for this machine
IOFailure
- If an error occurred during the creationg of the
log property file.protected void createJmxRemotePasswordFile(java.io.File directory) throws IOFailure
directory
- The local directory for this machine
IOFailure
- If an error occurred during the creation of the
jmx remote password file.protected void createJmxRemoteAccessFile(java.io.File directory) throws IOFailure
directory
- The local directory for this machine
IOFailure
- If an error occurred during the creation of the
jmx remote access file.protected java.lang.String getMonitorLogin() throws IllegalState
IllegalState
- If there is a different amount of usernames
and passwords, or if two application has different values for their
username or passwords (applications without values are ignored).protected java.lang.String getMonitorUsername() throws IllegalState
IllegalState
- If different applications on the machine have
different user names.protected java.lang.String getHeritrixLogin() throws IllegalState
IllegalState
- If there is a different amount of usernames
and passwords, or if two application has different values for their
username or passwords (applications without values are ignored).protected java.lang.String getHeritrixUsername()
protected java.lang.String machineUserLogin()
protected java.lang.String getEnvironmentName()
protected abstract void createApplicationKillScripts(java.io.File directory)
directory
- The directory for this machine (use global variable?).protected abstract void createApplicationStartScripts(java.io.File directory)
directory
- The directory for this machine (use global variable?).protected abstract void createOSLocalStartAllScript(java.io.File directory)
directory
- The directory for this machine (use global variable?).protected abstract void createOSLocalKillAllScript(java.io.File directory)
directory
- The directory for this machine (use global variable?).protected abstract java.lang.String getInstallDirPath()
protected abstract java.lang.String getConfDirPath()
protected abstract java.lang.String osKillScript()
protected abstract java.lang.String osInstallScript()
protected abstract java.lang.String osInstallScriptCreateDir()
protected abstract java.lang.String osStartScript()
protected abstract java.lang.String osGetClassPath(Application app)
app
- The application which has the class paths.
protected abstract java.lang.String osInstallDatabase()
protected abstract java.lang.String osInstallArchiveDatabase()
protected abstract java.lang.String osInstallExternalJarFiles()
protected abstract java.lang.String scriptCreateDir(java.lang.String dir, boolean clean)
dir
- The name of the directory to create.clean
- Whether the directory should be cleaned\reset.
createInstallDirScript(File)
protected abstract java.lang.String getAppDirectories()
protected abstract java.lang.String getJMXremoteFilesCommand()
protected abstract void createInstallDirScript(java.io.File dir)
dir
- The directory to put the fileprotected abstract void createRestartScript(java.io.File dir)
dir
- The directory where the script will be placed.protected abstract void createArchiveDatabaseStartScript(java.io.File dir)
dir
- The directory where the script will be placed.protected abstract void createArchiveDatabaseKillScript(java.io.File dir)
dir
- The directory where the script will be placed.protected abstract void createHarvestDatabaseStartScript(java.io.File dir)
dir
- The directory where the script will be placed.protected abstract void createHarvestDatabaseKillScript(java.io.File dir)
dir
- The directory where the script will be placed.protected abstract java.lang.String changeFileDirPathForSecurity(java.lang.String path)
path
- The current path.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |