public abstract class SecureAdminBootstrapHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SecureAdminBootstrapHelper.BootstrapException |
Constructor and Description |
---|
SecureAdminBootstrapHelper() |
Modifier and Type | Method and 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.
|
public static SecureAdminBootstrapHelper getRemoteHelper(org.glassfish.hk2.api.ServiceLocator habitat, File DASInstanceDir, String remoteNodeDir, String instance, Node node, Logger logger) throws SecureAdminBootstrapHelper.BootstrapException
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 useSecureAdminBootstrapHelper.BootstrapException
public static SecureAdminBootstrapHelper getLocalHelper(File existingInstanceDir, File newInstanceDir)
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 copiedprotected abstract void mkdirs(String dirURI) throws IOException
IOException
protected abstract void close()
protected abstract void copyBootstrapFiles() throws FileNotFoundException, IOException
Concrete subclasses implement this differently, depending on exactly how they actually transfer the files.
FileNotFoundException
IOException
protected abstract void backdateInstanceDomainXML() throws SecureAdminBootstrapHelper.BootstrapException
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.
public void bootstrapInstance() throws SecureAdminBootstrapHelper.BootstrapException
Copyright © 2019. All rights reserved.