public void markErrorLogin(String clientIP){
  if (isDisabled()) {
    return;
  }
  if (null != clientIP && !clientIP.isEmpty()) {
    String zkPath=getZkPath(clientIP);
    InterProcessLock lock=null;
    try {
      lock=_coordinator.getLock(INVALID_LOGIN_CLEANER_LOCK);
      lock.acquire();
      _log.debug("Got a lock for updating the ZK");
      InvalidLogins invLogins=(InvalidLogins)_distDataManager.getData(zkPath,false);
      if (null == invLogins) {
        _distDataManager.createNode(zkPath,false);
        invLogins=new InvalidLogins(clientIP,getCurrentTimeInMins(),1);
        _log.debug("Creating new record in the ZK for the client {}",clientIP);
      }
 else {
        invLogins.incrementErrorLoginCount();
      }
      invLogins.setLastAccessTimeInLong(getCurrentTimeInMins());
      _log.debug("Updating the record in the ZK for the client {}",clientIP);
      _distDataManager.putData(zkPath,invLogins);
    }
 catch (    Exception ex) {
      _log.error("Exception for the clientIP {} ",clientIP,ex);
    }
 finally {
      if (lock != null) {
        try {
          lock.release();
        }
 catch (        Exception ex) {
          _log.error("Unexpected exception unlocking the lock for updating the ZK",ex);
        }
      }
    }
  }
 else {
    _log.error("The provided clientIP is null or empty ");
  }
  return;
}

public void markErrorLogin ( String clientIP ) { if ( isDisabled ( ) ) { return ; } if ( null != clientIP && ! clientIP . isEmpty ( ) ) { String zkPath = getZkPath ( clientIP ) ; InterProcessLock lock = null ; try { lock = _coordinator . getLock ( INVALID_LOGIN_CLEANER_LOCK ) ; lock . acquire ( ) ; _log . debug ( "Got a lock for updating the ZK" ) ; InvalidLogins invLogins = ( InvalidLogins ) _distDataManager . getData ( zkPath , false ) ; if ( null == invLogins ) { _distDataManager . createNode ( zkPath , false ) ; invLogins = new InvalidLogins ( clientIP , getCurrentTimeInMins ( ) , 1 ) ; _log . debug ( "Creating new record in the ZK for the client {}" , clientIP ) ; } else { invLogins . incrementErrorLoginCount ( ) ; } invLogins . setLastAccessTimeInLong ( getCurrentTimeInMins ( ) ) ; _log . debug ( "Updating the record in the ZK for the client {}" , clientIP ) ; _distDataManager . putData ( zkPath , invLogins ) ; } catch ( Exception ex ) { _log . error ( "Exception for the clientIP {} " , clientIP , ex ) ; } finally { if ( lock != null ) { try { lock . release ( ) ; } catch ( Exception ex ) { _log . error ( "Unexpected exception unlocking the lock for updating the ZK" , ex ) ; } } } } else { _log . error ( "The provided clientIP is null or empty " ) ; } return ; }
the client failed to login . if an invalid login record exists for that client , increment the error count of that record . if that record does nor exists , create new entry .
