コード例 #1
0
 @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);
         }
       });
 }
コード例 #2
0
    @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);
              }
            }
          });
    }
コード例 #3
0
 private void synchronizeWithJabberIfPossible(UserEvent event) {
   if (event.getUser().getTransportCode().equals(getName())
       && myFacade.isConnectedAndAuthenticated()) {
     myDispatcher.sendNow(self(), new JabberSyncUserMessage(event));
   }
 }