use of org.apache.activemq.artemis.core.management.impl.view.AddressView in project activemq-artemis by apache.
the class ActiveMQServerControlImpl method listAddresses.
@Override
public String listAddresses(String options, int page, int pageSize) throws Exception {
checkStarted();
clearIO();
try {
final Set<SimpleString> addresses = server.getPostOffice().getAddresses();
List<AddressInfo> addressInfo = new ArrayList<>();
for (SimpleString address : addresses) {
AddressInfo info = server.getPostOffice().getAddressInfo(address);
// ignore if no longer available
if (info != null) {
addressInfo.add(info);
}
}
AddressView view = new AddressView(server);
view.setCollection(addressInfo);
view.setOptions(options);
return view.getResultsAsJson(page, pageSize);
} finally {
blockOnIO();
}
}
Aggregations