}
@Override
public ListGridRecord copyValues(StorageNodeLoadComposite from) {
ListGridRecord record = new ListGridRecord();
StorageNode node = from.getStorageNode();
if (node != null) {
record.setAttribute(FIELD_ID.propertyName(), node.getId());
record.setAttribute(FIELD_ADDRESS.propertyName(), from.getHostname());
record.setAttribute(FIELD_CQL_PORT.propertyName(), node.getCqlPort());
record.setAttribute(FIELD_OPERATION_MODE.propertyName(), node.getOperationMode());
record.setAttribute(FIELD_STATUS.propertyName(), node.getStatus().toString());
record.setAttribute(FIELD_CTIME.propertyName(), node.getCtime());
record.setAttribute(FIELD_ERROR_MESSAGE.propertyName(), node.getErrorMessage());
if (node.getFailedOperation() != null && node.getFailedOperation().getResource() != null) {
ResourceOperationHistory operationHistory = node.getFailedOperation();
String value = LinkManager.getSubsystemResourceOperationHistoryLink(operationHistory.getResource()
.getId(), operationHistory.getId());
record.setAttribute(FIELD_FAILED_OPERATION.propertyName(), value);
}
if (node.getResource() != null) {
record.setAttribute(FIELD_RESOURCE_ID.propertyName(), node.getResource().getId());
record.setAttribute(
FIELD_AVAILABILITY.propertyName(),
ImageManager.getAvailabilityIconFromAvailType(node.getResource().getCurrentAvailability()
.getAvailabilityType()));
} else {
record.setAttribute(FIELD_AVAILABILITY.propertyName(),
ImageManager.getAvailabilityIconFromAvailType(AvailabilityType.UNKNOWN));
}
}
int value = from.getUnackAlerts();
record.setAttribute(
FIELD_ALERTS.propertyName(),
node.getResource() != null ? StorageNodeAdminView.getAlertsString(
MSG.view_adminTopology_storageNodes_unackAlerts(), node.getId(), value) : MSG
.view_adminTopology_storageNodes_unackAlerts() + " (0)");
String memory = null;
if (from.getHeapPercentageUsed() != null && from.getHeapPercentageUsed().getAggregate().getAvg() != null)
memory = MeasurementConverterClient.format(from.getHeapPercentageUsed().getAggregate().getAvg(), from
.getHeapPercentageUsed().getUnits(), true);