ReadResourceModel readResourceModel = new ReadResourceModel("Available operations and children (sub-resources).", children);
// Set children descriptions
for (String child : children)
{
ManagedDescription desc = resource.getResourceDescription(address.append(child));
readResourceModel.setChildDescription(child, desc.getDescription());
}
// Set operation descriptions
Map<String, ManagedDescription> descriptions = resource.getOperationDescriptions(address);
for (Map.Entry<String, ManagedDescription> desc : descriptions.entrySet())
{
readResourceModel.addOperation(new NamedDescription(desc.getKey(), desc.getValue().getDescription()));
}
return readResourceModel;
}