boolean isAccountValid(AMIdentity amIdentity){
  boolean userEnabled=true;
  try {
    String userActive=amIdentity.isActive() ? USER_ACTIVE : USER_INACTIVE;
    Map<String,Set<String>> attrs=amIdentity.getAttributes(asSet(LOGIN_STATUS_ATTR,NSACCOUNTLOCK_ATTR));
    String loginStatus=CollectionHelper.getMapAttr(attrs,LOGIN_STATUS_ATTR);
    if (loginStatus == null || loginStatus.isEmpty()) {
      loginStatus=USER_ACTIVE;
    }
    String nsAccountVal=CollectionHelper.getMapAttr(attrs,NSACCOUNTLOCK_ATTR);
    if (nsAccountVal == null || nsAccountVal.isEmpty()) {
      nsAccountVal=FALSE_VALUE;
    }
    if (DEBUG.messageEnabled()) {
      DEBUG.message("inetuserstatus : " + userActive);
      DEBUG.message("loginStatus : " + loginStatus);
      DEBUG.message("nsAccountLockVal : " + nsAccountVal);
    }
    userEnabled=userActive.equalsIgnoreCase(USER_ACTIVE) && loginStatus.equalsIgnoreCase(USER_ACTIVE) && nsAccountVal.equalsIgnoreCase(FALSE_VALUE);
  }
 catch (  Exception e) {
    if (DEBUG.messageEnabled()) {
      DEBUG.message("isAccountValid:Error :" + e.toString());
    }
  }
  if (DEBUG.messageEnabled()) {
    DEBUG.message("User enabled..." + userEnabled);
  }
  return userEnabled;
}

boolean isAccountValid ( AMIdentity amIdentity ) { boolean userEnabled = true ; try { String userActive = amIdentity . isActive ( ) ? USER_ACTIVE : USER_INACTIVE ; Map < String , Set < String > > attrs = amIdentity . getAttributes ( asSet ( LOGIN_STATUS_ATTR , NSACCOUNTLOCK_ATTR ) ) ; String loginStatus = CollectionHelper . getMapAttr ( attrs , LOGIN_STATUS_ATTR ) ; if ( loginStatus == null || loginStatus . isEmpty ( ) ) { loginStatus = USER_ACTIVE ; } String nsAccountVal = CollectionHelper . getMapAttr ( attrs , NSACCOUNTLOCK_ATTR ) ; if ( nsAccountVal == null || nsAccountVal . isEmpty ( ) ) { nsAccountVal = FALSE_VALUE ; } if ( DEBUG . messageEnabled ( ) ) { DEBUG . message ( "inetuserstatus : " + userActive ) ; DEBUG . message ( "loginStatus : " + loginStatus ) ; DEBUG . message ( "nsAccountLockVal : " + nsAccountVal ) ; } userEnabled = userActive . equalsIgnoreCase ( USER_ACTIVE ) && loginStatus . equalsIgnoreCase ( USER_ACTIVE ) && nsAccountVal . equalsIgnoreCase ( FALSE_VALUE ) ; } catch ( Exception e ) { if ( DEBUG . messageEnabled ( ) ) { DEBUG . message ( "isAccountValid:Error :" + e . toString ( ) ) ; } } if ( DEBUG . messageEnabled ( ) ) { DEBUG . message ( "User enabled..." + userEnabled ) ; } return userEnabled ; }
checks if the account is active .
