class StreamConnection implements Closeable {

  public void transitionConnectionState() {
    this.connectionState.updateAndGet(streamConnectionState -> {
      switch (streamConnectionState) {
        case AVAILABLE: {
          return StreamConnectionState.OPEN;
        }
        case OPEN:
        case CLOSED:
        default: {
          return StreamConnectionState.CLOSED;
        }
      }
    });
  }

  public  StreamConnection(final InterledgerAddress receiverAddress, final SharedSecret sharedSecret);
  public  StreamConnection(final StreamConnectionId streamConnectionId);

}