public Publication addRecordedPublication(final String channel, final int streamId) {
    """
	Add a {@link Publication} and set it up to be recorded. If this is not the first,
	i.e. {@link Publication#isOriginal()} is true,  then an {@link ArchiveException}
	will be thrown and the recording not initiated.
	<p>
	This is a sessionId specific recording.
	
	@param channel  for the publication.
	@param streamId for the publication.
	@return the {@link Publication} ready for use.
    """
        Publication publication = null;
        lock.lock();
        try
        {
            ensureOpen();

            publication = aeron.addPublication(channel, streamId);
            if (!publication.isOriginal())
            {
                throw new ArchiveException(
                    "publication already added for channel=" + channel + " streamId=" + streamId);
            }

            startRecording(ChannelUri.addSessionId(channel, publication.sessionId()), streamId, SourceLocation.LOCAL);
        }
        catch (final RuntimeException ex)
        {
            CloseHelper.quietClose(publication);
            throw ex;
        }
        finally
        {
            lock.unlock();
        }

        return publication;
    }
public Publication addRecordedPublication(final String channel, final int streamId)
    {
        Publication publication = null;
        lock.lock();
        try
        {
            ensureOpen();

            publication = aeron.addPublication(channel, streamId);
            if (!publication.isOriginal())
            {
                throw new ArchiveException(
                    "publication already added for channel=" + channel + " streamId=" + streamId);
            }

            startRecording(ChannelUri.addSessionId(channel, publication.sessionId()), streamId, SourceLocation.LOCAL);
        }
        catch (final RuntimeException ex)
        {
            CloseHelper.quietClose(publication);
            throw ex;
        }
        finally
        {
            lock.unlock();
        }

        return publication;
    }
public Publication addRecordedPublication ( final String channel , final int streamId ) { Publication publication = null ; lock . lock ( ) ; try { ensureOpen ( ) ; publication = aeron . addPublication ( channel , streamId ) ; if ( ! publication . isOriginal ( ) ) { throw new ArchiveException ( "publication already added for channel=" + channel + " streamId=" + streamId ) ; } startRecording ( ChannelUri . addSessionId ( channel , publication . sessionId ( ) ) , streamId , SourceLocation . LOCAL ) ; } catch ( final RuntimeException ex ) { CloseHelper . quietClose ( publication ) ; throw ex ; } finally { lock . unlock ( ) ; } return publication ; }
Add a {@link Publication} and set it up to be recorded. If this is not the first,
i.e. {@link Publication#isOriginal()} is true,  then an {@link ArchiveException}
will be thrown and the recording not initiated.
<p>
This is a sessionId specific recording.

@param channel  for the publication.
@param streamId for the publication.
@return the {@link Publication} ready for use.
Add a { @link Publication } and set it up to be recorded . If this is not the first i . e . { @link Publication#isOriginal () } is true then an { @link ArchiveException } will be thrown and the recording not initiated . <p > This is a sessionId specific recording .