public void incrementGeneratedTokens(String tenant){
  logger.trace("Incrementing generated tokens for tenant: " + tenant);
  try {
    AtomicInteger count;
synchronized (this) {
      if ((count=generatedTokensMap.get(tenant)) == null) {
        generatedTokensMap.put(tenant,new AtomicInteger(1));
      }
 else {
        count.incrementAndGet();
      }
    }
    logger.trace("Tokens generated for tenant: {} is- {} ",tenant,generatedTokensMap.get(tenant));
    incrementTotalGenerated();
  }
 catch (  Exception e) {
    logger.error("Unable to increment generated tokens",e);
  }
}

public void incrementGeneratedTokens ( String tenant ) { logger . trace ( "Incrementing generated tokens for tenant: " + tenant ) ; try { AtomicInteger count ; synchronized ( this ) { if ( ( count = generatedTokensMap . get ( tenant ) ) == null ) { generatedTokensMap . put ( tenant , new AtomicInteger ( 1 ) ) ; } else { count . incrementAndGet ( ) ; } } logger . trace ( "Tokens generated for tenant: {} is- {} " , tenant , generatedTokensMap . get ( tenant ) ) ; incrementTotalGenerated ( ) ; } catch ( Exception e ) { logger . error ( "Unable to increment generated tokens" , e ) ; } }
this method will increment the tokens generated for a given tenant when new token is generated from idm and sts
