use of org.eclipse.ecf.presence.search.UserSearchCompleteEvent in project ecf by eclipse.
the class XMPPUserSearchManager method search.
/**
* Specific implementation for XMPP
*
* @see IUserSearchManager#search(ICriteria, IUserSearchListener)
*/
public void search(final ICriteria criteria, final IUserSearchListener listener) {
Assert.isNotNull(criteria);
Assert.isNotNull(listener);
Job job = new Job(Messages.XMPPUserSearchManager_JOB) {
protected IStatus run(IProgressMonitor monitor) {
try {
ISearch search = search(criteria);
UserSearchCompleteEvent complete = new UserSearchCompleteEvent(search);
listener.handleUserSearchEvent(complete);
} catch (UserSearchException e) {
log(e.getLocalizedMessage(), e);
return new Status(IStatus.ERROR, XmppPlugin.PLUGIN_ID, IStatus.ERROR, "Exception in user search", e);
}
return Status.OK_STATUS;
}
};
job.schedule();
}
Aggregations