final String remoteNodeDir,
final String instance,
final Node node,
final Logger logger) throws BootstrapException {
RemoteType type = null;
try {
// this also handles the case where node is null
type = RemoteType.valueOf(node.getType());
}
catch (Exception e) {
throw new IllegalArgumentException(
Strings.get("internal.error", "unknown type"));
}
switch (type) {
case SSH:
return new SSHHelper(
habitat,
DASInstanceDir,
remoteNodeDir,
instance,
node,
logger);
case DCOM:
return new DCOMHelper(
habitat,
DASInstanceDir,
remoteNodeDir,
instance,
node,
logger);
default:
throw new IllegalArgumentException(
Strings.get("internal.error", "A new type must have "
+ "been added --> unknown type: " + type.toString()));
}
}