use of org.jivesoftware.openfire.user.UserNameProvider in project Openfire by igniterealtime.
the class FastpathPlugin method workgroupManagerStart.
private void workgroupManagerStart() {
workgroupManager = WorkgroupManager.getInstance();
// Register Fastpath service
try {
ComponentManagerFactory.getComponentManager().addComponent("workgroup", workgroupManager);
} catch (ComponentException e) {
// Do nothing. Should never happen.
Log.error(e.getMessage(), e);
}
// Register the provider of workgroup names
UserNameManager.addUserNameProvider(workgroupManager.getAddress().toString(), new UserNameProvider() {
public String getUserName(JID entity) {
try {
Workgroup workgroup = workgroupManager.getWorkgroup(entity);
return workgroup.getDisplayName();
} catch (UserNotFoundException e) {
return entity.toString();
}
}
});
// Start the Fastpath module
workgroupManager.start();
}
Aggregations