Class DefaultNamingConvention

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultNamingConvention​(java.time.Duration rollPeriod, java.lang.String prefix, java.lang.String suffix, Factory<java.lang.String> uuidGenerator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isInRange​(java.lang.String name, long minTs, long maxTs)
      Validate that the given name belongs to given time range.
      java.lang.String nameOf​(long ts)
      Convert given timestamp to string representing atomic time range of this naming convention.
      Pair<java.lang.Long,​java.lang.Long> parseMinMaxTimestamp​(java.lang.String name)
      Parse min and max timestamp from given string.
      java.util.Set<java.lang.String> prefixesOf​(long startStamp, long endStamp)
      Convert given time range to prefixes, at least one of which must all Paths in given time range have.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultNamingConvention

        public DefaultNamingConvention​(java.time.Duration rollPeriod,
                                       java.lang.String prefix,
                                       java.lang.String suffix,
                                       Factory<java.lang.String> uuidGenerator)
    • Method Detail

      • nameOf

        public java.lang.String nameOf​(long ts)
        Description copied from interface: NamingConvention
        Convert given timestamp to string representing atomic time range of this naming convention.
        Specified by:
        nameOf in interface NamingConvention
        Parameters:
        ts - timestamp to create name for
        Returns:
        String representation of (prefixable) name representing time range
      • prefixesOf

        public java.util.Set<java.lang.String> prefixesOf​(long startStamp,
                                                          long endStamp)
        Description copied from interface: NamingConvention
        Convert given time range to prefixes, at least one of which must all Paths in given time range have.
        Specified by:
        prefixesOf in interface NamingConvention
        Parameters:
        startStamp - minimal timestamp (inclusive)
        endStamp - maximal timestamp (exclusive)
        Returns:
        String representation of name prefix
      • isInRange

        public boolean isInRange​(java.lang.String name,
                                 long minTs,
                                 long maxTs)
        Description copied from interface: NamingConvention
        Validate that the given name belongs to given time range.
        Specified by:
        isInRange in interface NamingConvention
        Parameters:
        name - name of the Path
        minTs - minimal timestamp (inclusive)
        maxTs - maximal timestamp (exclusive)
        Returns:
        true if the name belongs to given time range false otherwise
      • parseMinMaxTimestamp

        public Pair<java.lang.Long,​java.lang.Long> parseMinMaxTimestamp​(java.lang.String name)
        Description copied from interface: NamingConvention
        Parse min and max timestamp from given string.
        Specified by:
        parseMinMaxTimestamp in interface NamingConvention
        Parameters:
        name - name generated by this convention
        Returns:
        Pair of min and max timestamps