bundles/org.eclipse.packagedrone.repo.channel.impl/src/org/eclipse/packagedrone/repo/channel/impl/ChannelServiceImpl.java
private ChannelInstance findChannel ( final By by )
    {
        final Optional<ChannelInstance> channel;
        try ( Locked l = lock ( this.readLock ) )
        {
            channel = find ( by );
        }

        if ( !channel.isPresent () )
        {
            throw new ChannelNotFoundException ( by.toString () );
        }

        return channel.get ();
    }
private ChannelInstance findChannel ( final By by )
    {
        final Optional<ChannelInstance> channel;
        try ( Locked l = lock ( this.readLock ) )
        {
            channel = find ( by );
        }

        if ( !channel.isPresent () )
        {
            throw new ChannelNotFoundException ( by.toString () );
        }

        return channel.get ();
    }
Find a channel

@param by
the search criteria
@return the found channel, never returns {@code null}
@throws ChannelNotFoundException
if there was no channel found