class MessageIdExtractor {

  public long getUniqueIdFromMessage(Message requestMessage, Encryptor handshake, long connectionId)
      throws AuthenticationRequiredException {
    AuthIds aIds = getAuthIdsFromMessage(requestMessage, handshake);
    if (connectionId != aIds.getConnectionId()) {
      throw new AuthenticationRequiredException(
          "No security credentials are provided");
    }
    return aIds.getUniqueId();
  }

}