예제 #1
0
  /**
   * This method checks if the ticket is given to the same IP address as the client
   *
   * @param stream the stream
   * @param streamingTicket the ticket
   * @return true if the ip is the same for the ticket and the user
   */
  private boolean isClientAllowed(IMediaStream stream, Ticket streamingTicket) {
    String ipOfClient = stream.getClient().getIp();

    boolean isAllowed = (ipOfClient != null) && (ipOfClient.equals(streamingTicket.getIpAddress()));
    logger.debug(
        "isClientAllowed - ipOfClient: "
            + ipOfClient
            + ", streamingTicket.getIpAddress(): "
            + streamingTicket.getIpAddress()
            + ", isAllowed: "
            + isAllowed);
    return isAllowed;
  }