public static int nextMessageID(){
  int nextID=nextMessageID.getAndIncrement();
  if (nextID == Integer.MAX_VALUE) {
    nextMessageID.set(1);
  }
  return nextID;
}

public static int nextMessageID ( ) { int nextID = nextMessageID . getAndIncrement ( ) ; if ( nextID == Integer . MAX_VALUE ) { nextMessageID . set ( 1 ) ; } return nextID ; }
retrieves a message id that may be used for the next ldap message sent to the directory server .
