Interface JournalService

  • All Implemented Interfaces:

    
    public interface JournalService
    
                        

    Submit/Commit the operation with a Journal. If a Journal exists in the context, then reuse it, otherwise create a new one in the context.

    Since:

    2019-06-05

    Author:

    trydofor

    • Constructor Detail

    • Method Detail

      • elapse

         abstract long elapse(@NotNull() JournalService.Journal journal)

        set and return elapse mills of the journal, can ignore error. SHOULD use the default connection without an explicit transaction. NOTE: submit/commit auto elapse, but create not.

      • create

        @NotNull() abstract JournalService.Journal create(long parentId, @NotNull() String eventName, @Nullable() String loginInfo, @Nullable() String targetKey, @Nullable() String otherInfo)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventName - event name
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        Returns:

        Journal without the context

      • submit

        @NotNull() abstract <R> R submit(@NotNull() String eventName, @Nullable() String loginInfo, @Nullable() String targetKey, @Nullable() String otherInfo, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet

        Parameters:
        eventName - event name
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() String eventName, @Nullable() String loginInfo, @Nullable() String targetKey, @Nullable() String otherInfo, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet

        Parameters:
        eventName - event name
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Class<out Object> eventClass, @Nullable() String loginInfo, @Nullable() Object targetKey, @Nullable() Object otherInfo)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventClass - use Class.
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Class<out Object> eventClass, @Nullable() String loginInfo, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to create targetKey/OtherInfo in Json

        Parameters:
        eventClass - use Class.
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Class<out Object> eventClass, @Nullable() String loginInfo, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to create targetKey/OtherInfo in Json

        Parameters:
        eventClass - use Class.
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Class<out Object> eventClass, @Nullable() Object targetKey, @Nullable() Object otherInfo)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventClass - use Class.
        targetKey - key/id of target
        otherInfo - other info of operation
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Class<out Object> eventClass, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventClass - use Class.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Class<out Object> eventClass, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventClass - use Class.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Class<out Object> eventClass, @Nullable() Object targetKey)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventClass - use Class.
        targetKey - key/id of target
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Class<out Object> eventClass, @Nullable() Object targetKey, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventClass - use Class.
        targetKey - key/id of target
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Class<out Object> eventClass, @Nullable() Object targetKey, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventClass - use Class.
        targetKey - key/id of target
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Class<out Object> eventClass)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventClass - use Class.
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Class<out Object> eventClass, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventClass - use Class.
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Class<out Object> eventClass, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventClass - use Class.
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Enum<out Object> eventEnum, @Nullable() String loginInfo, @Nullable() Object targetKey, @Nullable() Object otherInfo)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventEnum - convert enum with EnumConvertor
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Enum<out Object> eventEnum, @Nullable() String loginInfo, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to create targetKey/OtherInfo in Json

        Parameters:
        eventEnum - convert enum with EnumConvertor
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Enum<out Object> eventEnum, @Nullable() String loginInfo, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to create targetKey/OtherInfo in Json

        Parameters:
        eventEnum - convert enum with EnumConvertor
        loginInfo - login info ,eg.
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Enum<out Object> eventEnum, @Nullable() Object targetKey, @Nullable() Object otherInfo)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventEnum - convert enum with EnumConvertor
        targetKey - key/id of target
        otherInfo - other info of operation
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Enum<out Object> eventEnum, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventEnum - convert enum with EnumConvertor
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Enum<out Object> eventEnum, @Nullable() Object targetKey, @Nullable() Object otherInfo, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventEnum - convert enum with EnumConvertor
        targetKey - key/id of target
        otherInfo - other info of operation
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Enum<out Object> eventEnum, @Nullable() Object targetKey)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventEnum - convert enum with EnumConvertor
        targetKey - key/id of target
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Enum<out Object> eventEnum, @Nullable() Object targetKey, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventEnum - convert enum with EnumConvertor
        targetKey - key/id of target
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Enum<out Object> eventEnum, @Nullable() Object targetKey, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventEnum - convert enum with EnumConvertor
        targetKey - key/id of target
        commitSet - operations
        Returns:

        the journal

      • create

        @NotNull() JournalService.Journal create(long parentId, @NotNull() Enum<out Object> eventEnum)

        create new Journal without the context. SHOULD create journal in REQUIRES_NEW.

        Parameters:
        parentId - parent id, default 0;
        eventEnum - convert enum with EnumConvertor
        Returns:

        Journal without the context

      • submit

        @NotNull() <R> R submit(@NotNull() Enum<out Object> eventEnum, @NotNull() Function<JournalService.Journal, R> commitSet)

        Submit the operation (event) with journal and return some result. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventEnum - convert enum with EnumConvertor
        commitSet - operations
        Returns:

        the result

      • commit

        @NotNull() JournalService.Journal commit(@NotNull() Enum<out Object> eventEnum, @NotNull() Consumer<JournalService.Journal> commitSet)

        Commit the operation (event) with journal and return the journal. SHOULD create journal in REQUIRES_NEW, but not affect commitSet It is recommended to `Override` to get loginInfo in TerminalContext/SecurityContext

        Parameters:
        eventEnum - convert enum with EnumConvertor
        commitSet - operations
        Returns:

        the journal