Interface ISequenceService

All Known Implementing Classes:
AtomicLongSequenceServiceImpl

public interface ISequenceService
序列服务
Author:
wangliang181230
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    currVal(String seqName)
    获取当前序列值
    long
    nextVal(String seqName)
    获取下一序列值
    long
    setVal(String seqName, long newVal)
    设置序列值
  • Method Details

    • currVal

      long currVal(@NonNull String seqName)
      获取当前序列值
      Parameters:
      seqName - 序列名
      Returns:
      当前序列值
      Throws:
      NotSupportedException - 部分实现无法设置序列值,将抛出该异常
    • nextVal

      long nextVal(@NonNull String seqName)
      获取下一序列值

      注意:实现类中不允许抛出 NotSupportedException,该方法是序列服务必须要支持的功能。

      Parameters:
      seqName - 序列名
      Returns:
      下一序列值
    • setVal

      long setVal(@NonNull String seqName, long newVal)
      设置序列值
      Parameters:
      seqName - 序列名
      newVal - 新的序列值
      Returns:
      previousVal 前序列值:null=没有序列值 | -1=未知
      Throws:
      NotSupportedException - 部分实现无法设置序列值,将抛出该异常