com.sun.enterprise.v3.admin.cluster
Class SecureAdminBootstrapHelper

java.lang.Object
  extended by com.sun.enterprise.v3.admin.cluster.SecureAdminBootstrapHelper

public abstract class SecureAdminBootstrapHelper
extends java.lang.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
static class SecureAdminBootstrapHelper.BootstrapException
           
 
Constructor Summary
SecureAdminBootstrapHelper()
           
 
Method Summary
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(java.io.File existingInstanceDir, java.io.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.jvnet.hk2.component.Habitat habitat, java.io.File DASInstanceDir, java.lang.String remoteNodeDir, java.lang.String instance, Node node, java.util.logging.Logger logger)
          Creates a new helper for delivering files needed for secure admin to the remote instance.
protected abstract  void mkdirs(java.lang.String dirURI)
          Cleans up any allocated resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureAdminBootstrapHelper

public SecureAdminBootstrapHelper()
Method Detail

getRemoteHelper

public static SecureAdminBootstrapHelper getRemoteHelper(org.jvnet.hk2.component.Habitat habitat,
                                                         java.io.File DASInstanceDir,
                                                         java.lang.String remoteNodeDir,
                                                         java.lang.String instance,
                                                         Node node,
                                                         java.util.logging.Logger logger)
                                                  throws SecureAdminBootstrapHelper.BootstrapException
Creates a new helper for delivering files needed for secure admin to the remote instance.

Parameters:
habitat - hk2 habitat
DASInstanceDir - directory of the local instance - source for the required files
remoteNodeDir - directory of the remote node on the remote system
instance - name of the instance on the remote node to bootstrap
node - Node from the domain configuration for the target node
logger -
Returns:
the remote helper
Throws:
java.io.IOException
SecureAdminBootstrapHelper.BootstrapException

getLocalHelper

public static SecureAdminBootstrapHelper getLocalHelper(java.io.File existingInstanceDir,
                                                        java.io.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 copied
newInstanceDir - directory of the new instance to where the files will be copied
Returns:
the local helper

mkdirs

protected abstract void mkdirs(java.lang.String dirURI)
                        throws java.io.IOException
Cleans up any allocated resources.

Throws:
java.io.IOException

close

protected abstract void close()

copyBootstrapFiles

protected abstract void copyBootstrapFiles()
                                    throws java.io.FileNotFoundException,
                                           java.io.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:
java.io.FileNotFoundException
java.io.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.

Throws:
SecureAdminBootstrapHelper.BootstrapException

bootstrapInstance

public void bootstrapInstance()
                       throws SecureAdminBootstrapHelper.BootstrapException
Bootstraps the instance for remote admin.

Throws:
java.io.IOException
SecureAdminBootstrapHelper.BootstrapException


Copyright © 2012 GlassFish Community. All Rights Reserved.