code: private void processIdle(Constants.Direction direction) throws Http2Exception {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "processIdle entry: stream " + myID);
          }
          // Can only receive HEADERS or PRIORITY frame in Idle state
          if (direction == Constants.Direction.READ_IN) {
              if (frameType == FrameTypes.HEADERS) {
  
                  // check to see if too many client streams are currently open for this stream's h2 connection
                  muxLink.incrementActiveClientStreams();
                  if (muxLink.getActiveClientStreams() > muxLink.getLocalConnectionSettings().getMaxConcurrentStreams()) {
                      RefusedStreamException rse = new RefusedStreamException("too many client-initiated streams are currently active; rejecting this stream");
                      rse.setConnectionError(false);
                      throw rse;
                  }
  
                  processHeadersPriority();
                  getHeadersFromFrame();
  
                  if (currentFrame.flagEndHeadersSet()) {
                      processCompleteHeaders(false);
                      setHeadersComplete();
                  } else {
                      muxLink.setContinuationExpected(true);
                  }
  
                  if (currentFrame.flagEndStreamSet()) {
                      endStream = true;
                      updateStreamState(StreamState.HALF_CLOSED_REMOTE);
                      if (currentFrame.flagEndHeadersSet()) {
                          setReadyForRead();
                      }
                  } else {
                      updateStreamState(StreamState.OPEN);
                  }
              }
          } else {
              // send out a HEADER frame and update the stream state to OPEN
              if (frameType == FrameTypes.HEADERS) {
                  updateStreamState(StreamState.OPEN);
              }
              writeFrameSync();
          }
      }
docs: Perform operations to transition into IDLE state
  
  @param direction
  @throws CompressionException
  @throws FlowControlException
  @throws ProtocolException