Class RxNpmProxyStorage

java.lang.Object
com.artipie.npm.proxy.RxNpmProxyStorage
All Implemented Interfaces:
NpmProxyStorage

public final class RxNpmProxyStorage extends Object implements NpmProxyStorage
Base NPM Proxy storage implementation. It encapsulates storage format details and allows to handle both primary data and metadata files within one calls. It uses underlying RxStorage and works in Rx-way.
  • Constructor Details

    • RxNpmProxyStorage

      public RxNpmProxyStorage(RxStorage storage)
      Ctor.
      Parameters:
      storage - Underlying storage
  • Method Details

    • save

      public io.reactivex.Completable save(NpmPackage pkg)
      Description copied from interface: NpmProxyStorage
      Persist NPM Package.
      Specified by:
      save in interface NpmProxyStorage
      Parameters:
      pkg - Package to persist
      Returns:
      Completion or error signal
    • save

      public io.reactivex.Completable save(NpmAsset asset)
      Description copied from interface: NpmProxyStorage
      Persist NPM Asset.
      Specified by:
      save in interface NpmProxyStorage
      Parameters:
      asset - Asset to persist
      Returns:
      Completion or error signal
    • getPackage

      public io.reactivex.Maybe<NpmPackage> getPackage(String name)
      Description copied from interface: NpmProxyStorage
      Retrieve NPM package by name.
      Specified by:
      getPackage in interface NpmProxyStorage
      Parameters:
      name - Package name
      Returns:
      NPM package or empty
    • getAsset

      public io.reactivex.Maybe<NpmAsset> getAsset(String path)
      Description copied from interface: NpmProxyStorage
      Retrieve NPM asset by path.
      Specified by:
      getAsset in interface NpmProxyStorage
      Parameters:
      path - Asset path
      Returns:
      NPM asset or empty