/**
   * Updates the user account information. After sucessful operation, the federation status
   * corresponding to the user with the remote provider is set to inactive.
   *
   * @param ni <code>NameIdentifier</code> object corresponding to a user
   * @return boolean containing the status of the update operation
   */
  protected boolean updateAccountInformation(NameIdentifier ni) {
    try {
      FSUtils.debug.message("FSFedTerminationHandler::updateAccountInformation: start");
      String searchDomain = remoteEntityId;
      // get name identifier to remove it from federation info key
      String nameId = null;
      String nameQualifier = null;
      if (ni != null) {
        nameQualifier = ni.getNameQualifier();
        if (nameQualifier != null
            && (nameQualifier.length() != 0)
            && !nameQualifier.equals(remoteEntityId)) {
          searchDomain = nameQualifier;
        }
        nameId = ni.getName();
      }
      if (nameId == null && acctInfo != null) {
        FSUtils.debug.message("FSAccountManager: getnameId in accInfo");
        NameIdentifier temp = acctInfo.getLocalNameIdentifier();
        if (temp != null) {
          nameId = temp.getName();
          nameQualifier = temp.getNameQualifier();
        } else {
          temp = acctInfo.getRemoteNameIdentifier();
          if (temp != null) {
            nameId = temp.getName();
            nameQualifier = temp.getNameQualifier();
          }
        }
      }
      FSAccountFedInfoKey fedInfoKey = new FSAccountFedInfoKey(nameQualifier, nameId);
      managerInst.removeAccountFedInfo(userID, fedInfoKey, searchDomain);

      if (FSUtils.debug.messageEnabled()) {
        FSUtils.debug.message(
            "FSFedTerminationHandler:: "
                + "updateAccountInformation deactivate successfully completed");
      }
    } catch (FSAccountMgmtException e) {
      FSUtils.debug.error(
          "FSFedTerminationHandler::updateAccountInformation "
              + FSUtils.bundle.getString(IFSConstants.TERMINATION_LOCAL_FAILED));
      String[] data = {userID};
      LogUtil.error(Level.INFO, LogUtil.TERMINATION_FAILED, data, ssoToken);
      return false;
    }
    // Clean SessionMap off the partner to be done here.
    if (FSUtils.debug.messageEnabled()) {
      FSUtils.debug.message("Cleaning Session manager for user : "******"Cleaning Session manager for remote provider: " + remoteEntityId);
      FSUtils.debug.message("Cleaning Session manager for hosted provider: " + hostedEntityId);
    }
    FSLogoutUtil.cleanSessionMapPartnerList(userID, remoteEntityId, metaAlias, null);
    return true;
  }
 /**
  * Generates Federation termination request based onthe <code>FSAccountFedInfo</code> object that
  * represents the account federation for a user between 2 providers.
  *
  * @param acctInfo represents the current user account information
  * @return termination request message
  */
 private FSFederationTerminationNotification createFederationTerminationRequest(
     FSAccountFedInfo acctInfo) {
   FSUtils.debug.message("FSFedTerminationHandler::createFederationTerminationRequest:");
   FSFederationTerminationNotification reqName = new FSFederationTerminationNotification();
   if (reqName != null) {
     NameIdentifier nameIdentifier = acctInfo.getRemoteNameIdentifier();
     if (nameIdentifier == null) {
       nameIdentifier = acctInfo.getLocalNameIdentifier();
     }
     if (FSUtils.debug.messageEnabled()) {
       FSUtils.debug.message("SP Provider Id : " + hostedEntityId);
     }
     reqName.setProviderId(hostedEntityId);
     reqName.setNameIdentifier(nameIdentifier);
     // TODO: Any more member settings + signature
     return reqName;
   } else {
     FSUtils.debug.message("failed to create termination request");
     FSUtils.debug.error(
         "FSFedTerminationHandler::createFederationTerminationRequest "
             + FSUtils.bundle.getString(IFSConstants.TERMINATION_REQUEST_CREATION));
     return null;
   }
 }