class LocalDhisResourceRepositoryTemplate {

    public boolean isLocal( @Nonnull String id )
    {
        final RequestCacheContext context = requestCacheService.getCurrentRequestCacheContext();
        final Optional<LocalDhisResourceRepository<T>> repository = getRepository( context );

        return repository.map( r -> r.findOneById( id ).map( DhisResource::isLocal ).orElse( false ) ).orElse( false );

    }

    public  LocalDhisResourceRepositoryTemplate( @Nonnull Class<T> resourceClass, @Nonnull RequestCacheService requestCacheService,
        @Nonnull LocalDhisRepositoryPersistCallback<T> persistCallback );

}