class DvrApiImpl extends BaseApi implements DvrApi {

    @Override
    public Observable<List<TitleInfoEntity>> titleInfoEntityList() {

        return Observable.create( new Observable.OnSubscribe<List<TitleInfoEntity>>() {

            @Override
            public void call( Subscriber<? super List<TitleInfoEntity>> subscriber ) {
                Log.d(TAG, "titleInfoEntityList.call : enter");

                if( isThereInternetConnection() ) {
                    Log.d( TAG, "titleInfoEntityList.call : network is connected" );

                    try {

                        String responseRecordedProgramEntities = getTitleInfoEntitiesFromApi();
                        if( null == responseRecordedProgramEntities ) {
                            Log.d( TAG, "titleInfoEntityList.call : failed to retrieve title info entities" );

                            subscriber.onError( new NetworkConnectionException() );

                        } else {
                            Log.d( TAG, "titleInfoEntityList.call : retrieved title info entities" );

                            subscriber.onNext( titleInfoEntityJsonMapper.transformTitleInfoEntityCollection( responseRecordedProgramEntities ) );
                            subscriber.onCompleted();

                        }

                    } catch( Exception e ) {
                        Log.e( TAG, "titleInfoEntityList.call : error", e );

                        subscriber.onError( new NetworkConnectionException( e.getCause() ) );

                    }

                } else {
                    Log.d( TAG, "titleInfoEntityList.call : network is not connected" );

                    subscriber.onError( new NetworkConnectionException() );

                }

                Log.d( TAG, "titleInfoEntityList.call : exit" );
            }

        });

    }

    public  DvrApiImpl( final Context context, final SharedPreferences sharedPreferences, final OkHttpClient okHttpClient, final TitleInfoEntityJsonMapper titleInfoEntityJsonMapper, final ProgramEntityJsonMapper programEntityJsonMapper, final EncoderEntityJsonMapper encoderEntityJsonMapper, final BooleanJsonMapper booleanJsonMapper, final LongJsonMapper longJsonMapper );

}