protected void postInvoke(AdminCommandContext context, ActionReport subReport) { Properties subProperties = subReport.getExtraProperties(); Properties extraProps = context.getActionReport().getExtraProperties(); if (subProperties.get("listBatchJobExecutions") != null) extraProps.put("listBatchJobExecutions", subProperties.get("listBatchJobExecutions")); }
protected void postInvoke(AdminCommandContext context, ActionReport subReport) { Properties subProperties = subReport.getExtraProperties(); Properties extraProps = context.getActionReport().getExtraProperties(); if (subProperties.get("listBatchJobSteps") != null) extraProps.put("listBatchJobSteps", subProperties.get("listBatchJobSteps")); }
protected void postInvoke(AdminCommandContext context, ActionReport subReport) { Properties subProperties = subReport.getExtraProperties(); Properties extraProps = context.getActionReport().getExtraProperties(); if (subProperties.get("simpleMode") != null) extraProps.put("simpleMode", subProperties.get("simpleMode")); if (subProperties.get("listBatchJobs") != null) extraProps.put("listBatchJobs", subProperties.get("listBatchJobs")); } }
Properties properties = report.getExtraProperties(); if (properties == null) { properties = new Properties();
private void validateInstanceDirUnique(ActionReport report, AdminCommandContext context) { CommandInvocation listInstances = cr.getCommandInvocation("list-instances", report, context.getSubject()); ParameterMap map = new ParameterMap(); map.add("whichTarget", theNode.getName()); listInstances.parameters(map); listInstances.execute(); Properties pro = listInstances.report().getExtraProperties(); if (pro != null){ List<HashMap> instanceList = (List<HashMap>) pro.get("instanceList"); if (instanceList == null) return; for (HashMap instanceMap : instanceList) { final File nodeDirFile = (nodeDir != null ? new File(nodeDir) : defaultLocalNodeDirFile()); File instanceDir = new File(new File(nodeDirFile.toString(), theNode.getName()), instance); String instanceName = (String)instanceMap.get("name"); File instanceListDir = new File(new File(nodeDirFile.toString(), theNode.getName()), instance); if (instance.equalsIgnoreCase(instanceName) && instanceDir.equals(instanceListDir)) { String msg = Strings.get("Instance.duplicateInstanceDir", instance, instanceName); logger.warning(msg); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage(msg); return; } } } }
@SuppressWarnings("unchecked") private Properties getActionReportProperties(DeploymentContext deployContext) { if (!wmInfo.getDescriptor().getApplication().isVirtual()) { deployContext = ((ExtendedDeploymentContext)deployContext).getParentContext(); } return deployContext.getActionReport().getExtraProperties(); }
report.getExtraProperties().put("destinations", jmsDestList);
@Override public final void execute(AdminCommandContext context) { ActionReport actionReport = context.getActionReport(); Properties extraProperties = actionReport.getExtraProperties(); if (extraProperties == null) { extraProperties = new Properties(); if (subReport.getExtraProperties() != null && subReport.getExtraProperties().size() > 0) postInvoke(context, subReport); else { if (subReport.getSubActionsReport() != null && subReport.getSubActionsReport().size() > 0 && subReport.getSubActionsReport().get(0).getExtraProperties() != null) { postInvoke(context, subReport.getSubActionsReport().get(0)); } else {
public void validateExecutorServiceLookupName(AdminCommandContext context, String targetName, String exeLookupName) { if ("concurrent/__defaultManagedExecutorService".equals(exeLookupName)) { return; } try { CommandRunner runner = serviceLocator.getService(CommandRunner.class); ActionReport subReport = context.getActionReport().addSubActionsReport(); CommandRunner.CommandInvocation inv = runner.getCommandInvocation("list-managed-executor-services", subReport, context.getSubject()); ParameterMap params = new ParameterMap(); params.add("target", targetName); inv.parameters(params); inv.execute(); Properties props = subReport.getExtraProperties(); if (props != null) { if (props.get("managedExecutorServices") != null) { List<HashMap<String, String>> map = (List<HashMap<String, String>>) props.get("managedExecutorServices"); for (HashMap<String, String> e : map) { if (e.get("name").equals(exeLookupName)) { return; } } } } throw new GlassFishBatchValidationException("No ExecutorService mapped to " + exeLookupName); } catch (Exception ex) { throw new GlassFishBatchValidationException("Exception during validation: ", ex); } }
@Override public void execute(AdminCommandContext context) { ActionReport actionReport = context.getActionReport(); Properties extraProperties = actionReport.getExtraProperties(); if (extraProperties == null) { extraProperties = new Properties(); actionReport.setExtraProperties(extraProperties); } try { calculateHeaders(); helper.checkAndInitializeBatchRuntime(); glassFishBatchSecurityHelper.markInvocationPrivilege(true); executeCommand(context, extraProperties); actionReport.setActionExitCode(ActionReport.ExitCode.SUCCESS); } catch (Exception ex) { logger.log(Level.FINE, "Exception during command ", ex); actionReport.setMessage(ex.getMessage()); actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE); } finally { glassFishBatchSecurityHelper.markInvocationPrivilege(false); } }
public void validateDataSourceLookupName(AdminCommandContext context, String targetName, String dsLookupName) { try { CommandRunner runner = serviceLocator.getService(CommandRunner.class); ActionReport subReport = context.getActionReport().addSubActionsReport(); CommandRunner.CommandInvocation inv = runner.getCommandInvocation("list-jdbc-resources", subReport, context.getSubject()); ParameterMap params = new ParameterMap(); params.add("target", targetName); inv.parameters(params); inv.execute(); Properties props = subReport.getExtraProperties(); if (props != null) { if (props.get("jdbcResources") != null) { List<HashMap<String, String>> map = (List<HashMap<String, String>>) props.get("jdbcResources"); for (HashMap<String, String> e : map) { if (e.get("name").equals(dsLookupName)) { return; } } } } throw new GlassFishBatchValidationException("No DataSource mapped to " + dsLookupName); } catch (Exception ex) { throw new GlassFishBatchValidationException("Exception during validation: ", ex); } }
return subReport.getExtraProperties();
@Override public void execute(final AdminCommandContext context) { final ActionReport actionReport = context.getActionReport(); Properties extraProperties = actionReport.getExtraProperties(); if (extraProperties == null) { extraProperties = new Properties();
return subReport.getExtraProperties();
Properties props = report.getExtraProperties(); if (props == null) { props = new Properties();
actionReportProps = depc.getActionReport().getExtraProperties(); } else { // the application is EAR ExtendedDeploymentContext exdc = (ExtendedDeploymentContext) depc; actionReportProps = exdc.getParentContext().getActionReport().getExtraProperties();
actionReportProps = depc.getActionReport().getExtraProperties(); } else { // the application is EAR ExtendedDeploymentContext exdc = (ExtendedDeploymentContext) depc; actionReportProps = exdc.getParentContext().getActionReport().getExtraProperties();
private void copyActionReportContent(ActionReport source, ActionReport dest) { if (source == null || dest == null) { return; } dest.setActionExitCode(source.getActionExitCode()); dest.setExtraProperties(source.getExtraProperties()); //No deep copy. Any change of source is unexpected copyMessagePart(source.getTopMessagePart(), dest.getTopMessagePart()); List<? extends ActionReport> subReports = source.getSubActionsReport(); if (subReports != null) { for (ActionReport subrep : subReports) { copyActionReportContent(subrep, dest.addSubActionsReport()); } } }
return; Properties extraProps = listReport.getExtraProperties(); if (extraProps != null && extraProps.size() > 0) { boolean resourceExist = false;