private void doGet() { ActionReport.MessagePart topPart = reporter.getTopMessagePart(); Iterator it = nodeTreeToProcess.keySet().iterator(); while (it.hasNext()) { Object obj = it.next(); String line = obj.toString(); line = line.replace(SLASH, "/") + " = " + nodeTreeToProcess.get(obj); if (plainReporter != null) cliOutput.append(line).append('\n'); else { ActionReport.MessagePart part = topPart.addChild(); part.setMessage(line); } } setSuccess(); }
private void fillEndpoints(ActionReport report, Map<String, Map<String, Map<String, DeployedEndpointData>>> endpoints) { if (!endpoints.isEmpty()) { Properties extra = new Properties(); extra.putAll(endpoints); report.setExtraProperties(extra); ActionReport.MessagePart top = report.getTopMessagePart(); for(Map.Entry<String, Map<String, Map<String, DeployedEndpointData>>> app : endpoints.entrySet()) { ActionReport.MessagePart child = top.addChild(); child.setMessage("application:"+app.getKey()); for(Map.Entry<String, Map<String, DeployedEndpointData>> module : app.getValue().entrySet()) { child = child.addChild(); child.setMessage(" module:"+module.getKey()); for(Map.Entry<String, DeployedEndpointData> endpoint : module.getValue().entrySet()) { child = child.addChild(); child.setMessage(" endpoint:"+endpoint.getKey()); for(Map.Entry<String, String> endpointData : endpoint.getValue().getStaticAsMap().entrySet()) { child = child.addChild(); child.setMessage(" "+endpointData.getKey()+":"+endpointData.getValue()); } } } } } }
private static void fillSubMessages(final ActionReport.MessagePart mp, final JSONArray json) throws JSONException { if (json == null) { return; } for (int i = 0; i < json.length(); i++) { JSONObject subJson = json.getJSONObject(i); MessagePart child = mp.addChild(); child.setMessage(subJson.optString("message")); Properties props = (Properties) extractMap(subJson.optJSONObject("properties"), new Properties()); for (Map.Entry entry : props.entrySet()) { child.addProperty(String.valueOf(entry.getKey()), String.valueOf(entry.getValue())); } fillSubMessages(child, subJson.optJSONArray("children")); } }
private void doList() { // list means only print things that have children. Don't print the children. ActionReport.MessagePart topPart = reporter.getTopMessagePart(); for (org.glassfish.flashlight.datatree.TreeNode tn1 : nodeListToProcess) { if (tn1.hasChildNodes()) { String line = tn1.getCompletePathName(); if (plainReporter != null) cliOutput.append(line).append('\n'); else { ActionReport.MessagePart part = topPart.addChild(); part.setMessage(line); } } } setSuccess(); }
private void copyMessagePart(MessagePart source, MessagePart dest) { if (source == null || dest == null) { return; } dest.setMessage(source.getMessage()); dest.setChildrenType(source.getChildrenType()); Properties props = source.getProps(); if (props != null) { for (Map.Entry<Object, Object> entry : props.entrySet()) { dest.addProperty((String) entry.getKey(), (String) entry.getValue()); } } for (MessagePart chmp : source.getChildren()) { copyMessagePart(chmp, dest.addChild()); } }
MessagePart topMsg = report.getTopMessagePart(); Properties properties = report.getExtraProperties(); if (properties == null) { for (JobInfo info : jobInfoList) { if (first) { topMsg.setMessage(String.format(formattedLine, TITLE_NAME, TITLE_JOBID, TITLE_TIME, TITLE_STATE,TITLE_EXITCODE,TITLE_USER )); first = false; MessagePart msg = topMsg.addChild(); msg.setMessage(String.format(formattedLine, info.jobName, info.jobId, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate), info.state,info.exitCode,info.user)); Map<String, Object> detail = new HashMap<String, Object>(); details.add(detail);
public void execute(AdminCommandContext context) { ActionReport report = context.getActionReport(); report.setActionExitCode(ActionReport.ExitCode.SUCCESS); ActionReport.MessagePart mp = report.getTopMessagePart(); Properties extraProperties = new Properties(); Map<String, Object> entity = new HashMap<String, Object>(); mp.setMessage(Boolean.toString(ucl.serverRequiresRestart())); entity.put("restartRequired", Boolean.toString(ucl.serverRequiresRestart())); List<String> unprocessedChanges = new ArrayList<String>(); for (UnprocessedChangeEvents es : ucl.getUnprocessedChangeEvents()) { for (UnprocessedChangeEvent e : es.getUnprocessed()) { if (why) { mp.addChild().setMessage(e.getReason()); } unprocessedChanges.add(e.getReason()); } } if (!unprocessedChanges.isEmpty()) { entity.put("unprocessedChanges", unprocessedChanges); } extraProperties.put("entity", entity); ((ActionReport) report).setExtraProperties(extraProperties); } }
ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setChildrenType("DottedName"); part.setMessage(prefix + node.getValue() + "=" + node.getKey().attribute("value")); foundMatch = true; String finalDottedName = node.getValue() + "." + name.getKey(); if (matches(finalDottedName, pattern)) { ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setChildrenType("DottedName"); part.setMessage(prefix + node.getValue() + "." + name.getKey() + "=" + name.getValue()); foundMatch = true;
private void processResourceRefs(ActionReport report, List<ResourceRef> resourceRefs) { if (resourceRefs.isEmpty()) { final ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(localStrings.getLocalString( "NothingToList", "Nothing to List.")); } else { for (ResourceRef ref : resourceRefs) { final ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(ref.getRef()); } } } }
private void processResourceRefs(ActionReport report, List<ResourceRef> resourceRefs) { if (resourceRefs.isEmpty()) { final ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(localStrings.getLocalString( "NothingToList", "Nothing to List.")); } else { for (ResourceRef ref : resourceRefs) { final ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(ref.getRef()); } } } }
report.setActionExitCode(ActionReport.ExitCode.SUCCESS); ActionReport.MessagePart top = report.getTopMessagePart(); top.setMessage("List Of Modules"); top.setChildrenType("Module"); ActionReport.MessagePart childPart = top.addChild(); childPart.setMessage(sb.toString());
final ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(destInfo.getDestinationName()); Map<String, String> destMap = new HashMap<String, String>(); destMap.put("name", destInfo.getDestinationName());
@Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); String[] cipherSuites = sslutils.getSupportedCipherSuites(); for (String cipherSuite : cipherSuites) { if (!cipherSuite.contains("_KRB5_")) { ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(cipherSuite); } } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } }
@Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); String[] cipherSuites = sslutils.getSupportedCipherSuites(); for (String cipherSuite : cipherSuites) { if (!cipherSuite.contains("_KRB5_")) { ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(cipherSuite); } } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } }
/** * Executes the command. * * @param context information */ public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); ActionReport.MessagePart msgPart = report.getTopMessagePart(); msgPart.setChildrenType("WARNING"); ActionReport.MessagePart childPart = msgPart.addChild(); String commandName = getClass().getAnnotation(Service.class).name(); childPart.setMessage(localStrings.getLocalString("deploydir.command.deprecated", "{0} command deprecated. Please use {1} command instead.", commandName, "deploy")); super.execute(context); } }
public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); ActionReport.MessagePart part = report.getTopMessagePart(); List<String> targets = null; if (appName == null || appName.equals("*")) { targets = domain.getAllTargets(); } else { targets = domain.getAllReferencedTargetsForApplication(appName); } for (String target : targets) { ActionReport.MessagePart childPart = part.addChild(); childPart.setMessage(target); } } }
public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); ActionReport.MessagePart part = report.getTopMessagePart(); part.setMessage(target); part.setChildrenType("application"); List<ApplicationRef> appRefs = domain.getApplicationRefsInTarget(target); for (ApplicationRef appRef : appRefs) { if (state.equals("all") || (state.equals("running") && Boolean.valueOf(appRef.getEnabled())) || (state.equals("non-running") && !Boolean.valueOf(appRef.getEnabled())) ) { if (isApplicationOfThisType(appRef.getRef(), type)) { ActionReport.MessagePart childPart = part.addChild(); childPart.setMessage(appRef.getRef()); } } } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); }
domain.getResources(), xmlFile, target, resourceFactory); final Iterator resultsIter = results.iterator(); report.getTopMessagePart().setChildrenType("Command"); boolean isSuccess = false; while (resultsIter.hasNext()) { final String msgToAdd = rs.getMessage(); if ((msgToAdd != null) && (!msgToAdd.equals(""))) { final ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(msgToAdd);
public void execute(AdminCommandContext context) { ActionReport report = context.getActionReport(); /* Issue 5918 Used in ManifestManager to keep output sorted */ try { PropsFileActionReporter reporter = (PropsFileActionReporter) report; reporter.useMainChildrenAttribute(true); } catch(ClassCastException e) { // ignore, this is not a manifest output } if (monitor) { listMonitorElements(context); return; } List<Map.Entry> matchingNodesSorted = sortNodesByDottedName(matchingNodes); for (Map.Entry<Dom, String> node : matchingNodesSorted) { ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setChildrenType("DottedName"); if (parentNodes[0].name.isEmpty()) { part.setMessage(node.getValue()); } else { part.setMessage(parentNodes[0].name + "." + node.getValue()); } } }
ActionReport.MessagePart part = report.getTopMessagePart(); int numOfApplications = 0; List<String[]> rowList = new ArrayList<String[]>(); if ( !terse ) { if (rowList.isEmpty()) { part.setMessage(localStrings.getLocalString("list.components.no.elements.to.list", "Nothing to List.")); } else if ( long_opt ) { ActionReport.MessagePart childPart = part.addChild(); childPart.setMessage(String.format(formattedLine, (Object[])headings )); ActionReport.MessagePart childPart = part.addChild(); sb.append(String.format(formattedLine, (Object[])v)); if(resources){ displaySubComponents(v[0], report, childPart); childPart.setMessage(sb.toString());