public void setNextAVTransportURI(
      UnsignedIntegerFourBytes instanceId, String nextURI, String nextURIMetaData)
      throws AVTransportException {

    URI uri;
    try {
      uri = new URI(nextURI);
    } catch (Exception ex) {
      throw new AVTransportException(
          ErrorCode.INVALID_ARGS, "NextURI can not be null or malformed");
    }

    try {
      AVTransportStateMachine transportStateMachine = findStateMachine(instanceId, true);
      transportStateMachine.setNextTransportURI(uri, nextURIMetaData);
    } catch (TransitionException ex) {
      throw new AVTransportException(
          AVTransportErrorCode.TRANSITION_NOT_AVAILABLE, ex.getMessage());
    }
  }