return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, AddressControlHandler.GET_ROLES_AS_JSON,
CommonAttributes.CORE_ADDRESS, ModelType.STRING, true);
}
private void handleReadAttribute(OperationContext context, ModelNode operation) {
final AddressControl addressControl = getAddressControl(context, operation);
final String name = operation.require(ModelDescriptionConstants.NAME).asString();
try {
if (ROLES_ATTR_NAME.equals(name)) {
String json = addressControl.getRolesAsJSON();
final ModelNode camelCase = ModelNode.fromJSONString(json);
final ModelNode converted = CamelCaseUtil.convertSecurityRole(camelCase);
context.getResult().set(converted);
} else if (QUEUE_NAMES.equals(name)) {
String[] queues = addressControl.getQueueNames();
final ModelNode result = context.getResult();
result.setEmptyList();
for (String queue : queues) {
result.add(queue);
}
} else if (NUMBER_OF_BYTES_PER_PAGE.equals(name)) {
long l = addressControl.getNumberOfBytesPerPage();
context.getResult().set(l);
} else if (NUMBER_OF_PAGES.equals(name)) {
int i = addressControl.getNumberOfPages();
context.getResult().set(i);
} else if (BINDING_NAMES.equals(name)) {
String[] bindings = addressControl.getBindingNames();
final ModelNode result = context.getResult();
result.setEmptyList();
for (String binding : bindings) {
result.add(binding);
}