MessageService.getChannels makes no sense and is dangerous but it is implemented in multiple services. It is only "used" by covers (and nothing in core calls the cover or service method directly).
It actually retrieves every record in the system, not limited by anything, and then processes the XML data. This could potentially take a system down (by using up all memory or processing) if the table was large enough.
I have marked it as deprecated in the MessageService but probably all other services should be marked as well.
- @deprecated since 8 April 2014 (Sakai 10), this is not useful (why would you want all channels in the system) and would perform very badly, use getChannelIds(String context) OR getChannel(String ref) instead
Used in AnnouncementService.java, MailArchiveService.java, and NewsService.java (all covers)
Implemented in DbAnnouncementService.java, DbMailArchiveService.java, and BasicNewsService.java
It should be removed from the MessageService and BaseMessage and the locations above.