@Override protected void processBeforeChange(UserEvent event) { super.processBeforeChange(event); event.accept( new EventVisitor() { @Override public void visitUserAdded(UserEvent.Added event) { event.getUser().setCanAccessMyFiles(false, myUserModel); } }); }
@Override protected void processAfterChange(UserEvent event) { if (myIgnoreUserEvents) return; event.accept( new EventVisitor() { @Override public void visitUserRemoved(UserEvent.Removed event) { synchronizeWithJabberIfPossible(event); } @Override public void visitUserUpdated(UserEvent.Updated event) { if (GROUP.equals(event.getPropertyName()) || DISPLAY_NAME.equals(event.getPropertyName())) { synchronizeWithJabberIfPossible(event); } } }); }
private void synchronizeWithJabberIfPossible(UserEvent event) { if (event.getUser().getTransportCode().equals(getName()) && myFacade.isConnectedAndAuthenticated()) { myDispatcher.sendNow(self(), new JabberSyncUserMessage(event)); } }