private File getDomainInstanceDir() { return env.getInstanceRoot(); }
private File getDomainInstanceDir() { return env.getInstanceRoot(); }
/** * Returns path where zip file needs to be created. * * @return */ private File getZipFilePath() { return new File(env.getInstanceRoot() + File.separator + "collected-logs"); }
public boolean requiresSecureAdmin() { String instanceRoot = env.getInstanceRoot().getAbsolutePath(); File configDir = new File(instanceRoot, "config"); //default KS password if (configDir.isDirectory()) { for (File configFile : configDir.listFiles()) { if (configFile.getName().endsWith(NSS)) { return true; } } } return false; }
public boolean requiresSecureAdmin() { String instanceRoot = env.getInstanceRoot().getAbsolutePath(); File configDir = new File(instanceRoot, "config"); //default KS password if (configDir != null) { for (File configFile : configDir.listFiles()) { if (configFile.getName().endsWith(NSS)) { return true; } } } return false; }
private void setDasName() { try { String name = env.getInstanceRoot().getName(); top.addProperty("domain_name", name); } catch (Exception ex) { // ignore } }
private File getDefaultBundle() { return new File(new File(env.getInstanceRoot(), "sync"), getDefaultBundleName()); }
private File getDefaultBundle() { return new File(new File(env.getInstanceRoot(), "sync"), getDefaultBundleName()); }
private static String getInstanceRoot() { try { ServerEnvironment se = (Globals.getDefaultHabitat() != null)?Globals.getDefaultHabitat().getComponent(ServerEnvironment.class):null; File fileInstanceRoot = (se == null)?null:se.getInstanceRoot(); return (fileInstanceRoot != null)?fileInstanceRoot.getCanonicalPath():null; } catch(IOException e) { _logger.log(Level.FINE, "io_exception while getting the instanceRoot"); return null; } } }
/** * Restart of the application server : * * All running services are stopped. * LookupManager is flushed. * * Client code that started us should notice the return value of 10 and restart us. */ public void execute(AdminCommandContext context) { setRegistry(registry); setServerName(env.getInstanceRoot().getName()); if (debug != null) setDebug(Boolean.parseBoolean(debug)); doExecute(context); } }
/** * Used to create directory on DAS * * @param serviceName * @param report * @return */ private File makingDirectoryOnDas(String serviceName, ActionReport report) { //creating collect-logs directory under domains/domain1 File collectLogsDir = makingDirectory(env.getInstanceRoot(), "collected-logs", report); //creating logs directory under domains/domain1/collect-logs File logsDir = makingDirectory(collectLogsDir, "logs", report); // creating target directory either // domains/domain1/collect-logs/logs/<serviceName> (if no appName found) File targetDir = makingDirectory(logsDir, serviceName, report); return targetDir; }
@Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); final Payload.Outbound outboundPayload = context.getOutboundPayload(); final File instanceRoot = env.getInstanceRoot(); try { for (File f : bootstrappedFiles) { outboundPayload.attachFile( DOWNLOADED_FILE_MIME_TYPE, instanceRoot.toURI().relativize(f.toURI()), DOWNLOAD_DATA_REQUEST_NAME, f); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } catch (IOException ex) { report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(ex); } } }
@Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); final Payload.Outbound outboundPayload = context.getOutboundPayload(); final File instanceRoot = env.getInstanceRoot(); try { for (File f : bootstrappedFiles) { outboundPayload.attachFile( DOWNLOADED_FILE_MIME_TYPE, instanceRoot.toURI().relativize(f.toURI()), DOWNLOAD_DATA_REQUEST_NAME, f); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } catch (IOException ex) { report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(ex); } } }
new File(configConfigDir, "lib/ext").mkdirs(); String srcConfigLoggingFile = env.getInstanceRoot().getAbsolutePath() + File.separator + "config" + File.separator + srcConfig + File.separator + ServerEnvironmentImpl.kLoggingPropertiesFileName; File src = new File(srcConfigLoggingFile);
File defaultContextXml = new File(serverEnvironment.getInstanceRoot(), DEFAULT_CONTEXT_XML); if (defaultContextXml.exists()) { ContextXmlParser parser = new ContextXmlParser(defaultContextXml); Property prop = vsBean.getProperty("contextXmlDefault"); if (prop != null) { File contextXml = new File(serverEnvironment.getInstanceRoot(), prop.getValue()); if (contextXml.exists()) { // vs context.xml
String srcConfigLoggingFile = env.getInstanceRoot().getAbsolutePath() + File.separator + "config" + File.separator + srcConfig + File.separator + ServerEnvironmentImpl.kLoggingPropertiesFileName; File src = new File(srcConfigLoggingFile);
/** * Used to create directory on DAS * * @param serviceName * @param report * @return */ private File makingDirectoryOnDas(String serviceName, ActionReport report) { //creating collect-logs directory under domains/domain1 File collectLogsDir = makingDirectory(env.getInstanceRoot(), "collected-logs", report); //creating logs directory under domains/domain1/collect-logs File logsDir = makingDirectory(collectLogsDir, "logs", report); // assigning domains/domain1/collect-logs/logs as app directory File appDir = logsDir; if (appName != null) { // creating domains/domain1/collect-logs/logs/<appName> as app directory appDir = makingDirectory(logsDir, appName, report); } // creating target directory either // domains/domain1/collect-logs/logs/<appName>/<serviceName> (if appName is there) or // domains/domain1/collect-logs/logs/<serviceName> (if no appName found) File targetDir = makingDirectory(appDir, serviceName, report); return targetDir; }
String instanceRoot = env.getInstanceRoot().getAbsolutePath(); File genPolicyDir = new File(instanceRoot, DIR_GENERATED_POLICY); if(genPolicyDir != null) {
/** * * Delivers bootstrap files for secure admin locally, because the instance * is on the same system as the DAS (and therefore on the same system where * this command is running). * * @return 0 if successful, 1 otherwise */ private int bootstrapSecureAdminLocally() { final ActionReport report = ctx.getActionReport(); try { final SecureAdminBootstrapHelper bootHelper = SecureAdminBootstrapHelper.getLocalHelper( env.getInstanceRoot(), getLocalInstanceDir()); bootHelper.bootstrapInstance(); return 0; } catch (Exception ex) { String msg = Strings.get("create.instance.local.boot.failed", instance, node, nodeHost); logger.log(Level.SEVERE, msg, ex); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage(msg); return 1; } }
/** * * Delivers bootstrap files for secure admin locally, because the instance * is on the same system as the DAS (and therefore on the same system where * this command is running). * * @return 0 if successful, 1 otherwise */ private int bootstrapSecureAdminLocally() { final ActionReport report = ctx.getActionReport(); try { final SecureAdminBootstrapHelper bootHelper = SecureAdminBootstrapHelper.getLocalHelper( env.getInstanceRoot(), getLocalInstanceDir()); bootHelper.bootstrapInstance(); bootHelper.close(); return 0; } catch (IOException ex) { return reportFailure(ex, report); } catch (SecureAdminBootstrapHelper.BootstrapException ex) { return reportFailure(ex, report); } }