Class MeasuredPathDB

  • All Implemented Interfaces:
    org.commonjava.storage.pathmapped.spi.PathDB

    public class MeasuredPathDB
    extends Object
    implements org.commonjava.storage.pathmapped.spi.PathDB
    • Constructor Detail

      • MeasuredPathDB

        public MeasuredPathDB​(org.commonjava.storage.pathmapped.spi.PathDB decorated,
                              org.commonjava.o11yphant.metrics.MetricsManager metricsManager,
                              String metricPrefix)
    • Method Detail

      • list

        public List<org.commonjava.storage.pathmapped.model.PathMap> list​(String fileSystem,
                                                                          String path,
                                                                          org.commonjava.storage.pathmapped.spi.PathDB.FileType fileType)
        Specified by:
        list in interface org.commonjava.storage.pathmapped.spi.PathDB
      • list

        public List<org.commonjava.storage.pathmapped.model.PathMap> list​(String fileSystem,
                                                                          String path,
                                                                          boolean recursive,
                                                                          int limit,
                                                                          org.commonjava.storage.pathmapped.spi.PathDB.FileType fileType)
        Specified by:
        list in interface org.commonjava.storage.pathmapped.spi.PathDB
      • getPathMap

        public org.commonjava.storage.pathmapped.model.PathMap getPathMap​(String fileSystem,
                                                                          String path)
        Specified by:
        getPathMap in interface org.commonjava.storage.pathmapped.spi.PathDB
      • getFileLength

        public long getFileLength​(String fileSystem,
                                  String path)
        Specified by:
        getFileLength in interface org.commonjava.storage.pathmapped.spi.PathDB
      • getFileLastModified

        public long getFileLastModified​(String fileSystem,
                                        String path)
        Specified by:
        getFileLastModified in interface org.commonjava.storage.pathmapped.spi.PathDB
      • exists

        public org.commonjava.storage.pathmapped.spi.PathDB.FileType exists​(String fileSystem,
                                                                            String path)
        Specified by:
        exists in interface org.commonjava.storage.pathmapped.spi.PathDB
      • existsFile

        public boolean existsFile​(String fileSystem,
                                  String path)
        Specified by:
        existsFile in interface org.commonjava.storage.pathmapped.spi.PathDB
      • insert

        public void insert​(String fileSystem,
                           String path,
                           Date creation,
                           Date expiration,
                           String fileId,
                           long size,
                           String fileStorage,
                           String checksum)
        Specified by:
        insert in interface org.commonjava.storage.pathmapped.spi.PathDB
      • isDirectory

        public boolean isDirectory​(String fileSystem,
                                   String path)
        Specified by:
        isDirectory in interface org.commonjava.storage.pathmapped.spi.PathDB
      • isFile

        public boolean isFile​(String fileSystem,
                              String path)
        Specified by:
        isFile in interface org.commonjava.storage.pathmapped.spi.PathDB
      • delete

        public boolean delete​(String fileSystem,
                              String path)
        Specified by:
        delete in interface org.commonjava.storage.pathmapped.spi.PathDB
      • getFileSystemContaining

        public Set<String> getFileSystemContaining​(Collection<String> candidates,
                                                   String path)
        Specified by:
        getFileSystemContaining in interface org.commonjava.storage.pathmapped.spi.PathDB
      • getFirstFileSystemContaining

        public String getFirstFileSystemContaining​(List<String> candidates,
                                                   String path)
        Specified by:
        getFirstFileSystemContaining in interface org.commonjava.storage.pathmapped.spi.PathDB
      • traverse

        public void traverse​(String fileSystem,
                             String path,
                             java.util.function.Consumer<org.commonjava.storage.pathmapped.model.PathMap> consumer,
                             int limit,
                             org.commonjava.storage.pathmapped.spi.PathDB.FileType fileType)
        Specified by:
        traverse in interface org.commonjava.storage.pathmapped.spi.PathDB
      • getStorageFile

        public String getStorageFile​(String fileSystem,
                                     String path)
        Specified by:
        getStorageFile in interface org.commonjava.storage.pathmapped.spi.PathDB
      • copy

        public boolean copy​(String fromFileSystem,
                            String fromPath,
                            String toFileSystem,
                            String toPath)
        Specified by:
        copy in interface org.commonjava.storage.pathmapped.spi.PathDB
      • makeDirs

        public void makeDirs​(String fileSystem,
                             String path)
        Specified by:
        makeDirs in interface org.commonjava.storage.pathmapped.spi.PathDB
      • listOrphanedFiles

        public List<org.commonjava.storage.pathmapped.model.Reclaim> listOrphanedFiles​(int limit)
        Specified by:
        listOrphanedFiles in interface org.commonjava.storage.pathmapped.spi.PathDB
      • removeFromReclaim

        public void removeFromReclaim​(org.commonjava.storage.pathmapped.model.Reclaim reclaim)
        Specified by:
        removeFromReclaim in interface org.commonjava.storage.pathmapped.spi.PathDB
      • isMetricEnabled

        protected boolean isMetricEnabled​(String metricName)