Пример #1
0
  /*
   * (non-Javadoc)
   *
   * @see deus.core.soul.accountadmin.registrator.RegistratorExportedToClient#
   * unregister(java.lang.String)
   */
  @Override
  public void unregister(final String localUsername) {
    final Account account = this.accountDao.getByNaturalId(localUsername);

    this.destroyAccount(account);

    this.notifyObservers(account.getUserId(), false);
  }
Пример #2
0
  /**
   * Creates the account.
   *
   * @param account the account
   */
  private void createAccount(final Account account) {
    this.accountDao.addNewEntity(account);
    // FUTURE: init data objects in database for subsystem Barker here!

    // INITIALIZING ROLE DATA ELEMENTS
    for (final DistributionRole distributionRole : account.getUserRoles()) {
      this.distributionRoleSetup.setUpRole(distributionRole, account.getUserId());
    }
  }
Пример #3
0
  /**
   * Destroy account.
   *
   * @param account the account
   */
  private void destroyAccount(final Account account) {
    final UserId userId = account.getUserId();

    this.accountDao.deleteByNaturalId(account.getLocalUsername());
    // FUTURE: destroy data objects in database for subsystem Barker here!

    // DESTROYING ROLE DATA ELEMENTS
    for (final DistributionRole distributionRole : account.getUserRoles()) {
      this.distributionRoleSetup.tearDownRole(distributionRole, userId);
    }
  }