protected void toTabularResultData(TabularResultData table, String memberId, String heapSizeBefore, String heapSizeAfter, String timeTaken) { table.accumulate(CliStrings.GC__MSG__MEMBER_NAME, memberId); table.accumulate(CliStrings.GC__MSG__HEAP_SIZE_BEFORE_GC, heapSizeBefore); table.accumulate(CliStrings.GC__MSG__HEAP_SIZE_AFTER_GC, heapSizeAfter); table.accumulate(CliStrings.GC__MSG__TOTAL_TIME_IN_GC, timeTaken); }
private void writeToBackupDisktoreTable(TabularResultData backedupDiskStoreTable, String memberId, String UUID, String host, String directory) { backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_MEMBER, memberId); backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_UUID, UUID); backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_DIRECTORY, directory); backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_HOST, host); }
protected void toTabularResultData(TabularResultData table, String memberId, String heapSizeBefore, String heapSizeAfter, String timeTaken) { table.accumulate(CliStrings.GC__MSG__MEMBER_NAME, memberId); table.accumulate(CliStrings.GC__MSG__HEAP_SIZE_BEFORE_GC, heapSizeBefore); table.accumulate(CliStrings.GC__MSG__HEAP_SIZE_AFTER_GC, heapSizeAfter); table.accumulate(CliStrings.GC__MSG__TOTAL_TIME_IN_GC, timeTaken); }
private void accumulateStartResult(TabularResultData resultData, String member, String Status, String message) { resultData.accumulate("Member", member); resultData.accumulate("Result", Status); resultData.accumulate("Message", message); }
private void writeToBackupDisktoreTable(TabularResultData backedupDiskStoreTable, String memberId, String UUID, String host, String directory) { backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_MEMBER, memberId); backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_UUID, UUID); backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_DIRECTORY, directory); backedupDiskStoreTable.accumulate(CliStrings.BACKUP_DISK_STORE_MSG_HOST, host); }
private void accumulateStartResult(TabularResultData resultData, String member, String Status, String message) { if (member != null) { resultData.accumulate("Member", member); } resultData.accumulate("Result", Status); resultData.accumulate("Message", message); }
protected void toTabularResultData(TabularResultData table, String memberId, String memberResult) { String newLine = System.getProperty("line.separator"); table.accumulate("Member ID/Name", memberId); table.accumulate("Function Execution Result", memberResult); }
protected void toTabularResultData(TabularResultData table, String memberId, String memberResult) { String newLine = System.getProperty("line.separator"); table.accumulate("Member ID/Name", memberId); table.accumulate("Function Execution Result", memberResult); }
private void writeCommonAttributeToTable(TabularResultData table, String attributeType, String attributeName, String attributeValue) { final String blank = ""; if (attributeValue != null) { String[] attributeValues = attributeValue.split(","); boolean isFirstValue = true; for (String value : attributeValues) { if (isFirstValue) { isFirstValue = false; table.accumulate(CliStrings.DESCRIBE_REGION__ATTRIBUTE__TYPE, attributeType); table.accumulate(CliStrings.DESCRIBE_REGION__ATTRIBUTE__NAME, attributeName); table.accumulate(CliStrings.DESCRIBE_REGION__ATTRIBUTE__VALUE, value); } else { table.accumulate(CliStrings.DESCRIBE_REGION__ATTRIBUTE__TYPE, blank); table.accumulate(CliStrings.DESCRIBE_REGION__ATTRIBUTE__NAME, blank); table.accumulate(CliStrings.DESCRIBE_REGION__ATTRIBUTE__VALUE, value); } } } }
private TabularResultData buildReceiverStatus(String memberId, GatewayReceiverMXBean bean, TabularResultData resultData) { resultData.accumulate(CliStrings.RESULT_HOST_MEMBER, memberId); if (bean != null) { resultData.accumulate(CliStrings.RESULT_PORT, bean.getPort()); resultData.accumulate(CliStrings.RESULT_STATUS, bean.isRunning() ? CliStrings.GATEWAY_RUNNING : CliStrings.GATEWAY_NOT_RUNNING); } else { resultData.accumulate(CliStrings.GATEWAY_ERROR, CliStrings.GATEWAY_RECEIVER_IS_NOT_AVAILABLE_OR_STOPPED); } return resultData; }
private TabularResultData buildReceiverStatus(String memberId, GatewayReceiverMXBean bean, TabularResultData resultData) { resultData.accumulate(CliStrings.RESULT_HOST_MEMBER, memberId); if (bean != null) { resultData.accumulate(CliStrings.RESULT_PORT, bean.getPort()); resultData.accumulate(CliStrings.RESULT_STATUS, bean.isRunning() ? CliStrings.GATEWAY_RUNNING : CliStrings.GATEWAY_NOT_RUNNING); } else { resultData.accumulate(CliStrings.GATEWAY_ERROR, CliStrings.GATEWAY_RECEIVER_IS_NOT_AVAILABLE_OR_STOPPED); } return resultData; }
TabularResultData buildResultForEcho(Set< Entry<String, String> > propertyMap){ TabularResultData resultData = ResultBuilder.createTabularResultData(); Iterator <Entry<String, String>> it = propertyMap.iterator(); while(it.hasNext()){ Entry<String, String> setEntry = it.next(); resultData.accumulate("Property", setEntry.getKey()); resultData.accumulate("Value", String.valueOf(setEntry.getValue())); } return resultData; }
TabularResultData buildResultForEcho(Set< Entry<String, String> > propertyMap){ TabularResultData resultData = ResultBuilder.createTabularResultData(); Iterator <Entry<String, String>> it = propertyMap.iterator(); while(it.hasNext()){ Entry<String, String> setEntry = it.next(); resultData.accumulate("Property", setEntry.getKey()); resultData.accumulate("Value", String.valueOf(setEntry.getValue())); } return resultData; }
/*** Writes an entry to a TabularResultData and writes a comma separated entry to a string builder * @param metricsTable * @param type * @param metricName * @param metricValue * @param csvBuilder */ private void writeToTableAndCsv(TabularResultData metricsTable, String type, String metricName, long metricValue, StringBuilder csvBuilder) { metricsTable.accumulate(CliStrings.SHOW_METRICS__TYPE__HEADER, type); metricsTable.accumulate(CliStrings.SHOW_METRICS__METRIC__HEADER, metricName); metricsTable.accumulate(CliStrings.SHOW_METRICS__VALUE__HEADER, metricValue); if (csvBuilder != null) { csvBuilder.append(type); csvBuilder.append(','); csvBuilder.append(metricName); csvBuilder.append(','); csvBuilder.append(metricValue); csvBuilder.append('\n'); } }
/*** Writes an entry to a TabularResultData and writes a comma separated entry to a string builder * @param metricsTable * @param type * @param metricName * @param metricValue * @param csvBuilder */ private void writeToTableAndCsv(TabularResultData metricsTable, String type, String metricName, long metricValue, StringBuilder csvBuilder) { metricsTable.accumulate(CliStrings.SHOW_METRICS__TYPE__HEADER, type); metricsTable.accumulate(CliStrings.SHOW_METRICS__METRIC__HEADER, metricName); metricsTable.accumulate(CliStrings.SHOW_METRICS__VALUE__HEADER, metricValue); if (csvBuilder != null) { csvBuilder.append(type); csvBuilder.append(','); csvBuilder.append(metricName); csvBuilder.append(','); csvBuilder.append(metricValue); csvBuilder.append('\n'); } }
private static void createPageTableAndBanner(SectionResultData page, String[] header, Object[][] table) { TabularResultData resultData = page.addTable(); int columns = header.length; for (int i = 0; i < table.length; i++) { int rowLength = table[i].length; if (rowLength != columns) throw new RuntimeException("Row contains more than " + columns + " : " + rowLength); } for (int i = 0; i < table.length; i++) { for (int j = 0; j < columns; j++) { resultData.accumulate(header[j], table[i][j]); } } }
private static void createPageTableAndBanner(SectionResultData page, String[] header, Object[][] table) { TabularResultData resultData = page.addTable(); int columns = header.length; for (int i = 0; i < table.length; i++) { int rowLength = table[i].length; if (rowLength != columns) throw new RuntimeException("Row contains more than " + columns + " : " + rowLength); } for (int i = 0; i < table.length; i++) { for (int j = 0; j < columns; j++) { resultData.accumulate(header[j], table[i][j]); } } }
protected Result toTabularResult(final List<DiskStoreDetails> diskStoreList) throws ResultDataException { if (!diskStoreList.isEmpty()) { final TabularResultData diskStoreData = ResultBuilder.createTabularResultData(); for (final DiskStoreDetails diskStoreDetails : diskStoreList) { diskStoreData.accumulate("Member Name", diskStoreDetails.getMemberName()); diskStoreData.accumulate("Member Id", diskStoreDetails.getMemberId()); diskStoreData.accumulate("Disk Store Name", diskStoreDetails.getName()); diskStoreData.accumulate("Disk Store ID", diskStoreDetails.getId()); } return ResultBuilder.buildResult(diskStoreData); } else { return ResultBuilder.createInfoResult(CliStrings.LIST_DISK_STORE__DISK_STORES_NOT_FOUND_MESSAGE); } }
protected Result toTabularResult(final List<DiskStoreDetails> diskStoreList) throws ResultDataException { if (!diskStoreList.isEmpty()) { final TabularResultData diskStoreData = ResultBuilder.createTabularResultData(); for (final DiskStoreDetails diskStoreDetails : diskStoreList) { diskStoreData.accumulate("Member Name", diskStoreDetails.getMemberName()); diskStoreData.accumulate("Member Id", diskStoreDetails.getMemberId()); diskStoreData.accumulate("Disk Store Name", diskStoreDetails.getName()); diskStoreData.accumulate("Disk Store ID", diskStoreDetails.getId()); } return ResultBuilder.buildResult(diskStoreData); } else { return ResultBuilder.createInfoResult(CliStrings.LIST_DISK_STORE__DISK_STORES_NOT_FOUND_MESSAGE); } }
private TabularResultData getSharedConfigurationStatus(Set<DistributedMember> locators) { boolean isSharedConfigRunning = false; ResultCollector<?,?> rc = CliUtil.executeFunction(fetchSharedConfigStatusFunction, null, locators); List<CliFunctionResult> results = (List<CliFunctionResult>)rc.getResult(); TabularResultData table = ResultBuilder.createTabularResultData(); table.setHeader("Status of shared configuration on locators"); for (CliFunctionResult result : results) { table.accumulate(CliStrings.STATUS_SHARED_CONFIG_NAME_HEADER, result.getMemberIdOrName()); String status = (String) result.getSerializables()[0]; table.accumulate(CliStrings.STATUS_SHARED_CONFIG_STATUS, status); if (SharedConfigurationStatus.RUNNING.name().equals(status)) { isSharedConfigRunning = true; } } if (!isSharedConfigRunning) { table.setStatus(Status.ERROR); } return table; }