Class SecureAdminBootstrapHelper
- java.lang.Object
-
- com.sun.enterprise.v3.admin.cluster.SecureAdminBootstrapHelper
-
public abstract class SecureAdminBootstrapHelper extends Object
Bootstraps the secure admin-related files, either over ssh (copying files from the current runtime environment to the remote system via secure ftp) or locally (using more straightforward file-copying).- Author:
- Tim Quinn
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SecureAdminBootstrapHelper.BootstrapException
-
Constructor Summary
Constructors Constructor Description SecureAdminBootstrapHelper()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
backdateInstanceDomainXML()
Adjusts the date on the new instance's domain.xml so it looks older than the original one on the DAS.void
bootstrapInstance()
Bootstraps the instance for remote admin.protected abstract void
close()
protected abstract void
copyBootstrapFiles()
Copies the bootstrap files from their origin to their destination.static SecureAdminBootstrapHelper
getLocalHelper(File existingInstanceDir, File newInstanceDir)
Creates a new helper for delivering files needed for secure admin to the local instance (local meaning on the same node as the DAS).static SecureAdminBootstrapHelper
getRemoteHelper(org.glassfish.hk2.api.ServiceLocator habitat, File DASInstanceDir, String remoteNodeDir, String instance, Node node, Logger logger)
Creates a new helper for delivering files needed for secure admin to the remote instance.protected abstract void
mkdirs(String dirURI)
Cleans up any allocated resources.
-
-
-
Method Detail
-
getRemoteHelper
public static SecureAdminBootstrapHelper getRemoteHelper(org.glassfish.hk2.api.ServiceLocator habitat, File DASInstanceDir, String remoteNodeDir, String instance, Node node, Logger logger) throws SecureAdminBootstrapHelper.BootstrapException
Creates a new helper for delivering files needed for secure admin to the remote instance.- Parameters:
habitat
- hk2 habitatDASInstanceDir
- directory of the local instance - source for the required filesremoteNodeDir
- directory of the remote node on the remote systeminstance
- name of the instance on the remote node to bootstrapnode
- Node from the domain configuration for the target nodelogger
- Logger to use- Returns:
- the remote helper
- Throws:
SecureAdminBootstrapHelper.BootstrapException
-
getLocalHelper
public static SecureAdminBootstrapHelper getLocalHelper(File existingInstanceDir, File newInstanceDir)
Creates a new helper for delivering files needed for secure admin to the local instance (local meaning on the same node as the DAS).- Parameters:
existingInstanceDir
- directory of an existing instance (typically the DAS) from where the files can be copiednewInstanceDir
- directory of the new instance to where the files will be copied- Returns:
- the local helper
-
mkdirs
protected abstract void mkdirs(String dirURI) throws IOException
Cleans up any allocated resources.- Throws:
IOException
-
close
protected abstract void close()
-
copyBootstrapFiles
protected abstract void copyBootstrapFiles() throws FileNotFoundException, IOException
Copies the bootstrap files from their origin to their destination.Concrete subclasses implement this differently, depending on exactly how they actually transfer the files.
- Throws:
FileNotFoundException
IOException
-
backdateInstanceDomainXML
protected abstract void backdateInstanceDomainXML() throws SecureAdminBootstrapHelper.BootstrapException
Adjusts the date on the new instance's domain.xml so it looks older than the original one on the DAS.We have copied the domain.xml and a small number of other files to the instance, but not all the files needed for the instance to be fully sync-ed. The sync logic decides if an instance is up-to-date by comparing the timestamp of the instance's domain.xml with that of the DAS. If those timestamps match then the sync logic judges the instance to be up-to-date. When we copy the DAS domain.xml to the instance to deliver the secure admin configuration (so the start-local-instance command and the instance will know how to connect to the DAS) it is left with the same timestamp as the DAS copy. To make sure sync works when start-local-instance runs, we backdate the instance's copy of domain.xml.
-
bootstrapInstance
public void bootstrapInstance() throws SecureAdminBootstrapHelper.BootstrapException
Bootstraps the instance for remote admin.
-
-